OGS
MaterialPropertyLib::IdealGasLawBinaryMixture Class Referencefinal

Detailed Description

Density function for binary ideal gases.

This property must be a phase property, it computes the density of a mixture of ideal gases as function of phase pressure, capillary pressure, and temperature.

Definition at line 27 of file IdealGasLawBinaryMixture.h.

#include <IdealGasLawBinaryMixture.h>

Inheritance diagram for MaterialPropertyLib::IdealGasLawBinaryMixture:
[legend]
Collaboration diagram for MaterialPropertyLib::IdealGasLawBinaryMixture:
[legend]

Public Member Functions

 IdealGasLawBinaryMixture (std::string name)
 
void checkScale () const override
 
PropertyDataType value (VariableArray const &variable_array, ParameterLib::SpatialPosition const &, double const, double const) const override
 
PropertyDataType dValue (VariableArray const &variable_array, Variable const variable, ParameterLib::SpatialPosition const &, double const, double const) const override
 
PropertyDataType d2Value (VariableArray const &variable_array, Variable const variable1, Variable const variable2, ParameterLib::SpatialPosition const &, double const, double const) const override
 Default implementation: 2nd derivative of any constant property is zero.
 
- Public Member Functions inherited from MaterialPropertyLib::Property
virtual ~Property ()
 
virtual PropertyDataType initialValue (ParameterLib::SpatialPosition const &pos, double const t) const
 
virtual PropertyDataType value () const
 
virtual PropertyDataType value (VariableArray const &variable_array, VariableArray const &variable_array_prev, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const
 
virtual PropertyDataType dValue (VariableArray const &variable_array, VariableArray const &variable_array_prev, Variable const variable, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const
 
virtual void setProperties (std::vector< std::unique_ptr< Phase > > const &phases)
 Default implementation:
 
void setScale (std::variant< Medium *, Phase *, Component * > scale)
 
template<typename T >
initialValue (ParameterLib::SpatialPosition const &pos, double const t) const
 
template<typename T >
value () const
 
template<typename T >
value (VariableArray const &variable_array, VariableArray const &variable_array_prev, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const
 
template<typename T >
value (VariableArray const &variable_array, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const
 
template<typename T >
dValue (VariableArray const &variable_array, VariableArray const &variable_array_prev, Variable const variable, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const
 
template<typename T >
dValue (VariableArray const &variable_array, Variable const variable, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const
 
template<typename T >
d2Value (VariableArray const &variable_array, Variable const &variable1, Variable const &variable2, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const
 

Additional Inherited Members

- Protected Attributes inherited from MaterialPropertyLib::Property
std::string name_
 
PropertyDataType value_
 The single value of a property.
 
PropertyDataType dvalue_
 
std::variant< Medium *, Phase *, Component * > scale_
 

Constructor & Destructor Documentation

◆ IdealGasLawBinaryMixture()

MaterialPropertyLib::IdealGasLawBinaryMixture::IdealGasLawBinaryMixture ( std::string name)
explicit

Member Function Documentation

◆ checkScale()

void MaterialPropertyLib::IdealGasLawBinaryMixture::checkScale ( ) const
inlineoverridevirtual

Reimplemented from MaterialPropertyLib::Property.

Definition at line 32 of file IdealGasLawBinaryMixture.h.

33 {
34 if (!std::holds_alternative<Phase*>(scale_))
35 {
37 "The property 'IdealGasLawBinaryMixture' is implemented on the "
38 "'phase' scale only.");
39 }
40 }
#define OGS_FATAL(...)
Definition Error.h:26
std::variant< Medium *, Phase *, Component * > scale_
Definition Property.h:297

References OGS_FATAL, and MaterialPropertyLib::Property::scale_.

◆ d2Value()

PropertyDataType MaterialPropertyLib::IdealGasLawBinaryMixture::d2Value ( VariableArray const & variable_array,
Variable const variable1,
Variable const variable2,
ParameterLib::SpatialPosition const & pos,
double const t,
double const dt ) const
overridevirtual

Default implementation: 2nd derivative of any constant property is zero.

This virtual method will compute the second derivative of a property with respect to the given variables pv1 and pv2.

Reimplemented from MaterialPropertyLib::Property.

Definition at line 67 of file IdealGasLawBinaryMixture.cpp.

71{
72 OGS_FATAL("IdealGasLawBinaryMixture::d2Value is not implemented.");
73
74 return 0.;
75}

References OGS_FATAL.

◆ dValue()

PropertyDataType MaterialPropertyLib::IdealGasLawBinaryMixture::dValue ( VariableArray const & variable_array,
Variable const variable,
ParameterLib::SpatialPosition const & pos,
double const t,
double const dt ) const
overridevirtual

This virtual method will compute the property derivative value based on the variables that are passed as arguments with the default implementation using empty variables array for the previous time step.

The default implementation of this method only returns the property value derivative without altering it.

Reimplemented from MaterialPropertyLib::Property.

Definition at line 38 of file IdealGasLawBinaryMixture.cpp.

42{
44 const double pGR = variable_array.gas_phase_pressure;
45 const double T = variable_array.temperature;
46 const double MG = variable_array.molar_mass;
47 const double dMG_dx = variable_array.molar_mass_derivative;
48
49 switch (variable)
50 {
52 return MG / R / T + pGR / R / T * dMG_dx;
54 return pGR / R / T * dMG_dx;
56 return pGR / R / T / T * (T * dMG_dx - MG);
57 default:
59 "IdealGasLawBinaryMixture::dValue is implemented only for "
60 "derivatives "
61 "w.r.t. gas_pressure, capillary_pressure, and temperature.");
62 break;
63 }
64 return 0.;
65}

References MaterialPropertyLib::capillary_pressure, MaterialPropertyLib::gas_phase_pressure, MaterialPropertyLib::VariableArray::gas_phase_pressure, MaterialLib::PhysicalConstant::IdealGasConstant, MaterialPropertyLib::VariableArray::molar_mass, MaterialPropertyLib::VariableArray::molar_mass_derivative, OGS_FATAL, MaterialPropertyLib::temperature, and MaterialPropertyLib::VariableArray::temperature.

◆ value()

PropertyDataType MaterialPropertyLib::IdealGasLawBinaryMixture::value ( VariableArray const & variable_array,
ParameterLib::SpatialPosition const & ,
double const ,
double const  ) const
overridevirtual

Those methods override the base class implementations and actually compute and set the property values_ and dValues_.

Reimplemented from MaterialPropertyLib::Property.

Definition at line 25 of file IdealGasLawBinaryMixture.cpp.

29{
31 const double pGR = variable_array.gas_phase_pressure;
32 const double T = variable_array.temperature;
33 const double MG = variable_array.molar_mass;
34
35 return pGR * MG / R / T;
36}

References MaterialPropertyLib::VariableArray::gas_phase_pressure, MaterialLib::PhysicalConstant::IdealGasConstant, MaterialPropertyLib::VariableArray::molar_mass, and MaterialPropertyLib::VariableArray::temperature.


The documentation for this class was generated from the following files: