OGS 6.2.1-76-gbb689931b
MaterialPropertyLib Namespace Reference

Detailed Description

Classes

class  Component
 This class defines components (substances). More...
 
class  Constant
 
struct  ExponentData
 
class  ExponentialProperty
 
struct  FormEigenTensor
 
struct  IndependentVariable
 
class  LinearProperty
 
class  MaterialSpatialDistributionMap
 
class  Medium
 
class  ParameterProperty
 
class  Phase
 
class  Property
 
struct  Water
 

Typedefs

using PropertyArray = std::array< std::unique_ptr< Property >, PropertyType::number_of_properties >
 
using PropertyDataType = std::variant< double, Pair, Vector, Tensor2d, SymmTensor, Tensor, std::string >
 
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 >
 
using VariableArray = std::array< VariableType, static_cast< int >(Variable::number_of_variables)>
 

Enumerations

enum  PropertyDataTypeName {
  nScalar, nPair, nVector, nSymmTensor,
  nTensor
}
 
enum  PropertyType : int {
  acentric_factor, binary_interaction_coefficient, biot_coefficient, brooks_corey_exponent,
  bulk_modulus, critical_density, critical_pressure, critical_temperature,
  compressibility, 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::phase_pressure, Variable::capillary_pressure, Variable::density, Variable::temperature,
  Variable::liquid_saturation, Variable::displacement, Variable::number_of_variables
}
 

Functions

std::unique_ptr< ComponentnewComponent (std::string const &component_name, bool &isCustomComponent)
 
double getThermalExpansivity (Phase const &phase, VariableArray const &vars, const double density, ParameterLib::SpatialPosition const &pos, double const t)
 
std::vector< std::unique_ptr< Component > > createComponents (boost::optional< BaseLib::ConfigTree > const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters)
 
std::unique_ptr< MaterialSpatialDistributionMapcreateMaterialSpatialDistributionMap (std::map< int, std::unique_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)
 
std::vector< std::unique_ptr< Phase > > createPhases (boost::optional< BaseLib::ConfigTree > const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters)
 
std::unique_ptr< PropertyArraycreateProperties (boost::optional< BaseLib::ConfigTree > const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters)
 
void overwriteExistingProperties (PropertyArray &properties, PropertyArray &new_properties)
 
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)
 
double getScalar (VariableType pv)
 This method returns a value of type double from the variables array. More...
 

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 37 of file CreateProperty.h.

◆ PropertyDataType

using MaterialPropertyLib::PropertyDataType = typedef std:: variant<double, Pair, Vector, Tensor2d, SymmTensor, Tensor, std::string>

Definition at line 39 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 62 of file VariableType.h.

◆ VariableType

using MaterialPropertyLib::VariableType = typedef std::variant<double, Vector>

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

Definition at line 56 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

◆ PropertyDataTypeName

This is a custom data type for arbitrary properties, based on the std::variant container. It can hold scalars, vectors, tensors, and so forth.

Enumerator
nScalar 
nPair 
nVector 
nSymmTensor 
nTensor 

Definition at line 29 of file Property.h.

◆ 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 
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 35 of file PropertyType.h.

35  : int
36 {
46  density,
47  drhodT,
54  molar_mass,
58  name,
61  porosity,
70  saturation,
72  storage,
79  viscosity,
81 };
used to compute the hydrodynamic dispersion tensor.
Definition: PropertyType.h:57
specify retardation factor used in component transport process.
Definition: PropertyType.h:69
used to compute the hydrodynamic dispersion tensor.
Definition: PropertyType.h:53
used to compute the hydrodynamic dispersion tensor.
Definition: PropertyType.h:78

◆ 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
phase_pressure 
capillary_pressure 
density 
temperature 
liquid_saturation 
displacement 
number_of_variables 

Definition at line 43 of file VariableType.h.

Function Documentation

◆ 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 88 of file PropertyType.h.

References acentric_factor, binary_interaction_coefficient, biot_coefficient, brooks_corey_exponent, bulk_modulus, compressibility, critical_density, critical_pressure, critical_temperature, 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().

89 {
90  if (boost::iequals(inString, "acentric_factor"))
91  {
93  }
94  if (boost::iequals(inString, "binary_interaction_coefficient"))
95  {
97  }
98  if (boost::iequals(inString, "biot_coefficient"))
99  {
101  }
102  if (boost::iequals(inString, "brooks_corey_exponent"))
103  {
105  }
106  if (boost::iequals(inString, "bulk_modulus"))
107  {
109  }
110  if (boost::iequals(inString, "critical_density"))
111  {
113  }
114  if (boost::iequals(inString, "critical_pressure"))
115  {
117  }
118  if (boost::iequals(inString, "critical_temperature"))
119  {
121  }
122  if (boost::iequals(inString, "compressibility"))
123  {
125  }
126  if (boost::iequals(inString, "density"))
127  {
128  return PropertyType::density;
129  }
130  if (boost::iequals(inString, "drhodT"))
131  {
132  return PropertyType::drhodT;
133  }
134  if (boost::iequals(inString, "effective_stress"))
135  {
137  }
138  if (boost::iequals(inString, "entry_pressure"))
139  {
141  }
142  if (boost::iequals(inString, "fredlund_parameters"))
143  {
145  }
146  if (boost::iequals(inString, "heat_capacity"))
147  {
149  }
150  if (boost::iequals(inString, "longitudinal_dispersivity"))
151  {
153  }
154  if (boost::iequals(inString, "molar_mass"))
155  {
157  }
158  if (boost::iequals(inString, "mole_fraction"))
159  {
161  }
162  if (boost::iequals(inString, "molecular_diffusion"))
163  {
165  }
166  if (boost::iequals(inString, "name"))
167  {
168  return PropertyType::name;
169  }
170  if (boost::iequals(inString, "permeability"))
171  {
173  }
174  if (boost::iequals(inString, "porosity"))
175  {
176  return PropertyType::porosity;
177  }
178  if (boost::iequals(inString, "phase_velocity"))
179  {
181  }
182  if (boost::iequals(inString, "reference_density"))
183  {
185  }
186  if (boost::iequals(inString, "reference_temperature"))
187  {
189  }
190  if (boost::iequals(inString, "reference_pressure"))
191  {
193  }
194  if (boost::iequals(inString, "relative_permeability"))
195  {
197  }
198  if (boost::iequals(inString, "residual_gas_saturation"))
199  {
201  }
202  if (boost::iequals(inString, "residual_liquid_saturation"))
203  {
205  }
206  if (boost::iequals(inString, "retardation_factor"))
207  {
209  }
210  if (boost::iequals(inString, "saturation"))
211  {
213  }
214  if (boost::iequals(inString, "specific_heat_capacity"))
215  {
217  }
218  if (boost::iequals(inString, "storage"))
219  {
220  return PropertyType::storage;
221  }
222  if (boost::iequals(inString, "thermal_conductivity"))
223  {
225  }
226  if (boost::iequals(inString, "thermal_expansivity"))
227  {
229  }
230  if (boost::iequals(inString, "thermal_longitudinal_dispersivity"))
231  {
233  }
234  if (boost::iequals(inString, "thermal_transversal_dispersivity"))
235  {
237  }
238  if (boost::iequals(inString, "transversal_dispersivity"))
239  {
241  }
242  if (boost::iequals(inString, "viscosity"))
243  {
245  }
246 
247  OGS_FATAL(
248  "The property name '%s' does not correspond to any known property",
249  inString.c_str());
250 
251  return PropertyType::number_of_properties; // to avoid the 'no return'
252  // warning
253 }
used to compute the hydrodynamic dispersion tensor.
Definition: PropertyType.h:57
specify retardation factor used in component transport process.
Definition: PropertyType.h:69
used to compute the hydrodynamic dispersion tensor.
Definition: PropertyType.h:53
used to compute the hydrodynamic dispersion tensor.
Definition: PropertyType.h:78
#define OGS_FATAL(fmt,...)
Definition: Error.h:63

◆ convertStringToVariable()

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

Definition at line 18 of file VariableType.cpp.

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

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

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

◆ createComponents()

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

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().

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

◆ createMaterialSpatialDistributionMap()

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

Definition at line 19 of file CreateMaterialSpatialDistributionMap.cpp.

References MeshLib::materialIDs(), and OGS_FATAL.

Referenced by ProcessLib::ComponentTransport::createComponentTransportProcess(), ProcessLib::HT::createHTProcess(), and ProcessLib::ThermoHydroMechanics::createThermoHydroMechanicsProcess().

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

◆ createMedium()

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

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 27 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.
34  auto&& phases =
35  createPhases(config.getConfigSubtreeOptional("phases"), parameters);
36 
37  // Parsing medium properties, overwriting the defaults.
38  auto&& properties =
40  createProperties(config.getConfigSubtreeOptional("properties"),
41  parameters);
42 
43  if (phases.empty() && !properties)
44  {
45  OGS_FATAL("Neither tag <phases> nor tag <properties> has been found.");
46  }
47 
48  return std::make_unique<Medium>(std::move(phases), std::move(properties));
49 }
std::unique_ptr< PropertyArray > createProperties(boost::optional< BaseLib::ConfigTree > const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters)
std::vector< std::unique_ptr< Phase > > createPhases(boost::optional< BaseLib::ConfigTree > const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters)
Definition: CreatePhase.cpp:86
#define OGS_FATAL(fmt,...)
Definition: Error.h:63

◆ createPhases()

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

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().

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

◆ createProperties()

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

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 202 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().

205 {
206  if (!config)
207  {
208  return nullptr;
209  }
210 
212  auto const& property_configs = config->getConfigSubtreeList("property");
213  if (property_configs.empty())
214  {
215  return nullptr;
216  }
217 
218  auto properties = std::make_unique<PropertyArray>();
219 
220  for (auto property_config : property_configs)
221  {
222  // Parsing the property name:
223  auto const property_name =
225  property_config.getConfigParameter<std::string>("name");
226  // Create a new property based on the configuration subtree:
227  auto property = createProperty(property_config, parameters);
228 
229  // Insert the new property at the right position into the components
230  // private PropertyArray:
231  (*properties)[convertStringToProperty(property_name)] =
232  std::move(property);
233  }
234  return properties;
235 }
std::unique_ptr< MaterialPropertyLib::Property > createProperty(BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters)
PropertyType convertStringToProperty(std::string const &inString)
Definition: PropertyType.h:88

◆ 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 71 of file FormEigenTensor.cpp.

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

73 {
74  return std::visit(FormEigenTensor<GlobalDim>(), values);
75 }

◆ 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 >()

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

Referenced by formEigenTensor().

◆ getScalar()

double MaterialPropertyLib::getScalar ( VariableType  pv)
inline

This method returns a value of type double from the variables array.

Definition at line 65 of file VariableType.h.

References convertStringToVariable().

66 {
67  return std::get<double>(pv);
68 }

◆ getThermalExpansivity()

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

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 23 of file GetThermalExpansivity.cpp.

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

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

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

◆ 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 
)
inline

Definition at line 105 of file Property.h.

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

107 {
108  for (std::size_t i = 0; i < properties.size(); ++i)
109  {
110  if (new_properties[i] != nullptr)
111  {
112  properties[i] = std::move(new_properties[i]);
113  }
114  }
115 }

Variable Documentation

◆ property_enum_to_string

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

Definition at line 256 of file PropertyType.h.