Skip to content
Snippets Groups Projects
Commit c666ea8b authored by Thomas Fetzer's avatar Thomas Fetzer
Browse files

[material] Add molarMass function and default values to component/constant

parent 84efd446
No related branches found
No related tags found
1 merge request!145[material] Add molarMass function and default values to component/constant.hh
......@@ -25,11 +25,30 @@
#define DUMUX_CONSTANT_HH
#include <dumux/common/parameters.hh>
#include <dumux/common/basicproperties.hh>
#include "component.hh"
namespace Dumux
{
namespace Properties
{
// forward declaration of the needed properties
NEW_PROP_TAG(ProblemMolarMass);
NEW_PROP_TAG(ProblemLiquidDensity);
NEW_PROP_TAG(ProblemLiquidKinematicViscosity);
NEW_PROP_TAG(ProblemGasDensity);
NEW_PROP_TAG(ProblemGasKinematicViscosity);
// set default values
SET_SCALAR_PROP(NumericModel, ProblemMolarMass, 1.0);
SET_SCALAR_PROP(NumericModel, ProblemLiquidDensity, 1.0);
SET_SCALAR_PROP(NumericModel, ProblemLiquidKinematicViscosity, 1.0);
SET_SCALAR_PROP(NumericModel, ProblemGasDensity, 1.0);
SET_SCALAR_PROP(NumericModel, ProblemGasKinematicViscosity, 1.0);
} // end namespace Properties
/*!
* \ingroup Components
*
......@@ -49,6 +68,16 @@ public:
static const char *name()
{ return "Constant"; }
/*!
* \brief The mass in \f$\mathrm{[kg]}\f$ of one mole of the component.
*/
static Scalar molarMass()
{
static const Scalar molarMass
= GET_PARAM_FROM_GROUP(TypeTag, Scalar, Problem, MolarMass);
return molarMass;
}
/*!
* \brief Returns true if the liquid phase is assumed to be compressible
*/
......@@ -64,7 +93,7 @@ public:
static Scalar liquidDensity(Scalar temperature, Scalar pressure)
{
static const Scalar density
= GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, Scalar, Problem, LiquidDensity);
= GET_PARAM_FROM_GROUP(TypeTag, Scalar, Problem, LiquidDensity);
return density;
}
......@@ -80,7 +109,7 @@ public:
static Scalar liquidViscosity(Scalar temperature, Scalar pressure)
{
static const Scalar kinematicViscosity
= GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, Scalar, Problem, LiquidKinematicViscosity);
= GET_PARAM_FROM_GROUP(TypeTag, Scalar, Problem, LiquidKinematicViscosity);
return kinematicViscosity * liquidDensity(temperature, pressure);
}
......@@ -100,7 +129,7 @@ public:
static Scalar gasDensity(Scalar temperature, Scalar pressure)
{
static const Scalar density
= GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, Scalar, Problem, GasDensity);
= GET_PARAM_FROM_GROUP(TypeTag, Scalar, Problem, GasDensity);
return density;
}
......@@ -116,7 +145,7 @@ public:
static Scalar gasViscosity(Scalar temperature, Scalar pressure)
{
static const Scalar kinematicViscosity
= GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, Scalar, Problem, GasKinematicViscosity);
= GET_PARAM_FROM_GROUP(TypeTag, Scalar, Problem, GasKinematicViscosity);
return kinematicViscosity * gasDensity(temperature, pressure);
}
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment