OGS 6.2.2-330-gf48c72f61.dirty.20200225212913
MaterialPropertyLib Namespace Reference

Classes

class  Component
 This class defines components (substances). More...
 
class  Constant
 
class  DupuitPermeability
 
struct  ExponentData
 
class  ExponentialProperty
 
struct  FormEigenTensor
 
class  IdealGasLaw
 Density function for ideal gases. More...
 
struct  IndependentVariable
 
class  LinearProperty
 
class  MaterialSpatialDistributionMap
 
class  Medium
 
class  ParameterProperty
 
class  PermeabilityOrthotropicPowerLaw
 
class  Phase
 
class  PorosityFromMassBalance
 
class  Property
 
class  RelPermBrooksCorey
 Relative permeability function proposed by Brooks&Corey. More...
 
class  RelPermLiakopoulos
 Relative permeability function for Liakopoulos Benchmark. More...
 
class  RelPermVanGenuchten
 
class  SaturationBrooksCorey
 A well known soil characteristics function. More...
 
class  SaturationLiakopoulos
 A well known soil characteristics function. More...
 
class  SaturationVanGenuchten
 
struct  Water
 

Typedefs

using PropertyArray = std::array< std::unique_ptr< Property >, PropertyType::number_of_properties >
 
using PropertyDataType = std::variant< double, Eigen::Matrix< double, 2, 1 >, Eigen::Matrix< double, 3, 1 >, Eigen::Matrix< double, 2, 2 >, Eigen::Matrix< double, 3, 3 >, Eigen::Matrix< double, 4, 1 >, Eigen::Matrix< double, 6, 1 > >
 
using Pair = std::array< double, 2 >
 
using Vector = std::array< double, 3 >
 
using SymmTensor = std::array< double, 6 >
 
using Tensor2d = std::array< double, 4 >
 Very simple 2d tensor data type for holding tensor components. More...
 
using Tensor = std::array< double, 9 >
 
using VariableType = std::variant< double, Vector, Eigen::Matrix< double, 4, 1 >, Eigen::Matrix< double, 6, 1 > >
 
using VariableArray = std::array< VariableType, static_cast< int >(Variable::number_of_variables)>
 

Enumerations

enum  PropertyType : int {
  acentric_factor, binary_interaction_coefficient, biot_coefficient, brooks_corey_exponent,
  bulk_modulus, critical_density, critical_pressure, critical_temperature,
  compressibility, decay_rate, density, drhodT,
  effective_stress, entry_pressure, fredlund_parameters, heat_capacity,
  longitudinal_dispersivity, molar_mass, mole_fraction, molecular_diffusion,
  name, permeability, phase_velocity, porosity,
  reference_density, reference_temperature, reference_pressure, relative_permeability,
  residual_gas_saturation, residual_liquid_saturation, retardation_factor, saturation,
  specific_heat_capacity, storage, thermal_conductivity, thermal_expansivity,
  thermal_longitudinal_dispersivity, thermal_transversal_dispersivity, transversal_dispersivity, viscosity,
  number_of_properties
}
 
enum  Variable : int {
  Variable::concentration, Variable::phase_pressure, Variable::phase_pressure_rate, Variable::capillary_pressure,
  Variable::density, Variable::temperature, Variable::liquid_saturation, Variable::porosity,
  Variable::displacement, Variable::strain, Variable::volumetric_strain_rate, Variable::number_of_variables
}
 

Functions

std::unique_ptr< ComponentnewComponent (std::string const &component_name, bool &isCustomComponent)
 
template<typename Container >
void checkRequiredProperties (Component const &c, Container const &required_properties)
 
double getThermalExpansivity (Phase const &phase, VariableArray const &vars, const double density, ParameterLib::SpatialPosition const &pos, double const t, double const dt)
 
std::vector< std::unique_ptr< Component > > createComponents (boost::optional< BaseLib::ConfigTree > const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters, ParameterLib::CoordinateSystem const *const local_coordinate_system)
 
std::unique_ptr< MaterialSpatialDistributionMapcreateMaterialSpatialDistributionMap (std::map< int, std::shared_ptr< Medium >> const &media, MeshLib::Mesh const &mesh)
 
std::unique_ptr< MediumcreateMedium (BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters, ParameterLib::CoordinateSystem const *const local_coordinate_system)
 
std::vector< std::unique_ptr< Phase > > createPhases (boost::optional< BaseLib::ConfigTree > const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters, ParameterLib::CoordinateSystem const *const local_coordinate_system)
 
std::unique_ptr< PropertyArraycreateProperties (boost::optional< BaseLib::ConfigTree > const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters, ParameterLib::CoordinateSystem const *const local_coordinate_system)
 
template<typename Container >
void checkRequiredProperties (Medium const &medium, Container const &required_properties)
 
template<typename Container >
void checkRequiredProperties (Phase const &phase, Container const &required_properties)
 
std::unique_ptr< ConstantcreateConstant (BaseLib::ConfigTree const &config)
 
std::unique_ptr< DupuitPermeabilitycreateDupuitPermeability (BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters)
 
std::unique_ptr< ExponentialPropertycreateExponentialProperty (BaseLib::ConfigTree const &config)
 
std::unique_ptr< IdealGasLawcreateIdealGasLaw (BaseLib::ConfigTree const &config)
 
std::unique_ptr< LinearPropertycreateLinearProperty (BaseLib::ConfigTree const &config)
 
std::unique_ptr< ParameterPropertycreateParameterProperty (BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters)
 
std::unique_ptr< PropertycreatePermeabilityOrthotropicPowerLaw (BaseLib::ConfigTree const &config, ParameterLib::CoordinateSystem const *const local_coordinate_system)
 
std::unique_ptr< PorosityFromMassBalancecreatePorosityFromMassBalance (BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters)
 
std::unique_ptr< RelPermBrooksCoreycreateRelPermBrooksCorey (BaseLib::ConfigTree const &config)
 
std::unique_ptr< RelPermLiakopouloscreateRelPermLiakopoulos (BaseLib::ConfigTree const &config)
 
std::unique_ptr< RelPermVanGenuchtencreateRelPermVanGenuchten (BaseLib::ConfigTree const &config)
 
std::unique_ptr< SaturationBrooksCoreycreateSaturationBrooksCorey (BaseLib::ConfigTree const &config)
 
std::unique_ptr< SaturationLiakopouloscreateSaturationLiakopoulos (BaseLib::ConfigTree const &config)
 
std::unique_ptr< SaturationVanGenuchtencreateSaturationVanGenuchten (BaseLib::ConfigTree const &config)
 
double molarMass (Phase *_phase, Component *_component, VariableArray const &variable_array, ParameterLib::SpatialPosition const &pos, double const t, double const dt)
 
PropertyDataType fromVector (std::vector< double > const &values)
 
void overwriteExistingProperties (PropertyArray &properties, PropertyArray &new_properties, std::variant< Medium *, Phase *, Component *> scale_pointer)
 
PropertyType convertStringToProperty (std::string const &inString)
 
template<int GlobalDim>
Eigen::Matrix< double, GlobalDim, GlobalDim > formEffectiveThermalConductivity (MaterialPropertyLib::PropertyDataType const &solid_thermal_conductivity, const double fluid_thermal_conductivity, const double porosity)
 
template Eigen::Matrix< double, 1, 1 > formEffectiveThermalConductivity< 1 > (MaterialPropertyLib::PropertyDataType const &solid_thermal_conductivity, const double fluid_thermal_conductivity, const double porosity)
 
template Eigen::Matrix< double, 2, 2 > formEffectiveThermalConductivity< 2 > (MaterialPropertyLib::PropertyDataType const &solid_thermal_conductivity, const double fluid_thermal_conductivity, const double porosity)
 
template Eigen::Matrix< double, 3, 3 > formEffectiveThermalConductivity< 3 > (MaterialPropertyLib::PropertyDataType const &solid_thermal_conductivity, const double fluid_thermal_conductivity, const double porosity)
 
template<int GlobalDim>
Eigen::Matrix< double, GlobalDim, GlobalDim > formEigenTensor (MaterialPropertyLib::PropertyDataType const &values)
 
template Eigen::Matrix< double, 1, 1 > formEigenTensor< 1 > (MaterialPropertyLib::PropertyDataType const &values)
 
template Eigen::Matrix< double, 2, 2 > formEigenTensor< 2 > (MaterialPropertyLib::PropertyDataType const &values)
 
template Eigen::Matrix< double, 3, 3 > formEigenTensor< 3 > (MaterialPropertyLib::PropertyDataType const &values)
 
Variable convertStringToVariable (std::string const &input)
 

Variables

static const std::array< std::string, PropertyType::number_of_properties > property_enum_to_string
 

Typedef Documentation

◆ Pair

using MaterialPropertyLib::Pair = typedef std::array<double, 2>

Very simple vector data type for holding a pair of values.

Definition at line 23 of file VariableType.h.

◆ PropertyArray

typedef std::array< std::unique_ptr< Property >, PropertyType::number_of_properties > MaterialPropertyLib::PropertyArray

This data type is based on a std::array. It can hold pointers to objects of class Property or its inheritors. The size of this array is determined by the number of entries of the PropertyType enumerator.

Definition at line 36 of file CreateProperty.h.

◆ PropertyDataType

using MaterialPropertyLib::PropertyDataType = typedef std::variant<double, Eigen::Matrix<double, 2, 1>, Eigen::Matrix<double, 3, 1>, Eigen::Matrix<double, 2, 2>, Eigen::Matrix<double, 3, 3>, Eigen::Matrix<double, 4, 1>, Eigen::Matrix<double, 6, 1> >

Definition at line 33 of file Property.h.

◆ SymmTensor

using MaterialPropertyLib::SymmTensor = typedef std::array<double, 6>

Simple symmetric tensor data type for holding xx, yy, zz, xy, xz, yz tensor components.

Definition at line 31 of file VariableType.h.

◆ Tensor

using MaterialPropertyLib::Tensor = typedef std::array<double, 9>

Very simple tensor data type for holding tensor components.

Definition at line 38 of file VariableType.h.

◆ Tensor2d

using MaterialPropertyLib::Tensor2d = typedef std::array<double, 4>

Very simple 2d tensor data type for holding tensor components.

Definition at line 34 of file VariableType.h.

◆ VariableArray

using MaterialPropertyLib::VariableArray = typedef std::array<VariableType, static_cast<int>(Variable::number_of_variables)>

The VariableArray is a std::array of fixed size. Its size is determined by the Variable enumerator list. Data type of that array is defined by the VariableType definition.

Definition at line 68 of file VariableType.h.

◆ VariableType

using MaterialPropertyLib::VariableType = typedef std::variant<double, Vector, Eigen::Matrix<double, 4, 1>, Eigen::Matrix<double, 6, 1> >

Data type for primary variables, designed to contain both scalar and vector data.

Definition at line 62 of file VariableType.h.

◆ Vector

using MaterialPropertyLib::Vector = typedef std::array<double, 3>

Very simple vector data type for holding vector components.

Definition at line 27 of file VariableType.h.

Enumeration Type Documentation

◆ PropertyType

PropertyType is an enumerator list of all known properties of a substance. This includes all properties on all scales (i.e. component, phase, and medium scales). It is used as an index for the PropertyArray of the materials. If a necessary property is not in the list, simply add a new one in alphabetical order (of course, except for the last entry). Please note that any of these entries must also appear in below convert functions.

Enumerator
acentric_factor 
binary_interaction_coefficient 
biot_coefficient 
brooks_corey_exponent 
bulk_modulus 
critical_density 
critical_pressure 
critical_temperature 
compressibility 
decay_rate 

used to specify decay rate of a substance.

density 
drhodT 
effective_stress 
entry_pressure 
fredlund_parameters 
heat_capacity 
longitudinal_dispersivity 

used to compute the hydrodynamic dispersion tensor.

molar_mass 
mole_fraction 
molecular_diffusion 

used to compute the hydrodynamic dispersion tensor.

name 
permeability 
phase_velocity 
porosity 
reference_density 
reference_temperature 
reference_pressure 
relative_permeability 
residual_gas_saturation 
residual_liquid_saturation 
retardation_factor 

specify retardation factor used in component transport process.

saturation 
specific_heat_capacity 
storage 
thermal_conductivity 
thermal_expansivity 
thermal_longitudinal_dispersivity 
thermal_transversal_dispersivity 
transversal_dispersivity 

used to compute the hydrodynamic dispersion tensor.

viscosity 
number_of_properties 

Definition at line 34 of file PropertyType.h.

34  : int
35 {
46  decay_rate,
47  density,
48  drhodT,
55  molar_mass,
59  name,
62  porosity,
71  saturation,
73  storage,
80  viscosity,
82 };
used to specify decay rate of a substance.
Definition: PropertyType.h:46
used to compute the hydrodynamic dispersion tensor.
Definition: PropertyType.h:58
specify retardation factor used in component transport process.
Definition: PropertyType.h:70
used to compute the hydrodynamic dispersion tensor.
Definition: PropertyType.h:54
used to compute the hydrodynamic dispersion tensor.
Definition: PropertyType.h:79

◆ Variable

enum MaterialPropertyLib::Variable : int
strong

Enum Variable is simply a list of all commonly used variables that are used to determine the size of the VariableArray. If the variable of your choice is missing, simply add it somewhere at the list, but above the last entry.

Enumerator
concentration 
phase_pressure 
phase_pressure_rate 
capillary_pressure 
density 
temperature 
liquid_saturation 
porosity 
displacement 
strain 
volumetric_strain_rate 
number_of_variables 

Definition at line 43 of file VariableType.h.

Function Documentation

◆ checkRequiredProperties() [1/3]

template<typename Container >
void MaterialPropertyLib::checkRequiredProperties ( Phase const &  phase,
Container const &  required_properties 
)

Definition at line 69 of file Phase.h.

References MaterialPropertyLib::Phase::hasProperty(), MaterialPropertyLib::Phase::name, OGS_FATAL, and property_enum_to_string.

70 {
71  for (auto const& p : required_properties)
72  {
73  if (!phase.hasProperty(p))
74  {
75  OGS_FATAL("The property '%s' is missing in the %s phase.",
76  property_enum_to_string[p].c_str(), phase.name.c_str());
77  }
78  }
79 }
static const std::array< std::string, PropertyType::number_of_properties > property_enum_to_string
Definition: PropertyType.h:261
static const double p
#define OGS_FATAL(fmt,...)
Definition: Error.h:64

◆ checkRequiredProperties() [2/3]

template<typename Container >
void MaterialPropertyLib::checkRequiredProperties ( Component const &  c,
Container const &  required_properties 
)

Definition at line 89 of file Component.h.

References MaterialPropertyLib::Component::hasProperty(), MaterialPropertyLib::Component::name, OGS_FATAL, and property_enum_to_string.

Referenced by ProcessLib::ComponentTransport::checkMPLProperties(), ProcessLib::HT::checkMPLProperties(), ProcessLib::LiquidFlow::checkMPLProperties(), ProcessLib::HydroMechanics::createHydroMechanicsProcess(), and ProcessLib::RichardsMechanics::createRichardsMechanicsProcess().

91 {
92  for (auto const& p : required_properties)
93  {
94  if (!c.hasProperty(p))
95  {
96  OGS_FATAL("The property '%s' is missing in the component '%s'.",
97  property_enum_to_string[p].c_str(), c.name.c_str());
98  }
99  }
100 }
static const std::array< std::string, PropertyType::number_of_properties > property_enum_to_string
Definition: PropertyType.h:261
static const double p
#define OGS_FATAL(fmt,...)
Definition: Error.h:64

◆ checkRequiredProperties() [3/3]

template<typename Container >
void MaterialPropertyLib::checkRequiredProperties ( Medium const &  medium,
Container const &  required_properties 
)

Definition at line 93 of file Medium.h.

References MaterialPropertyLib::Medium::hasProperty(), OGS_FATAL, and property_enum_to_string.

95 {
96  for (auto const& p : required_properties)
97  {
98  if (!medium.hasProperty(p))
99  {
100  OGS_FATAL("The property '%s' is missing in the medium definition.",
101  property_enum_to_string[p].c_str());
102  }
103  }
104 }
static const std::array< std::string, PropertyType::number_of_properties > property_enum_to_string
Definition: PropertyType.h:261
static const double p
#define OGS_FATAL(fmt,...)
Definition: Error.h:64

◆ convertStringToProperty()

PropertyType MaterialPropertyLib::convertStringToProperty ( std::string const &  inString)
inline

This function converts a string (e.g. a string from the configuration-tree) into one of the entries of the PropertyType enumerator. To avoid confusion, I suggest that the syntax of the properties in the input-files (i.e. the strings) have to be identical to the syntax of the entries in the enumerator.

Definition at line 89 of file PropertyType.h.

References acentric_factor, binary_interaction_coefficient, biot_coefficient, brooks_corey_exponent, bulk_modulus, compressibility, critical_density, critical_pressure, critical_temperature, decay_rate, density, drhodT, effective_stress, entry_pressure, fredlund_parameters, heat_capacity, longitudinal_dispersivity, molar_mass, mole_fraction, molecular_diffusion, name, number_of_properties, OGS_FATAL, permeability, phase_velocity, porosity, reference_density, reference_pressure, reference_temperature, relative_permeability, residual_gas_saturation, residual_liquid_saturation, retardation_factor, saturation, specific_heat_capacity, storage, thermal_conductivity, thermal_expansivity, thermal_longitudinal_dispersivity, thermal_transversal_dispersivity, transversal_dispersivity, and viscosity.

Referenced by createProperties().

90 {
91  if (boost::iequals(inString, "acentric_factor"))
92  {
94  }
95  if (boost::iequals(inString, "binary_interaction_coefficient"))
96  {
98  }
99  if (boost::iequals(inString, "biot_coefficient"))
100  {
102  }
103  if (boost::iequals(inString, "brooks_corey_exponent"))
104  {
106  }
107  if (boost::iequals(inString, "bulk_modulus"))
108  {
110  }
111  if (boost::iequals(inString, "critical_density"))
112  {
114  }
115  if (boost::iequals(inString, "critical_pressure"))
116  {
118  }
119  if (boost::iequals(inString, "critical_temperature"))
120  {
122  }
123  if (boost::iequals(inString, "compressibility"))
124  {
126  }
127  if (boost::iequals(inString, "decay_rate"))
128  {
130  }
131  if (boost::iequals(inString, "density"))
132  {
133  return PropertyType::density;
134  }
135  if (boost::iequals(inString, "drhodT"))
136  {
137  return PropertyType::drhodT;
138  }
139  if (boost::iequals(inString, "effective_stress"))
140  {
142  }
143  if (boost::iequals(inString, "entry_pressure"))
144  {
146  }
147  if (boost::iequals(inString, "fredlund_parameters"))
148  {
150  }
151  if (boost::iequals(inString, "heat_capacity"))
152  {
154  }
155  if (boost::iequals(inString, "longitudinal_dispersivity"))
156  {
158  }
159  if (boost::iequals(inString, "molar_mass"))
160  {
162  }
163  if (boost::iequals(inString, "mole_fraction"))
164  {
166  }
167  if (boost::iequals(inString, "molecular_diffusion"))
168  {
170  }
171  if (boost::iequals(inString, "name"))
172  {
173  return PropertyType::name;
174  }
175  if (boost::iequals(inString, "permeability"))
176  {
178  }
179  if (boost::iequals(inString, "porosity"))
180  {
181  return PropertyType::porosity;
182  }
183  if (boost::iequals(inString, "phase_velocity"))
184  {
186  }
187  if (boost::iequals(inString, "reference_density"))
188  {
190  }
191  if (boost::iequals(inString, "reference_temperature"))
192  {
194  }
195  if (boost::iequals(inString, "reference_pressure"))
196  {
198  }
199  if (boost::iequals(inString, "relative_permeability"))
200  {
202  }
203  if (boost::iequals(inString, "residual_gas_saturation"))
204  {
206  }
207  if (boost::iequals(inString, "residual_liquid_saturation"))
208  {
210  }
211  if (boost::iequals(inString, "retardation_factor"))
212  {
214  }
215  if (boost::iequals(inString, "saturation"))
216  {
218  }
219  if (boost::iequals(inString, "specific_heat_capacity"))
220  {
222  }
223  if (boost::iequals(inString, "storage"))
224  {
225  return PropertyType::storage;
226  }
227  if (boost::iequals(inString, "thermal_conductivity"))
228  {
230  }
231  if (boost::iequals(inString, "thermal_expansivity"))
232  {
234  }
235  if (boost::iequals(inString, "thermal_longitudinal_dispersivity"))
236  {
238  }
239  if (boost::iequals(inString, "thermal_transversal_dispersivity"))
240  {
242  }
243  if (boost::iequals(inString, "transversal_dispersivity"))
244  {
246  }
247  if (boost::iequals(inString, "viscosity"))
248  {
250  }
251 
252  OGS_FATAL(
253  "The property name '%s' does not correspond to any known property",
254  inString.c_str());
255 
256  return PropertyType::number_of_properties; // to avoid the 'no return'
257  // warning
258 }
used to specify decay rate of a substance.
Definition: PropertyType.h:46
used to compute the hydrodynamic dispersion tensor.
Definition: PropertyType.h:58
specify retardation factor used in component transport process.
Definition: PropertyType.h:70
used to compute the hydrodynamic dispersion tensor.
Definition: PropertyType.h:54
used to compute the hydrodynamic dispersion tensor.
Definition: PropertyType.h:79
#define OGS_FATAL(fmt,...)
Definition: Error.h:64

◆ convertStringToVariable()

Variable MaterialPropertyLib::convertStringToVariable ( std::string const &  input)

Definition at line 17 of file VariableType.cpp.

References capillary_pressure, concentration, density, displacement, liquid_saturation, number_of_variables, OGS_FATAL, phase_pressure, and temperature.

Referenced by createExponentialProperty(), and createLinearProperty().

18 {
19  if (boost::iequals(input, "concentration"))
20  {
21  return Variable::concentration;
22  }
23  if (boost::iequals(input, "phase_pressure"))
24  {
25  return Variable::phase_pressure;
26  }
27  if (boost::iequals(input, "capillary_pressure"))
28  {
29  return Variable::capillary_pressure;
30  }
31  if (boost::iequals(input, "density"))
32  {
33  return Variable::density;
34  }
35  if (boost::iequals(input, "temperature"))
36  {
37  return Variable::temperature;
38  }
39  if (boost::iequals(input, "liquid_saturation"))
40  {
41  return Variable::liquid_saturation;
42  }
43  if (boost::iequals(input, "displacement"))
44  {
45  return Variable::displacement;
46  }
47 
48  OGS_FATAL(
49  "The variable name '%s' does not correspond to any known variable",
50  input.c_str());
51 
52  return Variable::number_of_variables; // to avoid the 'no return' warning
53 }
#define OGS_FATAL(fmt,...)
Definition: Error.h:64

◆ createComponents()

std::vector< std::unique_ptr< Component > > MaterialPropertyLib::createComponents ( boost::optional< BaseLib::ConfigTree > const &  config,
std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &  parameters,
ParameterLib::CoordinateSystem const *const  local_coordinate_system 
)

The method creates components based on config subtree.

Just like a phase, a component can have a name. But, in this case, the name has an important task. If a name is given, a specific component class referring to that name with corresponding physical material properties is created. Assigning a name is optional; If no name is given, a custom component without predefined properties is created.

Input File Parameter:
prj__media__medium__phases__phase__components__component

Definition at line 69 of file CreateComponent.cpp.

References anonymous_namespace{Density100MPa.cpp}::c, anonymous_namespace{CreateComponent.cpp}::createComponent(), and OGS_FATAL.

Referenced by anonymous_namespace{CreatePhase.cpp}::createPhase().

73 {
74  if (!config)
75  {
76  return {};
77  }
78 
79  std::vector<std::unique_ptr<Component>> components;
80  for (
81  auto const& component_config :
83  config->getConfigSubtreeList("component"))
84  {
85  auto component = createComponent(component_config, parameters,
86  local_coordinate_system);
87 
88  if (std::find_if(components.begin(),
89  components.end(),
90  [component_name = component->name](auto const& c) {
91  return c->name == component_name;
92  }) != components.end())
93  {
94  OGS_FATAL("Found duplicates with the same component name tag '%s'.",
95  component->name.c_str());
96  }
97 
98  components.push_back(std::move(component));
99  }
100 
101  return components;
102 }
std::unique_ptr< MaterialPropertyLib::Component > createComponent(BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters, ParameterLib::CoordinateSystem const *const local_coordinate_system)
#define OGS_FATAL(fmt,...)
Definition: Error.h:64

◆ createConstant()

std::unique_ptr< Constant > MaterialPropertyLib::createConstant ( BaseLib::ConfigTree const &  config)
Input File Parameter:
properties__property__type
Input File Parameter:
properties__property__Constant__value

Definition at line 18 of file CreateConstant.cpp.

References BaseLib::ConfigTree::checkConfigParameter(), fromVector(), and BaseLib::ConfigTree::getConfigParameter().

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

19 {
21  config.checkConfigParameter("type", "Constant");
22  DBUG("Create Constant property");
23  std::vector<double> const values =
25  config.getConfigParameter<std::vector<double>>("value");
26 
27  return std::make_unique<Constant>(fromVector(values));
28 }
PropertyDataType fromVector(std::vector< double > const &values)
Definition: Property.cpp:19

◆ createDupuitPermeability()

std::unique_ptr< DupuitPermeability > MaterialPropertyLib::createDupuitPermeability ( BaseLib::ConfigTree const &  config,
std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &  parameters 
)
Input File Parameter:
properties__property__type
Input File Parameter:
properties__property__DupuitPermeability__parameter_name

Definition at line 19 of file CreateDupuitPermeability.cpp.

References BaseLib::ConfigTree::checkConfigParameter(), and BaseLib::ConfigTree::getConfigParameter().

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

22 {
24  config.checkConfigParameter("type", "Dupuit");
25  DBUG("Create Dupuit permeability.");
26 
27  std::string const& parameter_name =
29  config.getConfigParameter<std::string>("parameter_name");
30  auto const& parameter = ParameterLib::findParameter<double>(
31  parameter_name, parameters, 0, nullptr);
32  return std::make_unique<MaterialPropertyLib::DupuitPermeability>(parameter);
33 }

◆ createExponentialProperty()

std::unique_ptr< ExponentialProperty > MaterialPropertyLib::createExponentialProperty ( BaseLib::ConfigTree const &  config)
Input File Parameter:
properties__property__type
Input File Parameter:
properties__property__ExponentialProperty__reference_value
Input File Parameter:
properties__property__ExponentialProperty__exponent
Input File Parameter:
properties__property__ExponentialProperty__exponent__variable_name
Input File Parameter:
properties__property__ExponentialProperty__exponent__reference_condition
Input File Parameter:
properties__property__ExponentialProperty__exponent__factor

Definition at line 18 of file CreateExponentialProperty.cpp.

References BaseLib::ConfigTree::checkConfigParameter(), convertStringToVariable(), BaseLib::ConfigTree::getConfigParameter(), and BaseLib::ConfigTree::getConfigSubtree().

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

20 {
22  config.checkConfigParameter("type", "Exponential");
23  DBUG("Create Exponential property");
24  auto const reference_value =
26  config.getConfigParameter<double>("reference_value");
27 
28  auto const& exponent_data_config =
30  config.getConfigSubtree("exponent");
31 
32  auto const& variable_name =
34  exponent_data_config.getConfigParameter<std::string>("variable_name");
35  auto const reference_condition =
37  exponent_data_config.getConfigParameter<double>("reference_condition");
38  auto const factor =
40  exponent_data_config.getConfigParameter<double>("factor");
41 
42  MaterialPropertyLib::Variable exp_data_type =
44 
45  MaterialPropertyLib::ExponentData const exp_data{
46  exp_data_type, reference_condition, factor};
47 
48  return std::make_unique<MaterialPropertyLib::ExponentialProperty>(
49  reference_value, exp_data);
50 }
Variable convertStringToVariable(std::string const &input)

◆ createIdealGasLaw()

std::unique_ptr< IdealGasLaw > MaterialPropertyLib::createIdealGasLaw ( BaseLib::ConfigTree const &  config)
Input File Parameter:
properties__property__type

Definition at line 18 of file CreateIdealGasLaw.cpp.

References BaseLib::ConfigTree::checkConfigParameter().

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

20 {
22  config.checkConfigParameter("type", "IdealGasLaw");
23  DBUG("Create IdealGasLaw medium property");
24  return std::make_unique<IdealGasLaw>();
25 }

◆ createLinearProperty()

std::unique_ptr< LinearProperty > MaterialPropertyLib::createLinearProperty ( BaseLib::ConfigTree const &  config)
Input File Parameter:
properties__property__type
Input File Parameter:
properties__property__LinearProperty__reference_value
Input File Parameter:
properties__property__LinearProperty__independent_variable
Input File Parameter:
properties__property__LinearProperty__independent_variable__variable_name
Input File Parameter:
properties__property__LinearProperty__independent_variable__reference_condition
Input File Parameter:
properties__property__LinearProperty__independent_variable__slope

Definition at line 18 of file CreateLinearProperty.cpp.

References BaseLib::ConfigTree::checkConfigParameter(), convertStringToVariable(), BaseLib::ConfigTree::getConfigParameter(), and BaseLib::ConfigTree::getConfigSubtreeList().

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

20 {
22  config.checkConfigParameter("type", "Linear");
23  DBUG("Create Linear property");
24 
25  auto const reference_value =
27  config.getConfigParameter<double>("reference_value");
28 
29  std::vector<MaterialPropertyLib::IndependentVariable> ivs;
30  for (
31  auto const& independent_variable_config :
33  config.getConfigSubtreeList("independent_variable"))
34  {
35  auto const& variable_name =
37  independent_variable_config.getConfigParameter<std::string>(
38  "variable_name");
39  auto const reference_condition =
41  independent_variable_config.getConfigParameter<double>(
42  "reference_condition");
43  auto const slope =
45  independent_variable_config.getConfigParameter<double>("slope");
46 
49 
50  MaterialPropertyLib::IndependentVariable iv{ivt, reference_condition,
51  slope};
52 
53  ivs.push_back(std::move(iv));
54  }
55 
56  return std::make_unique<MaterialPropertyLib::LinearProperty>(
57  reference_value, ivs);
58 }
Variable convertStringToVariable(std::string const &input)

◆ createMaterialSpatialDistributionMap()

std::unique_ptr< MaterialSpatialDistributionMap > MaterialPropertyLib::createMaterialSpatialDistributionMap ( std::map< int, std::shared_ptr< Medium >> const &  media,
MeshLib::Mesh const &  mesh 
)

Definition at line 18 of file CreateMaterialSpatialDistributionMap.cpp.

References MeshLib::materialIDs().

Referenced by ProcessLib::ComponentTransport::createComponentTransportProcess(), ProcessLib::HeatTransportBHE::createHeatTransportBHEProcess(), ProcessLib::HT::createHTProcess(), ProcessLib::HydroMechanics::createHydroMechanicsProcess(), ProcessLib::LiquidFlow::createLiquidFlowProcess(), ProcessLib::RichardsMechanics::createRichardsMechanicsProcess(), ProcessLib::ThermoHydroMechanics::createThermoHydroMechanicsProcess(), and ProcessLib::TwoPhaseFlowWithPP::createTwoPhaseFlowWithPPProcess().

21 {
22  auto const material_ids = materialIDs(mesh);
23 
24  int const max_material_id =
25  !material_ids
26  ? 0
27  : *std::max_element(begin(*material_ids), end(*material_ids));
28 
29  if (max_material_id > static_cast<int>(media.size() - 1))
30  {
31  WARN(
32  "The maximum value of MaterialIDs in mesh is %d. As the given "
33  "number of porous media definitions in the project file is %d, the "
34  "maximum value of MaterialIDs in mesh must be %d (index starts "
35  "with zero).",
36  max_material_id, media.size(), max_material_id - 1);
37  }
38 
39  if (max_material_id < static_cast<int>(media.size() - 1))
40  WARN(
41  "There are %d porous medium definitions in the project file but "
42  "only %d different values in the MaterialIDs vector/data_array in "
43  "the mesh.",
44  media.size(), max_material_id - 1);
45 
46  return std::make_unique<MaterialSpatialDistributionMap>(media,
47  material_ids);
48 }
PropertyVector< int > const * materialIDs(Mesh const &mesh)
Definition: Mesh.cpp:310

◆ createMedium()

std::unique_ptr< Medium > MaterialPropertyLib::createMedium ( BaseLib::ConfigTree const &  config,
std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &  parameters,
ParameterLib::CoordinateSystem const *const  local_coordinate_system 
)

This function parses the "phases" and "properties" subtrees of the config tree and calls create methods for the phase vector and the properties array. Medium properties are optional. If not defined, default properties are assigned.

Input File Parameter:
prj__media__medium__phases
Input File Parameter:
prj__media__medium__properties

Definition at line 26 of file CreateMedium.cpp.

References createPhases(), createProperties(), BaseLib::ConfigTree::getConfigSubtreeOptional(), and OGS_FATAL.

Referenced by ProjectData::parseMedia().

30 {
31  // Parsing the phases
32  // Properties of phases may be not required in all the cases.
33  auto&& phases =
35  createPhases(config.getConfigSubtreeOptional("phases"),
36  parameters,
37  local_coordinate_system);
38 
39  // Parsing medium properties, overwriting the defaults.
40  auto&& properties =
42  createProperties(config.getConfigSubtreeOptional("properties"),
43  parameters, local_coordinate_system);
44 
45  if (phases.empty() && !properties)
46  {
47  OGS_FATAL("Neither tag <phases> nor tag <properties> has been found.");
48  }
49 
50  return std::make_unique<Medium>(std::move(phases), std::move(properties));
51 }
std::unique_ptr< PropertyArray > createProperties(boost::optional< BaseLib::ConfigTree > const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters, ParameterLib::CoordinateSystem const *const local_coordinate_system)
std::vector< std::unique_ptr< Phase > > createPhases(boost::optional< BaseLib::ConfigTree > const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters, ParameterLib::CoordinateSystem const *const local_coordinate_system)
Definition: CreatePhase.cpp:86
#define OGS_FATAL(fmt,...)
Definition: Error.h:64

◆ createParameterProperty()

std::unique_ptr< ParameterProperty > MaterialPropertyLib::createParameterProperty ( BaseLib::ConfigTree const &  config,
std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &  parameters 
)
Input File Parameter:
properties__property__type
Input File Parameter:
properties__property__Parameter__parameter_name

Definition at line 23 of file CreateParameterProperty.cpp.

References BaseLib::ConfigTree::checkConfigParameter(), and BaseLib::ConfigTree::getConfigParameter().

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

26 {
28  config.checkConfigParameter("type", "Parameter");
29  DBUG("Create Parameter property");
30 
31  std::string const& parameter_name =
33  config.getConfigParameter<std::string>("parameter_name");
34  auto const& parameter = ParameterLib::findParameter<double>(
35  parameter_name, parameters, 0, nullptr);
36  return std::make_unique<MaterialPropertyLib::ParameterProperty>(parameter);
37 }

◆ createPermeabilityOrthotropicPowerLaw()

std::unique_ptr< Property > MaterialPropertyLib::createPermeabilityOrthotropicPowerLaw ( BaseLib::ConfigTree const &  config,
ParameterLib::CoordinateSystem const *const  local_coordinate_system 
)
Input File Parameter:
properties__property__type
Input File Parameter:
properties__property__PermeabilityOrthotropicPowerLaw__intrinsic_permeabilities
Input File Parameter:
properties__property__PermeabilityOrthotropicPowerLaw__exponents

Definition at line 16 of file CreatePermeabilityOrthotropicPowerLaw.cpp.

References BaseLib::ConfigTree::checkConfigParameter(), BaseLib::ConfigTree::getConfigParameter(), and OGS_FATAL.

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

19 {
21  config.checkConfigParameter("type", "PermeabilityOrthotropicPowerLaw");
22  DBUG("Create PermeabilityOrthotropicPowerLaw solid phase property");
23 
24  auto const intrinsic_permeabilities =
26  config.getConfigParameter<std::vector<double>>(
27  "intrinsic_permeabilities");
28 
29  if (!((intrinsic_permeabilities.size() == 3) ||
30  (intrinsic_permeabilities.size() == 2)))
31  {
32  OGS_FATAL(
33  "The number of intrinsic permeabilities must be two or three, but "
34  "%d were given.",
35  intrinsic_permeabilities.size());
36  }
37 
38  auto const exponents =
40  config.getConfigParameter<std::vector<double>>("exponents");
41 
42  if (exponents.size() != 3 && exponents.size() != 2)
43  {
44  OGS_FATAL(
45  "The number of exponents must be two or three, but %d were given.",
46  exponents.size());
47  }
48 
49  if (intrinsic_permeabilities.size() != exponents.size())
50  {
51  OGS_FATAL(
52  "The number of intrinsic permeabilities and exponents must be "
53  "equal, but they are %d and %d, respectively.",
54  intrinsic_permeabilities.size(), exponents.size());
55  }
56 
57  if (exponents.size() == 2)
58  {
59  return std::make_unique<PermeabilityOrthotropicPowerLaw<2>>(
60  std::array<double, 2>{intrinsic_permeabilities[0],
61  intrinsic_permeabilities[1]},
62  std::array<double, 2>{exponents[0], exponents[1]},
63  local_coordinate_system);
64  }
65  if (exponents.size() == 3)
66  {
67  return std::make_unique<PermeabilityOrthotropicPowerLaw<3>>(
68  std::array<double, 3>{intrinsic_permeabilities[0],
69  intrinsic_permeabilities[1],
70  intrinsic_permeabilities[2]},
71  std::array<double, 3>{exponents[0], exponents[1], exponents[2]},
72  local_coordinate_system);
73  }
74  OGS_FATAL(
75  "Could not create PermeabilityOrthotropicPowerLaw material model.");
76 }
#define OGS_FATAL(fmt,...)
Definition: Error.h:64

◆ createPhases()

std::vector< std::unique_ptr< Phase > > MaterialPropertyLib::createPhases ( boost::optional< BaseLib::ConfigTree > const &  config,
std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &  parameters,
ParameterLib::CoordinateSystem const *const  local_coordinate_system 
)

A method that parses the phase details and stores them in the private _phases member.

This method creates the phases of the medium. Unlike a medium, a phase may have a name. However, this is silly at the moment since this name still has no effect (except of some benefits in regard of readability). Phase components are required (a phase consists of at least one component). Phase properties are optional. If not given, default properties are assigned. These default properties average the component properties, weighted by mole fraction.

Input File Parameter:
prj__media__medium__phases__phase

Definition at line 86 of file CreatePhase.cpp.

References anonymous_namespace{CreatePhase.cpp}::createPhase(), and OGS_FATAL.

Referenced by createMedium().

90 {
91  if (!config)
92  {
93  return {};
94  }
95 
96  std::vector<std::unique_ptr<Phase>> phases;
97 
98  for (auto phase_config :
100  config->getConfigSubtreeList("phase"))
101  {
102  auto phase =
103  createPhase(phase_config, parameters, local_coordinate_system);
104 
105  if (std::find_if(phases.begin(),
106  phases.end(),
107  [phase_name = phase->name](auto const& p) {
108  return p->name == phase_name;
109  }) != phases.end())
110  {
111  OGS_FATAL("Found duplicates with the same phase name tag '%s'.",
112  phase->name.c_str());
113  }
114 
115  phases.push_back(std::move(phase));
116  }
117 
118  return phases;
119 }
std::unique_ptr< MaterialPropertyLib::Phase > createPhase(BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters, ParameterLib::CoordinateSystem const *const local_coordinate_system)
Definition: CreatePhase.cpp:27
static const double p
#define OGS_FATAL(fmt,...)
Definition: Error.h:64

◆ createPorosityFromMassBalance()

std::unique_ptr< PorosityFromMassBalance > MaterialPropertyLib::createPorosityFromMassBalance ( BaseLib::ConfigTree const &  config,
std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &  parameters 
)
Input File Parameter:
properties__property__type
Input File Parameter:
properties__property__PorosityFromMassBalance__initial_porosity

Definition at line 18 of file CreatePorosityFromMassBalance.cpp.

References BaseLib::ConfigTree::checkConfigParameter(), and BaseLib::ConfigTree::getConfigParameter().

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

21 {
23  config.checkConfigParameter("type", "PorosityFromMassBalance");
24  DBUG("Create PorosityFromMassBalance medium property");
25 
26  std::string const& parameter_name =
28  config.getConfigParameter<std::string>("initial_porosity");
29  auto const& initial_porosity = ParameterLib::findParameter<double>(
30  parameter_name, parameters, 0, nullptr);
31 
32  return std::make_unique<PorosityFromMassBalance>(initial_porosity);
33 }

◆ createProperties()

std::unique_ptr< PropertyArray > MaterialPropertyLib::createProperties ( boost::optional< BaseLib::ConfigTree > const &  config,
std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &  parameters,
ParameterLib::CoordinateSystem const *const  local_coordinate_system 
)

The method reads the 'properties' tag in the prj-file and creates component properties accordingly.

First, a new property iy created based on the specified property type. Then, the property name is evaluated and the property is copied into the properties array.

Input File Parameter:
properties__property
Input File Parameter:
properties__property__name

Definition at line 117 of file CreateProperty.cpp.

References convertStringToProperty(), and anonymous_namespace{CreateProperty.cpp}::createProperty().

Referenced by anonymous_namespace{CreateComponent.cpp}::createComponent(), createMedium(), anonymous_namespace{CreatePhase.cpp}::createPhase(), and ProcessLib::LIE::PostProcessTool::getOutputMesh().

121 {
122  if (!config)
123  {
124  return nullptr;
125  }
126 
128  auto const& property_configs = config->getConfigSubtreeList("property");
129  if (property_configs.empty())
130  {
131  return nullptr;
132  }
133 
134  auto properties = std::make_unique<PropertyArray>();
135 
136  for (auto property_config : property_configs)
137  {
138  // Parsing the property name:
139  auto const property_name =
141  property_config.getConfigParameter<std::string>("name");
142  // Create a new property based on the configuration subtree:
143  auto property = createProperty(
144  property_config, parameters, local_coordinate_system);
145 
146  // Insert the new property at the right position into the components
147  // private PropertyArray:
148  (*properties)[convertStringToProperty(property_name)] =
149  std::move(property);
150  }
151  return properties;
152 }
std::unique_ptr< MaterialPropertyLib::Property > createProperty(BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters, ParameterLib::CoordinateSystem const *const local_coordinate_system)
PropertyType convertStringToProperty(std::string const &inString)
Definition: PropertyType.h:89

◆ createRelPermBrooksCorey()

std::unique_ptr< RelPermBrooksCorey > MaterialPropertyLib::createRelPermBrooksCorey ( BaseLib::ConfigTree const &  config)
Input File Parameter:
properties__property__type
Input File Parameter:
properties__property__RelPermBrooksCorey__residual_liquid_saturation
Input File Parameter:
properties__property__RelPermBrooksCorey__residual_gas_saturation
Input File Parameter:
properties__property__RelPermBrooksCorey__min_relative_permeability_liquid
Input File Parameter:
properties__property__RelPermBrooksCorey__min_relative_permeability_gas
Input File Parameter:
properties__property__RelPermBrooksCorey__lambda

Definition at line 16 of file CreateRelPermBrooksCorey.cpp.

References BaseLib::ConfigTree::checkConfigParameter(), BaseLib::ConfigTree::getConfigParameter(), OGS_FATAL, residual_gas_saturation, and residual_liquid_saturation.

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

18 {
20  config.checkConfigParameter("type", "RelPermBrooksCorey");
21  DBUG("Create RelPermBrooksCorey medium property");
22 
23  auto const residual_liquid_saturation =
25  config.getConfigParameter<double>("residual_liquid_saturation");
26  auto const residual_gas_saturation =
28  config.getConfigParameter<double>("residual_gas_saturation");
29  auto const min_relative_permeability_liquid =
31  config.getConfigParameter<double>("min_relative_permeability_liquid");
32  auto const min_relative_permeability_gas =
34  config.getConfigParameter<double>("min_relative_permeability_gas");
35  auto const exponent =
37  config.getConfigParameter<double>("lambda");
38  if (exponent <= 0.)
39  {
40  OGS_FATAL("Exponent 'lambda' must be positive.");
41  }
42 
43  return std::make_unique<RelPermBrooksCorey>(
46  min_relative_permeability_liquid,
47  min_relative_permeability_gas,
48  exponent);
49 }
#define OGS_FATAL(fmt,...)
Definition: Error.h:64

◆ createRelPermLiakopoulos()

std::unique_ptr< RelPermLiakopoulos > MaterialPropertyLib::createRelPermLiakopoulos ( BaseLib::ConfigTree const &  config)
Input File Parameter:
properties__property__type
Input File Parameter:
properties__property__RelPermLiakopoulos

Definition at line 16 of file CreateRelPermLiakopoulos.cpp.

References BaseLib::ConfigTree::checkConfigParameter().

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

18 {
20  config.checkConfigParameter("type", "RelPermLiakopoulos");
21  DBUG("Create RelPermLiakopoulos medium property");
22 
24  return std::make_unique<RelPermLiakopoulos>();
25 }

◆ createRelPermVanGenuchten()

std::unique_ptr< RelPermVanGenuchten > MaterialPropertyLib::createRelPermVanGenuchten ( BaseLib::ConfigTree const &  config)
Input File Parameter:
properties__property__type
Input File Parameter:
properties__property__RelativePermeabilityVanGenuchten__residual_liquid_saturation
Input File Parameter:
properties__property__RelativePermeabilityVanGenuchten__residual_gas_saturation
Input File Parameter:
properties__property__RelativePermeabilityVanGenuchten__minimum_relative_permeability_liquid
Input File Parameter:
properties__property__RelativePermeabilityVanGenuchten__exponent

Definition at line 16 of file CreateRelPermVanGenuchten.cpp.

References BaseLib::ConfigTree::checkConfigParameter(), BaseLib::ConfigTree::getConfigParameter(), OGS_FATAL, residual_gas_saturation, and residual_liquid_saturation.

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

18 {
20  config.checkConfigParameter("type", "RelativePermeabilityVanGenuchten");
21  DBUG("Create RelativePermeabilityVanGenuchten medium property");
22 
23  auto const residual_liquid_saturation =
25  config.getConfigParameter<double>("residual_liquid_saturation");
26  auto const residual_gas_saturation =
28  config.getConfigParameter<double>("residual_gas_saturation");
29  auto const min_relative_permeability_liquid =
31  config.getConfigParameter<double>(
32  "minimum_relative_permeability_liquid");
33  auto const exponent =
35  config.getConfigParameter<double>("exponent");
36  if (exponent <= 0. || exponent >= 1.)
37  {
38  OGS_FATAL("Exponent must be in the (0, 1) range.");
39  }
40 
41  return std::make_unique<RelPermVanGenuchten>(
44  min_relative_permeability_liquid,
45  exponent);
46 }
#define OGS_FATAL(fmt,...)
Definition: Error.h:64

◆ createSaturationBrooksCorey()

std::unique_ptr< SaturationBrooksCorey > MaterialPropertyLib::createSaturationBrooksCorey ( BaseLib::ConfigTree const &  config)
Input File Parameter:
properties__property__type
Input File Parameter:
properties__property__SaturationBrooksCorey__residual_liquid_saturation
Input File Parameter:
properties__property__SaturationBrooksCorey__residual_gas_saturation
Input File Parameter:
properties__property__SaturationBrooksCorey__lambda
Input File Parameter:
properties__property__SaturationBrooksCorey__entry_pressure

Definition at line 16 of file CreateSaturationBrooksCorey.cpp.

References BaseLib::ConfigTree::checkConfigParameter(), entry_pressure, BaseLib::ConfigTree::getConfigParameter(), residual_gas_saturation, and residual_liquid_saturation.

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

18 {
20  config.checkConfigParameter("type", "SaturationBrooksCorey");
21 
22  DBUG("Create SaturationBrooksCorey medium property");
23 
24  auto const residual_liquid_saturation =
26  config.getConfigParameter<double>("residual_liquid_saturation");
27  auto const residual_gas_saturation =
29  config.getConfigParameter<double>("residual_gas_saturation");
30  auto const exponent =
32  config.getConfigParameter<double>("lambda");
33  auto const entry_pressure =
35  config.getConfigParameter<double>("entry_pressure");
36 
37  return std::make_unique<SaturationBrooksCorey>(residual_liquid_saturation,
39  exponent, entry_pressure);
40 }

◆ createSaturationLiakopoulos()

std::unique_ptr< SaturationLiakopoulos > MaterialPropertyLib::createSaturationLiakopoulos ( BaseLib::ConfigTree const &  config)
Input File Parameter:
properties__property__type
Input File Parameter:
properties__property__SaturationLiakopoulos

Definition at line 16 of file CreateSaturationLiakopoulos.cpp.

References BaseLib::ConfigTree::checkConfigParameter().

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

18 {
20  config.checkConfigParameter("type", "SaturationLiakopoulos");
21  DBUG("Create SaturationLiakopoulos medium property");
22 
24  return std::make_unique<SaturationLiakopoulos>();
25 }

◆ createSaturationVanGenuchten()

std::unique_ptr< SaturationVanGenuchten > MaterialPropertyLib::createSaturationVanGenuchten ( BaseLib::ConfigTree const &  config)
Input File Parameter:
properties__property__type
Input File Parameter:
properties__property__SaturationVanGenuchten__residual_liquid_saturation
Input File Parameter:
properties__property__SaturationVanGenuchten__residual_gas_saturation
Input File Parameter:
properties__property__SaturationVanGenuchten__exponent
Input File Parameter:
properties__property__SaturationVanGenuchten__entry_pressure

Definition at line 16 of file CreateSaturationVanGenuchten.cpp.

References BaseLib::ConfigTree::checkConfigParameter(), entry_pressure, BaseLib::ConfigTree::getConfigParameter(), residual_gas_saturation, and residual_liquid_saturation.

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

18 {
20  config.checkConfigParameter("type", "SaturationVanGenuchten");
21 
22  DBUG("Create SaturationVanGenuchten medium property");
23 
24  auto const residual_liquid_saturation =
26  config.getConfigParameter<double>("residual_liquid_saturation");
27  auto const residual_gas_saturation =
29  config.getConfigParameter<double>("residual_gas_saturation");
30  auto const exponent =
32  config.getConfigParameter<double>("exponent");
33  auto const entry_pressure =
35  config.getConfigParameter<double>("entry_pressure");
36 
37  return std::make_unique<SaturationVanGenuchten>(residual_liquid_saturation,
39  exponent, entry_pressure);
40 }

◆ formEffectiveThermalConductivity()

template<int GlobalDim>
Eigen::Matrix< double, GlobalDim, GlobalDim > MaterialPropertyLib::formEffectiveThermalConductivity ( MaterialPropertyLib::PropertyDataType const &  solid_thermal_conductivity,
const double  fluid_thermal_conductivity,
const double  porosity 
)

Definition at line 19 of file FormEffectiveThermalConductivity.cpp.

References formEffectiveThermalConductivity< 1 >(), formEffectiveThermalConductivity< 2 >(), formEffectiveThermalConductivity< 3 >(), and porosity.

Referenced by ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::assembleWithJacobian().

22 {
23  return (1.0 - porosity) *
24  formEigenTensor<GlobalDim>(solid_thermal_conductivity) +
25  porosity * fluid_thermal_conductivity *
26  Eigen::Matrix<double, GlobalDim, GlobalDim>::Identity();
27 }

◆ formEffectiveThermalConductivity< 1 >()

template Eigen::Matrix<double, 1, 1> MaterialPropertyLib::formEffectiveThermalConductivity< 1 > ( MaterialPropertyLib::PropertyDataType const &  solid_thermal_conductivity,
const double  fluid_thermal_conductivity,
const double  porosity 
)

◆ formEffectiveThermalConductivity< 2 >()

template Eigen::Matrix<double, 2, 2> MaterialPropertyLib::formEffectiveThermalConductivity< 2 > ( MaterialPropertyLib::PropertyDataType const &  solid_thermal_conductivity,
const double  fluid_thermal_conductivity,
const double  porosity 
)

◆ formEffectiveThermalConductivity< 3 >()

template Eigen::Matrix<double, 3, 3> MaterialPropertyLib::formEffectiveThermalConductivity< 3 > ( MaterialPropertyLib::PropertyDataType const &  solid_thermal_conductivity,
const double  fluid_thermal_conductivity,
const double  porosity 
)

◆ formEigenTensor()

template<int GlobalDim>
Eigen::Matrix< double, GlobalDim, GlobalDim > MaterialPropertyLib::formEigenTensor ( MaterialPropertyLib::PropertyDataType const &  values)

Definition at line 99 of file FormEigenTensor.cpp.

References formEigenTensor< 1 >(), formEigenTensor< 2 >(), and formEigenTensor< 3 >().

101 {
102  return std::visit(FormEigenTensor<GlobalDim>(), values);
103 }

◆ formEigenTensor< 1 >()

template Eigen::Matrix<double, 1, 1> MaterialPropertyLib::formEigenTensor< 1 > ( MaterialPropertyLib::PropertyDataType const &  values)

Referenced by formEigenTensor().

◆ formEigenTensor< 2 >()

template Eigen::Matrix<double, 2, 2> MaterialPropertyLib::formEigenTensor< 2 > ( MaterialPropertyLib::PropertyDataType const &  values)

Referenced by formEigenTensor().

◆ formEigenTensor< 3 >()

◆ fromVector()

PropertyDataType MaterialPropertyLib::fromVector ( std::vector< double > const &  values)

Conversion of a vector to PropertyDataType for different sizes of the vector.

Attention
It cannot distinguish between 2x2 matrix and 4x1 vector.

Definition at line 19 of file Property.cpp.

References OGS_FATAL.

Referenced by createConstant(), MaterialPropertyLib::PorosityFromMassBalance::initialValue(), MaterialPropertyLib::DupuitPermeability::value(), and MaterialPropertyLib::ParameterProperty::value().

20 {
21  switch (values.size())
22  {
23  case 1:
24  {
25  return values[0];
26  }
27  case 2:
28  {
29  return Eigen::Vector2d{values[0], values[1]};
30  }
31  case 3:
32  {
33  return Eigen::Vector3d{values[0], values[1], values[2]};
34  }
35  case 4:
36  {
37  using M = Eigen::Matrix2d;
38  return M{Eigen::Map<M const>{values.data(), 2, 2}};
39  }
40  case 6:
41  {
42  // Symmetric Tensor - xx, yy, zz, xy, xz, yz
43  using M = Eigen::Matrix<double, 6, 1>;
44  return M{Eigen::Map<M const>{values.data(), 6}};
45  }
46  case 9:
47  {
48  using M = Eigen::Matrix3d;
49  return M{Eigen::Map<M const>{values.data(), 3, 3}};
50  }
51  default:
52  {
53  OGS_FATAL(
54  "Conversion of a %d-vector to PropertyDataType is not "
55  "implemented.",
56  values.size());
57  }
58  }
59 }
#define OGS_FATAL(fmt,...)
Definition: Error.h:64

◆ getThermalExpansivity()

double MaterialPropertyLib::getThermalExpansivity ( Phase const &  phase,
VariableArray const &  vars,
const double  density,
ParameterLib::SpatialPosition const &  pos,
double const  t,
double const  dt 
)

It gets the thermal expansion coefficient.

If the the thermal expansion coefficient is given in the project file via the media property of thermal_expansivity, e.g

*     <property>
*       <name>thermal_expansivity</name>
*       <type>Constant</type>
*       <value>2.07e-4</value>
*     </property>
* 

it returns the value of the given property. Otherwise it returns the value computed from the density model by the following formula

\[ (\frac{\partial \rho}{\partial T})/\rho \]

where $\rho$ is the density, $T$ is the temperature.

Definition at line 21 of file GetThermalExpansivity.cpp.

References density, MaterialPropertyLib::Phase::property(), temperature, and thermal_expansivity.

Referenced by ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::assembleWithJacobian().

25 {
26  auto const thermal_expansivity_ptr =
28 
29  // The thermal expansivity is explicitly given in the project file.
30  if (thermal_expansivity_ptr)
31  {
32  return (*thermal_expansivity_ptr)
33  .template value<double>(vars, pos, t, dt);
34  }
35 
36  // The thermal expansivity calculated by the density model directly.
37  return (density == 0.0)
38  ? 0.0
40  .template dValue<double>(
42  pos, t, dt) /
43  density;
44 }

◆ molarMass()

double MaterialPropertyLib::molarMass ( Phase _phase,
Component _component,
VariableArray const &  variable_array,
ParameterLib::SpatialPosition const &  pos,
double const  t,
double const  dt 
)

Definition at line 22 of file IdealGasLaw.cpp.

References molar_mass, OGS_FATAL, MaterialPropertyLib::Component::property(), and MaterialPropertyLib::Phase::property().

Referenced by MaterialPropertyLib::IdealGasLaw::d2Value(), MaterialPropertyLib::IdealGasLaw::dValue(), and MaterialPropertyLib::IdealGasLaw::value().

26 {
27  if (_phase) // IdealGasLaw of an entire phase
28  {
29  return _phase->property(PropertyType::molar_mass)
30  .template value<double>(variable_array, pos, t, dt);
31  }
32  if (_component) // IdealGasLaw of a single component
33  {
34  return _component->property(PropertyType::molar_mass)
35  .template value<double>(variable_array, pos, t, dt);
36  }
37  OGS_FATAL(
38  "Neither a phase nor a component are set for retrieving molar "
39  "mass.");
40 
41  return 0.;
42 }
#define OGS_FATAL(fmt,...)
Definition: Error.h:64

◆ newComponent()

std::unique_ptr<Component> MaterialPropertyLib::newComponent ( std::string const &  component_name,
bool &  isCustomComponent 
)

Method for creating a new component based on the specified component name.

This function creates a new component based on the (optional) component name that is given in the prj-file.

The method evaluates the string in the 'name'-object and calls the constructors of the derived component classes (if found) or that of the base class (if no name is specified).

◆ overwriteExistingProperties()

void MaterialPropertyLib::overwriteExistingProperties ( PropertyArray properties,
PropertyArray new_properties,
std::variant< Medium *, Phase *, Component *>  scale_pointer 
)
inline

Definition at line 121 of file Property.h.

Referenced by MaterialPropertyLib::Component::Component(), MaterialPropertyLib::Medium::Medium(), and MaterialPropertyLib::Phase::Phase().

126 {
127  for (std::size_t i = 0; i < properties.size(); ++i)
128  {
129  if (new_properties[i] != nullptr)
130  {
131  properties[i] = std::move(new_properties[i]);
132  properties[i]->setScale(scale_pointer);
133  }
134  }
135 }

Variable Documentation

◆ property_enum_to_string

const std::array<std::string, PropertyType::number_of_properties> MaterialPropertyLib::property_enum_to_string
static

Definition at line 261 of file PropertyType.h.

Referenced by checkRequiredProperties().