Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Commit

Permalink
Merge pull request #95 from aeslaughter/cleanup-93
Browse files Browse the repository at this point in the history
Various changes to clean up the code
  • Loading branch information
aeslaughter committed Sep 15, 2014
2 parents 1dd07c7 + 38bf880 commit e27a832
Show file tree
Hide file tree
Showing 28 changed files with 163 additions and 928 deletions.
43 changes: 40 additions & 3 deletions include/actions/PikaCriteriaAction.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,65 @@
/* With the U. S. Department of Energy */
/**********************************************************************************/

// MOOSE includes
#include "Action.h"
#include "MooseObjectAction.h"

// Forward declarations
class PikaCriteriaAction;

template<>
InputParameters validParams<PikaCriteriaAction>();

/**
* Creates necessary objects for outputing the various Phase-field related criterial checking objects.
*/
class PikaCriteriaAction : public Action
{
public:
PikaCriteriaAction(const std::string & name, InputParameters parameters);

virtual ~PikaCriteriaAction(){}

/**
* Builds the required objects based on the selected output types
*/
void act();

private:

/**
* A helper method for adding an action to the ActionWarhouse
* @param type The type of object that the action is to create
* @param name The name of the object that the action is to create
*/
void addAction(const std::string & type, const std::string & name);
MooseObjectAction * addCriteriaAction(const std::string & name);

/**
* A helper method for adding a PikaCriteria AuxKernel action the ActionWarhouse
* @param name The name of the object that the action is to create
*/
void addCriteriaAction(const std::string & name);

/**
* A helper method for creating an MooseObjectAction
* @param type The type of object to create
* @param name The name of the object to create
*/
MooseObjectAction * createAction(const std::string & type, const std::string & name);
void applyCoupledVar(const std::string & coupled_name, InputParameters & object_params);

/**
* Create the actions necessary for the postprocessor min/max/average outputs
* @param name The name of the Postprocessor to create
* @maram variable The variable name that the Postprocessor is operating on
*/
void createPostprocessorActions(const std::string & name, const std::string & var_name);


/**
* Adds an action associated with postprocessor min/max/average outputs
* @param name The name of the object generated
* @param var_name The variable name the Postprocessor should act upon
* @param type_id The type of computation (0 min, 1 max, 2 average)
*/
void addPostprocessorAction(const std::string & name, const std::string & var_name, int type_id);
};
9 changes: 1 addition & 8 deletions include/actions/PikaMaterialAction.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,7 @@ class PikaMaterialAction : public Action
* @param type The type object that the action will build
* @param object_name The longname of the object
*/
MooseObjectAction * create(std::string action_name, std::string type, std::string object_name);

/**
* A method for passing coupled variables from the action parameters to the object parameters
*
* This should be included in applyParameters, see https://github.com/idaholab/moose/issues/3352
*/
void applyCoupledVar(const std::string & coupled_name, InputParameters & object_params);
void create(std::string action_name, std::string type, std::string object_name);
};

#endif //PIKAMATERIALACTION_H
13 changes: 10 additions & 3 deletions include/auxkernels/ErrorFunctionAux.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,32 @@ template<>
InputParameters validParams<ErrorFunctionAux>();

/**
*
* A class for computing the absolute error of a variable
*/
class ErrorFunctionAux : public FunctionAux
{
public:

/**
* Class constructor
* @param name
* @param parameters
* @param name Object name
* @param parameters Object input parameters
*/
ErrorFunctionAux(const std::string & name, InputParameters parameters);

protected:

/**
* Computes the error
*/
virtual Real computeValue();

private:

/// A reference to the solution variable to compute the error from
const VariableValue & _soln;

/// The type of error to compute
MooseEnum _error_type;

};
Expand Down
43 changes: 41 additions & 2 deletions include/auxkernels/PikaCriteria.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,69 @@ class PikaCriteria;
template<>
InputParameters validParams<PikaCriteria>();

/**
* A class for computing phase-field related criteria
*
* The available 'criteria' (see Kaempfer and Plapp (2009)):
* 'ice' - Eq. 43a
* 'air' - Eq. 43b
* 'vapor' - Eq. 43c
* 'velocity' - Eq. 45
* 'time' = Eq. 47
*
*/
class PikaCriteria : public AuxKernel,
public PropertyUserObjectInterface
{
public:
PikaCriteria(const std::string & name, InputParameters parameters);

virtual ~PikaCriteria(){}

protected:

/**
* Compute the desired criteria at the current quadrature point
*/
Real computeValue();

private:

/// The interface velocity
const VariableValue & _v_n;

/// Thermal conductivity of ice
const MaterialProperty<Real> & _k_i;

/// Thermal conductivity of air/vapor
const MaterialProperty<Real> & _k_a;

/// Heat capacity of ice
const MaterialProperty<Real> & _c_i;

/// Heat capaticy of ice/air
const MaterialProperty<Real> & _c_a;

/// Equilibribum water vapor concentration at saturation
const MaterialProperty<Real> & _rho_vs;

/// Density of ice
const MaterialProperty<Real> & _rho_i;

/// Diffusion coefficient of water vapor
const MaterialProperty<Real> & _D_v;

/// Interface kinetic coefficient
const MaterialProperty<Real> & _beta;

/// Capilary length
const Real & _d_0;

/// Desired criteria to compute
MooseEnum _criteria;

/// Estimated pore size
Real _pore_size;
Real _xi;

/// Temporal scaling factor
Real _xi;
};
13 changes: 10 additions & 3 deletions include/auxkernels/PikaInterfaceVelocity.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ template<>
InputParameters validParams<PikaInterfaceVelocity>();

/**
*
* Computes the interface velocity via Eq. 23
*/
class PikaInterfaceVelocity :
public AuxKernel,
Expand All @@ -33,7 +33,8 @@ class PikaInterfaceVelocity :

/**
* Class constructor
* @param name
* @param name Object name
* @param parameters Object InputParameters
*/
PikaInterfaceVelocity(const std::string & name, InputParameters parameters);

Expand All @@ -45,13 +46,19 @@ class PikaInterfaceVelocity :
protected:

/**
*
* Computes the interface velocity at the current quadrature point
*/
virtual Real computeValue();

private:

/// Reference the the constant diffusivity coefficient for water vapor
const Real & _D_v;

/// Gradient of the phase-field variable
VariableGradient & _grad_phase;

/// Gradient of the chemical potential variable
VariableGradient & _grad_s;

};
Expand Down
16 changes: 13 additions & 3 deletions include/auxkernels/PikaPhaseInitializeAux.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,35 @@ template<>
InputParameters validParams<PikaPhaseInitializeAux>();

/**
*
* An AuxKernel for computing a limited phase variable
*/
class PikaPhaseInitializeAux : public AuxKernel
{
public:

/**
* Class constructor
* @param name
* @param parameters
* @param name The name of the object
* @param parameters InputParameters for the object
*/
PikaPhaseInitializeAux(const std::string & name, InputParameters parameters);

protected:

/**
* Computes limited value of the supplied phase variable
*/
virtual Real computeValue();

private:

/// The variable to range limit
const VariableValue & _phase;

/// The upper range to limit the variable
Real _upper;

/// The lower range to limit the variable
Real _lower;

};
Expand Down
16 changes: 13 additions & 3 deletions include/auxkernels/PikaSupersaturation.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ template<>
InputParameters validParams<PikaSupersaturation>();

/**
*
* AuxKernel for computing the supersaturation
*/
class PikaSupersaturation :
public AuxKernel,
Expand All @@ -35,7 +35,8 @@ class PikaSupersaturation :

/**
* Class constructor
* @param name
* @param name Name of the object
* @param parameters
*/
PikaSupersaturation(const std::string & name, InputParameters parameters);

Expand All @@ -47,16 +48,25 @@ class PikaSupersaturation :
protected:

/**
*
* Computes the value of supersaturation, Eq. 18 and Eq. 22
*/
virtual Real computeValue();

private:

/// Chemical potential variable
VariableValue & _s;

/// Temperature variable
VariableValue & _temperature;

/// Density of ice
const Real & _rho_i;

/// Temporal scaling factor
Real _xi;

/// If true, the supersaturation is normalized as in Eq. 18 by rho_vs
bool _normalize;
};

Expand Down
5 changes: 3 additions & 2 deletions include/auxkernels/PikaWaterVaporConcentration.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ class PikaWaterVaporConcentration :

/**
* Class constructor
* @param name
* @param name Name of the object
* @param parameters InputParameters for the object
*/
PikaWaterVaporConcentration(const std::string & name, InputParameters parameters);

Expand All @@ -47,7 +48,7 @@ class PikaWaterVaporConcentration :
protected:

/**
* Computes the value of the water vapor concentration
* Computes the value of the water vapor concentration using Eq. 21
*/
virtual Real computeValue();

Expand Down
44 changes: 0 additions & 44 deletions include/auxkernels/SharpInterfaceCheckAir.h

This file was deleted.

Loading

0 comments on commit e27a832

Please sign in to comment.