OGS
MaterialPropertyLib::PorosityFromMassBalance Class Referencefinal

Detailed Description

Porosity depending on the volumetric strain rate and phase pressure rate.

This property must be a solid phase.

Definition at line 24 of file PorosityFromMassBalance.h.

#include <PorosityFromMassBalance.h>

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

Public Member Functions

 PorosityFromMassBalance (std::string name, ParameterLib::Parameter< double > const &initial_porosity, double const phi_min, double const phi_max)
 
void checkScale () const override
 
PropertyDataType initialValue (ParameterLib::SpatialPosition const &pos, double const t) const override
 
PropertyDataType value (VariableArray const &variable_array, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const override
 
PropertyDataType value (VariableArray const &variable_array, VariableArray const &variable_array_prev, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const override
 
PropertyDataType dValue (VariableArray const &variable_array, Variable const variable, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const override
 
- Public Member Functions inherited from MaterialPropertyLib::Property
virtual ~Property ()
 
virtual PropertyDataType value () 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 PropertyDataType d2Value (VariableArray const &variable_array, Variable const variable1, Variable const variable2, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const
 Default implementation: 2nd derivative of any constant property is zero.
 
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
 

Private Attributes

ParameterLib::Parameter< double > const & phi0_
 Parameter, which is used by FEM to set the initial porosity value.
 
double const phi_min_
 
double const phi_max_
 

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

◆ PorosityFromMassBalance()

MaterialPropertyLib::PorosityFromMassBalance::PorosityFromMassBalance ( std::string name,
ParameterLib::Parameter< double > const & initial_porosity,
double const phi_min,
double const phi_max )
inline

Definition at line 33 of file PorosityFromMassBalance.h.

37 : phi0_(initial_porosity), phi_min_(phi_min), phi_max_(phi_max)
38 {
39 name_ = std::move(name);
40 }
ParameterLib::Parameter< double > const & phi0_
Parameter, which is used by FEM to set the initial porosity value.

References MaterialPropertyLib::name, and MaterialPropertyLib::Property::name_.

Member Function Documentation

◆ checkScale()

void MaterialPropertyLib::PorosityFromMassBalance::checkScale ( ) const
overridevirtual

Reimplemented from MaterialPropertyLib::Property.

Definition at line 19 of file PorosityFromMassBalance.cpp.

20{
21 if (!std::holds_alternative<Medium*>(scale_))
22 {
24 "The property 'PorosityFromMassBalance' is "
25 "implemented on the 'medium' scales only.");
26 }
27}
#define OGS_FATAL(...)
Definition Error.h:26
std::variant< Medium *, Phase *, Component * > scale_
Definition Property.h:297

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

◆ dValue()

PropertyDataType MaterialPropertyLib::PorosityFromMassBalance::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 65 of file PorosityFromMassBalance.cpp.

69{
70 OGS_FATAL("PorosityFromMassBalance derivatives are not implemented.");
71}

References OGS_FATAL.

◆ initialValue()

PropertyDataType MaterialPropertyLib::PorosityFromMassBalance::initialValue ( ParameterLib::SpatialPosition const & pos,
double const t ) const
inlineoverridevirtual

Returns the initial (or reference) value of the property. The default implementation forwards to the value function.

Reimplemented from MaterialPropertyLib::Property.

Definition at line 44 of file PorosityFromMassBalance.h.

46 {
47 return fromVector(phi0_(t, pos));
48 }
PropertyDataType fromVector(std::vector< double > const &values)
Definition Property.cpp:23

References MaterialPropertyLib::fromVector(), and phi0_.

◆ value() [1/2]

PropertyDataType MaterialPropertyLib::PorosityFromMassBalance::value ( VariableArray const & variable_array,
ParameterLib::SpatialPosition const & pos,
double const t,
double const dt ) const
overridevirtual

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

Reimplemented from MaterialPropertyLib::Property.

Definition at line 29 of file PorosityFromMassBalance.cpp.

33{
35 "PorosityFromMassBalance value call requires previous time step "
36 "values.");
37}

References OGS_FATAL.

◆ value() [2/2]

PropertyDataType MaterialPropertyLib::PorosityFromMassBalance::value ( VariableArray const & variable_array,
VariableArray const & variable_array_prev,
ParameterLib::SpatialPosition const & pos,
double const t,
double const dt ) const
overridevirtual

This virtual method will compute the property value based on the variables that are passed as arguments and the variables from the previous time step.

Reimplemented from MaterialPropertyLib::Property.

Definition at line 39 of file PorosityFromMassBalance.cpp.

44{
45 double const beta_SR = variable_array.grain_compressibility;
46 auto const alpha_b =
47 std::get<Medium*>(scale_)
49 .template value<double>(variable_array, pos, t, dt);
50
51 double const e = variable_array.volumetric_strain;
52 double const e_prev = variable_array_prev.volumetric_strain;
53 double const delta_e = e - e_prev;
54
55 double const p_eff = variable_array.effective_pore_pressure;
56 double const p_eff_prev = variable_array_prev.effective_pore_pressure;
57 double const delta_p_eff = p_eff - p_eff_prev;
58
59 double const phi_prev = variable_array_prev.porosity;
60
61 double const w = delta_e + delta_p_eff * beta_SR;
62 return std::clamp((phi_prev + alpha_b * w) / (1 + w), phi_min_, phi_max_);
63}
virtual PropertyDataType value() const
Definition Property.cpp:76

References MaterialPropertyLib::biot_coefficient, MaterialPropertyLib::VariableArray::effective_pore_pressure, MaterialPropertyLib::VariableArray::grain_compressibility, phi_max_, phi_min_, MaterialPropertyLib::VariableArray::porosity, MaterialPropertyLib::Property::scale_, MaterialPropertyLib::Property::value(), and MaterialPropertyLib::VariableArray::volumetric_strain.

Member Data Documentation

◆ phi0_

ParameterLib::Parameter<double> const& MaterialPropertyLib::PorosityFromMassBalance::phi0_
private

Parameter, which is used by FEM to set the initial porosity value.

Definition at line 28 of file PorosityFromMassBalance.h.

Referenced by initialValue().

◆ phi_max_

double const MaterialPropertyLib::PorosityFromMassBalance::phi_max_
private

Definition at line 30 of file PorosityFromMassBalance.h.

Referenced by value().

◆ phi_min_

double const MaterialPropertyLib::PorosityFromMassBalance::phi_min_
private

Definition at line 29 of file PorosityFromMassBalance.h.

Referenced by value().


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