OGS
MaterialPropertyLib::SaturationDependentSwelling Class Referencefinal

Detailed Description

Orthotropic, saturation dependent swelling model. This property must be a solid phase property, it computes the stress increment depending on the saturation. A local coordinate system can be given for orthotropy.

Definition at line 34 of file SaturationDependentSwelling.h.

#include <SaturationDependentSwelling.h>

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

Public Member Functions

 SaturationDependentSwelling (std::string name, std::array< double, 3 > swelling_pressures, std::array< double, 3 > exponents, double const lower_saturation_limit, double const upper_saturation_limit, ParameterLib::CoordinateSystem const *const local_coordinate_system)
 
void checkScale () 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, VariableArray const &variable_array_prev, 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, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const
 
virtual PropertyDataType dValue (VariableArray const &variable_array, 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. More...
 
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

std::array< double, 3 > const p_
 Maximum swelling pressures, one for each spatial dimension. More...
 
std::array< double, 3 > const lambda_
 Exponents, one for each spatial dimension. More...
 
double const S_min_
 
double const S_max_
 
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. More...
 
PropertyDataType dvalue_
 
std::variant< Medium *, Phase *, Component * > scale_
 

Constructor & Destructor Documentation

◆ SaturationDependentSwelling()

MaterialPropertyLib::SaturationDependentSwelling::SaturationDependentSwelling ( std::string  name,
std::array< double, 3 >  swelling_pressures,
std::array< double, 3 >  exponents,
double const  lower_saturation_limit,
double const  upper_saturation_limit,
ParameterLib::CoordinateSystem const *const  local_coordinate_system 
)

Definition at line 20 of file SaturationDependentSwelling.cpp.

29  : p_(std::move(swelling_pressures)),
30  lambda_(std::move(exponents)),
31  S_min_(lower_saturation_limit),
32  S_max_(upper_saturation_limit),
33  local_coordinate_system_(local_coordinate_system)
34 {
35  name_ = std::move(name);
36 }
std::array< double, 3 > const p_
Maximum swelling pressures, one for each spatial dimension.
ParameterLib::CoordinateSystem const *const local_coordinate_system_
std::array< double, 3 > const lambda_
Exponents, one for each spatial dimension.

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

Member Function Documentation

◆ checkScale()

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

Reimplemented from MaterialPropertyLib::Property.

Definition at line 38 of file SaturationDependentSwelling.cpp.

39 {
40  if (!std::holds_alternative<Phase*>(scale_))
41  {
42  OGS_FATAL(
43  "The property 'SaturationDependentSwelling' is implemented on the "
44  "'phase' scales only.");
45  }
46  auto const phase = std::get<Phase*>(scale_);
47  if (phase->name != "Solid")
48  {
49  OGS_FATAL(
50  "The property 'SaturationDependentSwelling' must be given in the "
51  "'Solid' phase, not in '{:s}' phase.",
52  phase->name);
53  }
54 }
#define OGS_FATAL(...)
Definition: Error.h:26
std::variant< Medium *, Phase *, Component * > scale_
Definition: Property.h:287

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

◆ dValue()

PropertyDataType MaterialPropertyLib::SaturationDependentSwelling::dValue ( VariableArray const &  variable_array,
VariableArray const &  variable_array_prev,
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 and the variables from the previous time step.

Reimplemented from MaterialPropertyLib::Property.

Definition at line 101 of file SaturationDependentSwelling.cpp.

106 {
107  if (primary_variable != Variable::liquid_saturation)
108  {
109  OGS_FATAL(
110  "SaturationDependentSwelling::dValue is implemented for "
111  "derivatives with respect to liquid saturation only.");
112  }
113 
114  auto const S_L = std::get<double>(
115  variable_array[static_cast<int>(Variable::liquid_saturation)]);
116  auto const S_L_prev = std::get<double>(
117  variable_array_prev[static_cast<int>(Variable::liquid_saturation)]);
118 
119  Eigen::Matrix<double, 3, 3> const e =
120  local_coordinate_system_ == nullptr
121  ? Eigen::Matrix<double, 3, 3>::Identity()
122  : local_coordinate_system_->transformation_3d(pos);
123 
124  Eigen::Matrix<double, 3, 3> delta_sigma_sw =
125  Eigen::Matrix<double, 3, 3>::Zero();
126 
127  if (S_L < S_min_)
128  {
129  return delta_sigma_sw; // still being zero.
130  }
131 
132  double const S_eff = std::clamp((S_L - S_min_) / (S_max_ - S_min_), 0., 1.);
133  double const S_eff_prev =
134  std::clamp((S_L_prev - S_min_) / (S_max_ - S_min_), 0., 1.);
135 
136  double const delta_S_eff = S_eff - S_eff_prev;
137 
138  // Heaviside(delta S_eff,sw)
139  if (std::abs(delta_S_eff) <= 0)
140  {
141  return delta_sigma_sw; // still being zero.
142  }
143 
144  for (int i = 0; i < 3; ++i)
145  {
146  Eigen::Matrix<double, 3, 3> const ei_otimes_ei =
147  e.col(i) * e.col(i).transpose();
148 
149  delta_sigma_sw +=
150  lambda_[i] * p_[i] * std::pow(S_eff, lambda_[i] - 1) * ei_otimes_ei;
151  }
152  return (delta_sigma_sw / (S_max_ - S_min_)).eval();
153 }

References lambda_, MaterialPropertyLib::liquid_saturation, local_coordinate_system_, OGS_FATAL, p_, S_max_, S_min_, and ParameterLib::CoordinateSystem::transformation_3d().

◆ value()

PropertyDataType MaterialPropertyLib::SaturationDependentSwelling::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 56 of file SaturationDependentSwelling.cpp.

61 {
62  auto const S_L = std::get<double>(
63  variable_array[static_cast<int>(Variable::liquid_saturation)]);
64  auto const S_L_prev = std::get<double>(
65  variable_array_prev[static_cast<int>(Variable::liquid_saturation)]);
66 
67  Eigen::Matrix<double, 3, 3> const e =
68  local_coordinate_system_ == nullptr
69  ? Eigen::Matrix<double, 3, 3>::Identity()
70  : local_coordinate_system_->transformation_3d(pos);
71 
72  Eigen::Matrix<double, 3, 3> delta_sigma_sw =
73  Eigen::Matrix<double, 3, 3>::Zero();
74 
75  if (S_L < S_min_)
76  {
77  return delta_sigma_sw; // still being zero.
78  }
79 
80  double const S_eff = std::clamp((S_L - S_min_) / (S_max_ - S_min_), 0., 1.);
81  double const S_eff_prev =
82  std::clamp((S_L_prev - S_min_) / (S_max_ - S_min_), 0., 1.);
83 
84  double const delta_S_eff = S_eff - S_eff_prev;
85 
86  // \Delta\sigma_{sw} = - \sum_i k_i (\lambda p S_{eff}^{(\lambda_i - 1)}
87  // e_i \otimes e_i \Delta S_L / (S_{max} - S_{min}), where
88  // e_i \otimes e_i is a square matrix with e_i,0^2 e_i,0*e_i,1 etc.
89  for (int i = 0; i < 3; ++i)
90  {
91  Eigen::Matrix<double, 3, 3> const ei_otimes_ei =
92  e.col(i) * e.col(i).transpose();
93 
94  delta_sigma_sw -=
95  lambda_[i] * p_[i] * std::pow(S_eff, lambda_[i] - 1) * ei_otimes_ei;
96  }
97 
98  return (delta_sigma_sw * delta_S_eff / dt).eval();
99 }

References lambda_, MaterialPropertyLib::liquid_saturation, local_coordinate_system_, p_, S_max_, S_min_, and ParameterLib::CoordinateSystem::transformation_3d().

Member Data Documentation

◆ lambda_

std::array<double, 3> const MaterialPropertyLib::SaturationDependentSwelling::lambda_
private

Exponents, one for each spatial dimension.

Definition at line 40 of file SaturationDependentSwelling.h.

Referenced by dValue(), and value().

◆ local_coordinate_system_

ParameterLib::CoordinateSystem const* const MaterialPropertyLib::SaturationDependentSwelling::local_coordinate_system_
private

Definition at line 43 of file SaturationDependentSwelling.h.

Referenced by dValue(), and value().

◆ p_

std::array<double, 3> const MaterialPropertyLib::SaturationDependentSwelling::p_
private

Maximum swelling pressures, one for each spatial dimension.

Definition at line 38 of file SaturationDependentSwelling.h.

Referenced by dValue(), and value().

◆ S_max_

double const MaterialPropertyLib::SaturationDependentSwelling::S_max_
private

Definition at line 42 of file SaturationDependentSwelling.h.

Referenced by dValue(), and value().

◆ S_min_

double const MaterialPropertyLib::SaturationDependentSwelling::S_min_
private

Definition at line 41 of file SaturationDependentSwelling.h.

Referenced by dValue(), and value().


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