Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating Doc String: Address Issue #258 #263

Open
wants to merge 10 commits into
base: devel
Choose a base branch
from
53 changes: 53 additions & 0 deletions include/actions/AddDriftDiffusionAction.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,17 @@
#include "AddVariableAction.h"
#include "Action.h"

/**
* This class allows us to have a section of the input file like the
* following which automatically adds variables, kernels, aux kernels, bcs
* for setting up the drift-diffusion equation for multiple plasma species
* and automatically adds the Poisson's equation for electrostatic cases.
*
* [DriftDiffusionAction]
* [Plasma]
* []
* []
*/
class AddDriftDiffusionAction : public Action
{
public:
Expand All @@ -23,17 +34,59 @@ class AddDriftDiffusionAction : public Action
virtual void act();

protected:
/**
* Helper function that supplies the potentials charge sources
* @param potential_name The name of the electrostatic potential
* @param charged_particle_name The name of the charge particle density
*/
virtual void addChargeSourceKernels(const std::string & potential_name,
const std::string & charged_particle_name);

/**
* Helper function that supplies the Kernels for drift-diffusion for the electrons,
* energy independent charged particles, neutral particles, and
* electron mean energy density
* @param name The name of the density variable
* @param potential_name The name of the electrostatic potential
* @param Using_offset True if the LogStabilizationMoles Kernel being used
* @param charged True if the density variable has a charge
* @param energy True if the density is a mean energy density variable
*/
virtual void addADKernels(const std::string & name,
const std::string & potential_name,
const bool & Using_offset,
const bool & charged,
const bool & energy);

/**
* Helper function that supplies the Aux kernels to convert scaled position units
* when the user sets position_units to non-unity value
* @param position_name The name of the position variable in the format of {component +
* "_position" + block}
* @param component The spatial component defined as x=0, y=1, and z=2
*/
virtual void addPosition(const std::string & position_name, const int & component);

/**
* Helper function that supplies the Aux kernels to convert densities from logarithmic form
* @param particle_name The name of the density variable
*/
virtual void addDensityLog(const std::string & particle_name);

/**
* Helper function that supplies the Aux kernels for current
* @param particle_name The name of the charge density variable
* @param potential_name The name of the electrostatic potential
*/
virtual void addCurrent(const std::string & particle_name, const std::string & potential_name);

/**
* Helper function that supplies the Aux kernels for the electric field
* @param Efield_name The name of the electric field variable in the format of {"Efield" +
* component + block}
* @param potential_name The name of the electrostatic potential
* @param component The spatial component defined as x=0, y=1, and z=2
*/
virtual void addEfield(const std::string & Efield_name,
const std::string & potential_name,
const int & component);
Expand Down
38 changes: 37 additions & 1 deletion include/actions/AddPeriodicControllers.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@

#include "Action.h"

// class AddPeriodicControllers : public AddControlAction
/*
* This Action automatically adds multiple 'TimePeriod' controllers for
* the purpose of enabling and disabling multiple objects cyclically.
*/
class AddPeriodicControllers : public Action
{
public:
Expand All @@ -23,42 +26,75 @@ class AddPeriodicControllers : public Action
virtual void act();

protected:
/**
* Function that adds a 'TimePeriod' controller
* @param enableORdisable Stating to uses either the "enable_objects" or "disable_objects"
* parameter from 'TimePeriod'
* @param objects The name of objects that are either being enabled or disabled
* @param start_times The time values to start the controller
* @param end_times The time values to stop the controller
* @param name_num The current number of the controller for the naming of the controller object
* @param first_controller True if this is the first controller object being set
*/
virtual void AddTimePeriod(const std::string & enableORdisable,
const std::vector<std::string> & objects,
const std::vector<Real> & start_times,
const std::vector<Real> & end_times,
const std::string & name_num,
const bool & first_controller);

/// A list of object names to enable at the start of the cycle
std::vector<std::string> _enable_start;
/// A list of object names to enable during the cycle
std::vector<std::string> _enable_during;
/// A list of object names to enable at the end of the cycle
std::vector<std::string> _enable_end;

/// A list of object names to disable at the start of the cycle
std::vector<std::string> _disable_start;
/// A list of object names to disable during the cycle
std::vector<std::string> _disable_during;
/// A list of object names to disable at the end of the cycle
std::vector<std::string> _disable_end;

/// The starting time to begin adding 'TimePeriod' controllers
Real _start_time;
/// The period of the cycle
Real _period;
/// The number of cycles between enabling and disabling objects
Real _cycles_per_controls;
/// Total number of 'TimePeriod' controllers to add
Real _num_controller_set;
/// Name of the 'TimePeriod' controllers
std::string _name;

/// The array that holds the start times for objects that are enabled at the start of the cycle
std::vector<Real> _enable_start_start_time_index;
/// The array that holds the end times for objects that are enabled at the start of the cycle
std::vector<Real> _enable_start_end_time_index;

/// The array that holds the start times for objects that are enabled during the cycle
std::vector<Real> _enable_during_start_time_index;
/// The array that holds the end times for objects that are enabled during the cycle
std::vector<Real> _enable_during_end_time_index;

/// The array that holds the start times for objects that are enabled at the end of the cycle
std::vector<Real> _enable_end_start_time_index;
/// The array that holds the end times for objects that are enabled at the end of the cycle
std::vector<Real> _enable_end_end_time_index;

/// The array that holds the start times for objects that are disabled at the start of the cycle
std::vector<Real> _disable_start_start_time_index;
/// The array that holds the end times for objects that are disabled at the start of the cycle
std::vector<Real> _disable_start_end_time_index;

/// The array that holds the start times for objects that are disabled during the cycle
std::vector<Real> _disable_during_start_time_index;
/// The array that holds the end times for objects that are disabled during the cycle
std::vector<Real> _disable_during_end_time_index;

/// The array that holds the start times for objects that are disabled at the end of the cycle
std::vector<Real> _disable_end_start_time_index;
/// The array that holds the end times for objects that are disabled at the end of the cycle
std::vector<Real> _disable_end_end_time_index;
};
53 changes: 53 additions & 0 deletions include/actions/AddPeriodicRelativeNodalDifference.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
#include "AddVariableAction.h"
#include "Action.h"

/*
* This Action automatically adds the necessary objects to calculate the relative
* periodic difference. Relative Difference will be outputted as a Postprocessor named:
* 'var'_periodic_difference
*/
class AddPeriodicRelativeNodalDifference : public Action
{
public:
Expand All @@ -23,31 +28,79 @@ class AddPeriodicRelativeNodalDifference : public Action
virtual void act();

protected:
/**
* Function for setting ICs for the previous and sudo previous solutions
* @param variable_name The name of the variable
* @param initial The inital value of the variable
*/
virtual void addPerviousSolutionsIC(const std::string & variable_name, const Real & initial);
/**
* Function for setting AuxKernels for the previous and sudo previous solutions
* @param variable_name The name of the auxvariable that stores the previous cycle solution
* @param var_old_name The name of the variable storing the solution at the beginning of the time
* step
*/
virtual void addPerviousSolutionsKernels(const std::string & variable_name,
const std::string & var_old_name);
/**
* Function for setting AuxKernels to normalize solutions
* @param variable_name The name of the auxvariable that stores normalization value
* @param source The name of the variable to be normalizated
* @param averaged The name of the postprocessor that calculates the spatial average
* @param log True if the source is in a logarithmic form
*/
virtual void addNormalizationKernels(const std::string & variable_name,
const std::string & source,
const std::string & averaged,
const bool & log);
/**
* Function for setting Postprocessor to take the nodal average
* @param variable_name The name of the variable to be averaged
* @param log True if the variable is in a logarithmic form
*/
virtual void addAverageNodalPP(const std::string & variable_name, const bool & log);
/**
* Function for setting Postprocessor to take the average nodal difference
* @param variable_name The name of the variable that stores the current average
* @param var_old_name The name of the variable that stores the average from the previous cycle
* @param name The name of the variable that was averaged
*/
virtual void addRelativePeriodicDiffPP(const std::string & variable_name,
const std::string & var_old_name,
const std::string & name);
/**
* Function that adds a 'TimePeriod' controller to begin calculating the relative periodic
* difference
* @param objects The name of objects that are either being enabled or disabled
* @param start_times The time values to start the controller
* @param end_times The time values to stop the controller
* @param name_num The current number of the controller for the naming of the controller object
* @param first_controller True if this is the first controller object being set
*/
virtual void AddTimePeriod(const std::vector<std::string> & objects,
const std::vector<Real> & start_times,
const std::vector<Real> & end_times,
const std::string & name_num,
const bool & first_controller);

/// The starting time to begin calculating the relative periodic difference
Real _start_time;
/// The period of the cycle
Real _period;
/// The number of cycles this object, PeriodicRelativeNodalDifference, is active
Real _num_controller_set;

/// The name of objects to enable at the start of the cycle
std::vector<std::string> _enable_start;
/// The name of objects to enable at the end of the cycle
std::vector<std::string> _enable_end;

/// The array that holds the start times for objects that are enabled at the start of the cycle
std::vector<Real> _enable_start_start_time_index;
/// The array that holds the end times for objects that are enabled at the start of the cycle
std::vector<Real> _enable_start_end_time_index;
/// The array that holds the start times for objects that are enabled at the end of the cycle
std::vector<Real> _enable_end_start_time_index;
/// The array that holds the end times for objects that are enabled at the end of the cycle
std::vector<Real> _enable_end_end_time_index;
};
4 changes: 4 additions & 0 deletions include/auxkernels/AbsValueAux.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@

#include "AuxKernel.h"

/**
* Returns the absolute value of the specified variable.
*/
class AbsValueAux : public AuxKernel
{
public:
Expand All @@ -23,5 +26,6 @@ class AbsValueAux : public AuxKernel
virtual Real computeValue() override;

private:
/// The coupled variable that this object is taking the absolute value of.
const VariableValue & _u;
};
14 changes: 13 additions & 1 deletion include/auxkernels/Current.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@

#include "AuxKernel.h"

/**
* Returns the electric current associated with the flux of the specified species
*/
template <bool is_ad>
class CurrentTempl : public AuxKernel
{
Expand All @@ -24,16 +27,25 @@ class CurrentTempl : public AuxKernel
virtual Real computeValue() override;

protected:
/// The component of the current
const int _component;
/// The scaling units for the position
const Real _r_units;

/// The coupled density variable
const MooseVariable & _density_var;
/// The value of the coupled density variable
const VariableValue & _density_log;
/// The gradient of the coupled density variable
const VariableGradient & _grad_density_log;
/// The gradient of the coupled potential
const VariableGradient & _grad_potential;
/// The mobility coefficient
const GenericMaterialProperty<Real, is_ad> & _mu;
/// The charge sign of the coupled species
const MaterialProperty<Real> & _sgn;
/// The diffusion coefficient
const GenericMaterialProperty<Real, is_ad> & _diff;
/// True if an artifical diffusion term is needed
bool _art_diff;
};

Expand Down
6 changes: 6 additions & 0 deletions include/auxkernels/DensityMoles.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@

#include "Density.h"

/**
* Returns physical densities in units of #/m^3
*/
class DensityMoles : public Density
{
public:
Expand All @@ -24,6 +27,9 @@ class DensityMoles : public Density
protected:
virtual Real computeValue() override;

/// True if molar density is used
bool _convert_moles;

/// Avogadro's number
const MaterialProperty<Real> & _N_A;
};
17 changes: 17 additions & 0 deletions include/auxkernels/DensityNormalization.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@

#include "AuxKernel.h"

/**
* Normalize variables expressed in logarithmic form (n) by a
* postprocessor value (pp_value) in the form of:
*
* f * (exp(n) / pp_value) - shift
*
* where f and shift are user defined normalization and
* shifting factors, respectively (the default values being
* f = 1. and shift = 0.)
*/
class DensityNormalization : public AuxKernel
{
public:
Expand All @@ -22,8 +32,15 @@ class DensityNormalization : public AuxKernel
protected:
virtual Real computeValue() override;

/// Coupled density value
const VariableValue & _density;

/// Denominator to normalize to
const Real * _pp_on_source;

/// A factor to shift the normilization by
const Real * _shift;

/// A factor to multiply the normilization by
Real _normal_factor;
};
Loading