OGS
MaterialPropertyLib::SaturationWeightedThermalConductivity< MeantType, GlobalDimension > Class Template Referencefinal

Detailed Description

template<MeanType MeantType, int GlobalDimension>
class MaterialPropertyLib::SaturationWeightedThermalConductivity< MeantType, GlobalDimension >

Saturation dependent thermal conductivity model for soil.

The arithmetic_squareroot model is proposed by Somerton, W.~H. et al. [36], which takes the form of

\[ \lambda = \lambda_{\text{dry}} + \sqrt{S}(\lambda_{\text{wet}}- \lambda_{\text{dry}}), \]

. The arithmetic_linear model is linear in the saturation and has the form

\[ \lambda = \lambda_{\text{dry}} + S(\lambda_{\text{wet}}-\lambda_{\text{dry}}), \]

The geometric model uses the weighted geometric mean

\[ \lambda = \lambda_{\text{dry}}^{1-S} * \lambda_{\text{wet}}^S, \]

where \(\lambda_{\text{dry}}\) is the thermal conductivity of soil at the dry state, \(\lambda_{\text{wet}}\) is the thermal conductivity of soil at the fully water saturated state, and \(S\) is the water saturation.

Definition at line 54 of file SaturationWeightedThermalConductivity.h.

#include <SaturationWeightedThermalConductivity.h>

Inheritance diagram for MaterialPropertyLib::SaturationWeightedThermalConductivity< MeantType, GlobalDimension >:
[legend]
Collaboration diagram for MaterialPropertyLib::SaturationWeightedThermalConductivity< MeantType, GlobalDimension >:
[legend]

Public Member Functions

 SaturationWeightedThermalConductivity (std::string name, ParameterLib::Parameter< double > const &dry_thermal_conductivity, ParameterLib::Parameter< double > const &wet_thermal_conductivity)
 
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
 
- 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::Parameter< double > const & dry_thermal_conductivity_
 Thermal conductivity of soil at the dry state.
 
ParameterLib::Parameter< double > const & wet_thermal_conductivity_
 Thermal conductivity of soil at the fully water saturated state.
 

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

◆ SaturationWeightedThermalConductivity()

template<MeanType MeanType, int GlobalDimension>
MaterialPropertyLib::SaturationWeightedThermalConductivity< MeanType, GlobalDimension >::SaturationWeightedThermalConductivity ( std::string name,
ParameterLib::Parameter< double > const & dry_thermal_conductivity,
ParameterLib::Parameter< double > const & wet_thermal_conductivity )

Definition at line 84 of file SaturationWeightedThermalConductivity.cpp.

89 : dry_thermal_conductivity_(dry_thermal_conductivity),
90 wet_thermal_conductivity_(wet_thermal_conductivity)
91{
92 name_ = std::move(name);
93
95 double const t = std::numeric_limits<double>::quiet_NaN();
96
97 auto const lambda_dry = dry_thermal_conductivity_(t, pos);
98 auto const lambda_wet = wet_thermal_conductivity_(t, pos);
99
100 if (lambda_dry.size() != lambda_wet.size())
101 {
102 OGS_FATAL(
103 "In 'SaturationWeightedThermalConductivity' input data, the data "
104 "size of "
105 "dry_thermal_conductivity of '{:d}' is different from that of "
106 "dry_thermal_conductivity of '{:d}'.",
107 lambda_dry.size(), lambda_wet.size());
108 }
109
110 for (std::size_t i = 0; i < lambda_dry.size(); i++)
111 {
112 if (lambda_dry[i] > lambda_wet[i])
113 {
114 OGS_FATAL(
115 "In 'SaturationWeightedThermalConductivity', "
116 "dry_thermal_conductivity of '{:g}' is larger than "
117 "wet_thermal_conductivity of '{:g}'.",
118 lambda_dry[i], lambda_wet[i]);
119 }
120 }
121 if constexpr (MeanType == MeanType::GEOMETRIC)
122 {
123 if (lambda_dry.size() != 1 && lambda_dry.size() != GlobalDimension)
124 {
125 OGS_FATAL(
126 "The saturation weighted geometric mean"
127 "is not implemented for arbitrary anisotropic thermal "
128 "conductivities and requires to be in diagonal shape.");
129 }
130 }
131}
#define OGS_FATAL(...)
Definition Error.h:26
ParameterLib::Parameter< double > const & wet_thermal_conductivity_
Thermal conductivity of soil at the fully water saturated state.
ParameterLib::Parameter< double > const & dry_thermal_conductivity_
Thermal conductivity of soil at the dry state.

References MaterialPropertyLib::SaturationWeightedThermalConductivity< MeantType, GlobalDimension >::dry_thermal_conductivity_, MaterialPropertyLib::GEOMETRIC, MaterialPropertyLib::name, MaterialPropertyLib::Property::name_, OGS_FATAL, and MaterialPropertyLib::SaturationWeightedThermalConductivity< MeantType, GlobalDimension >::wet_thermal_conductivity_.

Member Function Documentation

◆ checkScale()

template<MeanType MeantType, int GlobalDimension>
void MaterialPropertyLib::SaturationWeightedThermalConductivity< MeantType, GlobalDimension >::checkScale ( ) const
inlineoverridevirtual

Reimplemented from MaterialPropertyLib::Property.

Definition at line 62 of file SaturationWeightedThermalConductivity.h.

63 {
64 if (!std::holds_alternative<Medium*>(scale_))
65 {
67 "The property 'SaturationWeightedThermalConductivity' is "
68 "implemented on the 'media' scale only.");
69 }
70 }
std::variant< Medium *, Phase *, Component * > scale_
Definition Property.h:297

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

◆ dValue()

template<MeanType MeanType, int GlobalDimension>
PropertyDataType MaterialPropertyLib::SaturationWeightedThermalConductivity< MeanType, GlobalDimension >::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 164 of file SaturationWeightedThermalConductivity.cpp.

168{
169 if (variable != Variable::liquid_saturation)
170 {
171 OGS_FATAL(
172 "SaturationWeightedThermalConductivity::dValue is implemented for "
173 "derivatives with respect to liquid saturation only.");
174 }
175
176 double const S_L = variable_array.liquid_saturation;
177
178 auto const lambda_dry_data = dry_thermal_conductivity_(t, pos);
179
180 std::vector<double> derivative_data(lambda_dry_data.size(), 0.0);
181 if (S_L <= 0.0 || S_L > 1.0)
182 {
183 return fromVector(derivative_data);
184 }
185 for (std::size_t i = 0; i < lambda_dry_data.size(); i++)
186 {
187 derivative_data[i] = computeDAverage<MeanType>(
188 S_L, lambda_dry_data[i], wet_thermal_conductivity_(t, pos)[i]);
189 }
190 return fromVector(derivative_data);
191}
PropertyDataType fromVector(std::vector< double > const &values)
Definition Property.cpp:23
double computeDAverage(const double, double const, double const)=delete

References MaterialPropertyLib::computeDAverage(), MaterialPropertyLib::fromVector(), MaterialPropertyLib::liquid_saturation, MaterialPropertyLib::VariableArray::liquid_saturation, and OGS_FATAL.

◆ value()

template<MeanType MeanType, int GlobalDimension>
PropertyDataType MaterialPropertyLib::SaturationWeightedThermalConductivity< MeanType, GlobalDimension >::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 135 of file SaturationWeightedThermalConductivity.cpp.

139{
140 double const S_L = variable_array.liquid_saturation;
141
142 // (S_L <= 0.0)
143 std::vector<double> lambda_data = dry_thermal_conductivity_(t, pos);
144
145 if (S_L >= 1.0)
146 {
147 lambda_data = wet_thermal_conductivity_(t, pos);
148 }
149
150 else if (S_L > 0.0 && S_L <= 1.0)
151 {
152 for (std::size_t i = 0; i < lambda_data.size(); i++)
153 {
154 lambda_data[i] = computeAverage<MeanType>(
155 S_L, lambda_data[i], wet_thermal_conductivity_(t, pos)[i]);
156 }
157 }
158
159 return fromVector(lambda_data);
160}
double computeAverage(const double, double const, double const)=delete

References MaterialPropertyLib::computeAverage(), MaterialPropertyLib::fromVector(), and MaterialPropertyLib::VariableArray::liquid_saturation.

Member Data Documentation

◆ dry_thermal_conductivity_

template<MeanType MeantType, int GlobalDimension>
ParameterLib::Parameter<double> const& MaterialPropertyLib::SaturationWeightedThermalConductivity< MeantType, GlobalDimension >::dry_thermal_conductivity_
private

◆ wet_thermal_conductivity_

template<MeanType MeantType, int GlobalDimension>
ParameterLib::Parameter<double> const& MaterialPropertyLib::SaturationWeightedThermalConductivity< MeantType, GlobalDimension >::wet_thermal_conductivity_
private

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