OGS
MaterialPropertyLib::EffectiveThermalConductivityPorosityMixing< GlobalDim > Class Template Referencefinal

Detailed Description

template<int GlobalDim>
class MaterialPropertyLib::EffectiveThermalConductivityPorosityMixing< GlobalDim >

Porosity mixing based model for effective heat conduction

This property is a medium property. The corresponding values are taken from the liquid/solid phase.

Definition at line 27 of file EffectiveThermalConductivityPorosityMixing.h.

#include <EffectiveThermalConductivityPorosityMixing.h>

Inheritance diagram for MaterialPropertyLib::EffectiveThermalConductivityPorosityMixing< GlobalDim >:
[legend]
Collaboration diagram for MaterialPropertyLib::EffectiveThermalConductivityPorosityMixing< GlobalDim >:
[legend]

Public Member Functions

 EffectiveThermalConductivityPorosityMixing (std::string name, ParameterLib::CoordinateSystem const *const local_coordinate_system)
 
void checkScale () const override
 
PropertyDataType value (VariableArray const &variable_array, 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
 
 EffectiveThermalConductivityPorosityMixing (std::string name, ParameterLib::CoordinateSystem const *const local_coordinate_system)
 
void checkScale () const
 
PropertyDataType value (VariableArray const &variable_array, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const
 
PropertyDataType dValue (VariableArray const &, Variable const, ParameterLib::SpatialPosition const &, double const, double const) const
 
- 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 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::CoordinateSystem const *const local_coordinate_system_
 

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

◆ EffectiveThermalConductivityPorosityMixing() [1/2]

template<int GlobalDim>
MaterialPropertyLib::EffectiveThermalConductivityPorosityMixing< GlobalDim >::EffectiveThermalConductivityPorosityMixing ( std::string name,
ParameterLib::CoordinateSystem const *const local_coordinate_system )

◆ EffectiveThermalConductivityPorosityMixing() [2/2]

MaterialPropertyLib::EffectiveThermalConductivityPorosityMixing< 1 >::EffectiveThermalConductivityPorosityMixing ( std::string name,
ParameterLib::CoordinateSystem const *const local_coordinate_system )

Definition at line 23 of file EffectiveThermalConductivityPorosityMixing.cpp.

27 : local_coordinate_system_(local_coordinate_system)
28{
29 name_ = std::move(name);
30}

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

Member Function Documentation

◆ checkScale() [1/2]

void MaterialPropertyLib::EffectiveThermalConductivityPorosityMixing< 1 >::checkScale ( ) const
virtual

Reimplemented from MaterialPropertyLib::Property.

Definition at line 33 of file EffectiveThermalConductivityPorosityMixing.cpp.

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

References OGS_FATAL.

◆ checkScale() [2/2]

template<int GlobalDim>
void MaterialPropertyLib::EffectiveThermalConductivityPorosityMixing< GlobalDim >::checkScale ( ) const
overridevirtual

Reimplemented from MaterialPropertyLib::Property.

Definition at line 118 of file EffectiveThermalConductivityPorosityMixing.cpp.

119{
120 if (!std::holds_alternative<Medium*>(scale_))
121 {
122 OGS_FATAL(
123 "The property 'EffectiveThermalConductivityPorosityMixing' is "
124 "implemented on the 'medium' scale only.");
125 }
126}

References OGS_FATAL.

◆ dValue() [1/2]

PropertyDataType MaterialPropertyLib::EffectiveThermalConductivityPorosityMixing< 1 >::dValue ( VariableArray const & variable_array,
Variable const variable,
ParameterLib::SpatialPosition const & pos,
double const t,
double const dt ) const
virtual

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 96 of file EffectiveThermalConductivityPorosityMixing.cpp.

99{
100 OGS_FATAL(
101 "dValue is not implemented for "
102 "EffectiveThermalConductivityPorosityMixing");
103}

References OGS_FATAL.

◆ dValue() [2/2]

template<int GlobalDim>
PropertyDataType MaterialPropertyLib::EffectiveThermalConductivityPorosityMixing< GlobalDim >::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 193 of file EffectiveThermalConductivityPorosityMixing.cpp.

196{
197 OGS_FATAL(
198 "dValue is not implemented for "
199 "EffectiveThermalConductivityPorosityMixing");
200}

References OGS_FATAL.

◆ value() [1/2]

PropertyDataType MaterialPropertyLib::EffectiveThermalConductivityPorosityMixing< 1 >::value ( VariableArray const & variable_array,
ParameterLib::SpatialPosition const & pos,
double const t,
double const dt ) const
virtual

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 44 of file EffectiveThermalConductivityPorosityMixing.cpp.

48{
49 auto const& medium = std::get<Medium*>(scale_);
50
51 // Assuming there is either a gas phase or a liquid phase or both.
52 auto const gas_phase =
53 medium->hasPhase("Gas") ? &medium->phase("Gas") : nullptr;
54 auto const liquid_phase = medium->hasPhase("AqueousLiquid")
55 ? &medium->phase("AqueousLiquid")
56 : nullptr;
57 // Assuming there is always a solid phase.
58 auto const& solid_phase = medium->phase("Solid");
59
60 auto const gas_thermal_conductivity =
61 gas_phase
62 ? gas_phase
63 ->property(
65 .template value<double>(variable_array, pos, t, dt)
66 : 0.;
67
68 auto const liquid_thermal_conductivity =
69 liquid_phase
70 ? liquid_phase
71 ->property(
73 .template value<double>(variable_array, pos, t, dt)
74 : 0.;
75
76 auto const solid_thermal_conductivity =
77 solid_phase
79 .template value<double>(variable_array, pos, t, dt);
80
81 auto const porosity = variable_array.porosity;
82 auto const S_L = variable_array.liquid_saturation;
83 auto const S_G = 1. - S_L;
84
85 auto const phi_G = porosity * S_G;
86 auto const phi_L = porosity * S_L;
87 auto const phi_S = 1. - porosity;
88
89 double const effective_thermal_conductivity =
90 phi_G * gas_thermal_conductivity + phi_L * liquid_thermal_conductivity +
91 phi_S * solid_thermal_conductivity;
92
93 return effective_thermal_conductivity;
94}

References MaterialPropertyLib::VariableArray::liquid_saturation, MaterialPropertyLib::porosity, MaterialPropertyLib::VariableArray::porosity, and MaterialPropertyLib::thermal_conductivity.

◆ value() [2/2]

template<int GlobalDim>
PropertyDataType MaterialPropertyLib::EffectiveThermalConductivityPorosityMixing< GlobalDim >::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 129 of file EffectiveThermalConductivityPorosityMixing.cpp.

133{
134 auto const& medium = std::get<Medium*>(scale_);
135 // Assuming there is either a gas phase or a liquid phase or both.
136 auto const gas_phase =
137 medium->hasPhase("Gas") ? &medium->phase("Gas") : nullptr;
138 auto const liquid_phase = medium->hasPhase("AqueousLiquid")
139 ? &medium->phase("AqueousLiquid")
140 : nullptr;
141 // Assuming there is always a solid phase.
142 auto const& solid_phase = medium->phase("Solid");
143
144 auto const gas_thermal_conductivity =
145 gas_phase
146 ? gas_phase
147 ->property(
149 .template value<double>(variable_array, pos, t, dt)
150 : 0.;
151
152 auto const liquid_thermal_conductivity =
153 liquid_phase
154 ? liquid_phase
155 ->property(
157 .template value<double>(variable_array, pos, t, dt)
158 : 0.;
159
160 auto solid_thermal_conductivity = formEigenTensor<GlobalDim>(
161 solid_phase
163 .value(variable_array, pos, t, dt));
164
165 auto const porosity = variable_array.porosity;
166
167 auto const S_L = variable_array.liquid_saturation;
168 auto const S_G = 1. - S_L;
169
170 auto const phi_G = porosity * S_G;
171 auto const phi_L = porosity * S_L;
172 auto const phi_S = 1. - porosity;
173
174 // Local coordinate transformation is only applied for the case that the
175 // initial solid thermal conductivity is given with orthotropic assumption.
177 (solid_thermal_conductivity.cols() == GlobalDim))
178 {
179 solid_thermal_conductivity =
181 solid_thermal_conductivity, pos);
182 }
183 auto const I = Eigen::Matrix<double, GlobalDim, GlobalDim>::Identity();
184 Eigen::Matrix<double, GlobalDim, GlobalDim> const
185 effective_thermal_conductivity = (phi_G * gas_thermal_conductivity +
186 phi_L * liquid_thermal_conductivity) *
187 I +
188 phi_S * solid_thermal_conductivity;
189 return effective_thermal_conductivity;
190}
virtual PropertyDataType value() const
Definition Property.cpp:76
Eigen::Matrix< double, Dimension, Dimension > rotateTensor(std::vector< double > const &values, SpatialPosition const &pos) const

References MaterialPropertyLib::VariableArray::liquid_saturation, MaterialPropertyLib::porosity, MaterialPropertyLib::VariableArray::porosity, and MaterialPropertyLib::thermal_conductivity.

Member Data Documentation

◆ local_coordinate_system_

template<int GlobalDim>
ParameterLib::CoordinateSystem const* const MaterialPropertyLib::EffectiveThermalConductivityPorosityMixing< GlobalDim >::local_coordinate_system_
private

Definition at line 47 of file EffectiveThermalConductivityPorosityMixing.h.


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