OGS
ProcessLib::TH2M Namespace Reference

Namespaces

namespace  ConstitutiveRelations

Classes

struct  IntegrationPointData
struct  LocalAssemblerInterface
struct  SecondaryData
class  TH2MLocalAssembler
class  TH2MProcess
struct  TH2MProcessData

Typedefs

using InitializePorosityFromMediumProperty
 A type helping to avoid confusion of different boolean values.

Functions

template<int DisplacementDim>
void createLocalAssemblers (std::vector< MeshLib::Element * > const &mesh_elements, NumLib::LocalToGlobalIndexMap const &dof_table, std::vector< std::unique_ptr< LocalAssemblerInterface< DisplacementDim > > > &local_assemblers, NumLib::IntegrationOrder const integration_order, bool const is_axially_symmetric, TH2MProcessData< DisplacementDim > &process_data)
template void createLocalAssemblers< 2 > (std::vector< MeshLib::Element * > const &mesh_elements, NumLib::LocalToGlobalIndexMap const &dof_table, std::vector< std::unique_ptr< LocalAssemblerInterface< 2 > > > &local_assemblers, NumLib::IntegrationOrder const integration_order, bool const is_axially_symmetric, TH2MProcessData< 2 > &process_data)
template void createLocalAssemblers< 3 > (std::vector< MeshLib::Element * > const &mesh_elements, NumLib::LocalToGlobalIndexMap const &dof_table, std::vector< std::unique_ptr< LocalAssemblerInterface< 3 > > > &local_assemblers, NumLib::IntegrationOrder const integration_order, bool const is_axially_symmetric, TH2MProcessData< 3 > &process_data)
std::unique_ptr< ConstitutiveRelations::PhaseTransitionModelcreatePhaseTransitionModel (std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
template<int DisplacementDim>
std::unique_ptr< ProcesscreateTH2MProcess (std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
template std::unique_ptr< ProcesscreateTH2MProcess< 2 > (std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
template std::unique_ptr< ProcesscreateTH2MProcess< 3 > (std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)

Typedef Documentation

◆ InitializePorosityFromMediumProperty

Initial value:

A type helping to avoid confusion of different boolean values.

Definition at line 21 of file TH2MProcessData.h.

Function Documentation

◆ createLocalAssemblers()

template<int DisplacementDim>
void ProcessLib::TH2M::createLocalAssemblers ( std::vector< MeshLib::Element * > const & mesh_elements,
NumLib::LocalToGlobalIndexMap const & dof_table,
std::vector< std::unique_ptr< LocalAssemblerInterface< DisplacementDim > > > & local_assemblers,
NumLib::IntegrationOrder const integration_order,
bool const is_axially_symmetric,
TH2MProcessData< DisplacementDim > & process_data )

Definition at line 12 of file CreateTH2MLocalAssemblers.cpp.

20{
22 mesh_elements, dof_table, local_assemblers, integration_order,
23 is_axially_symmetric, process_data);
24}
void createLocalAssemblersHM(std::vector< MeshLib::Element * > const &mesh_elements, NumLib::LocalToGlobalIndexMap const &dof_table, std::vector< std::unique_ptr< LocalAssemblerInterface > > &local_assemblers, ProviderOrOrder const &provider_or_order, ExtraCtorArgs &&... extra_ctor_args)

References ProcessLib::createLocalAssemblersHM().

Referenced by ProcessLib::TH2M::TH2MProcess< DisplacementDim >::initializeConcreteProcess().

◆ createLocalAssemblers< 2 >()

template void ProcessLib::TH2M::createLocalAssemblers< 2 > ( std::vector< MeshLib::Element * > const & mesh_elements,
NumLib::LocalToGlobalIndexMap const & dof_table,
std::vector< std::unique_ptr< LocalAssemblerInterface< 2 > > > & local_assemblers,
NumLib::IntegrationOrder const integration_order,
bool const is_axially_symmetric,
TH2MProcessData< 2 > & process_data )

◆ createLocalAssemblers< 3 >()

template void ProcessLib::TH2M::createLocalAssemblers< 3 > ( std::vector< MeshLib::Element * > const & mesh_elements,
NumLib::LocalToGlobalIndexMap const & dof_table,
std::vector< std::unique_ptr< LocalAssemblerInterface< 3 > > > & local_assemblers,
NumLib::IntegrationOrder const integration_order,
bool const is_axially_symmetric,
TH2MProcessData< 3 > & process_data )

◆ createPhaseTransitionModel()

std::unique_ptr< ConstitutiveRelations::PhaseTransitionModel > ProcessLib::TH2M::createPhaseTransitionModel ( std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const & media)

Definition at line 26 of file CreateTH2MProcess.cpp.

28{
29 // the approach here is that the number of phase components determines the
30 // nature of the phase transition: If the gas phase consists of two or more
31 // components, evaporation is involved; if the water phase consists of at
32 // least two components, gas can be dissolved in water.
33
34 // Fluid phases are always defined in the first medium of the media vector,
35 // thus media.begin() points to the right medium.
36 const bool phase_transition =
37 (media.begin()->second->phase("Gas").numberOfComponents() > 1) &&
38 (media.begin()->second->phase("AqueousLiquid").numberOfComponents() >
39 1);
40 // Only if both fluids consist of more than one component, the model
41 // phase_transition is returned.
42 if (phase_transition)
43 {
44 return std::make_unique<ConstitutiveRelations::PhaseTransition>(media);
45 }
46 return std::make_unique<ConstitutiveRelations::NoPhaseTransition>(media);
47}

Referenced by createTH2MProcess().

◆ createTH2MProcess()

template<int DisplacementDim>
std::unique_ptr< Process > ProcessLib::TH2M::createTH2MProcess ( std::string const & name,
MeshLib::Mesh & mesh,
std::unique_ptr< ProcessLib::AbstractJacobianAssembler > && jacobian_assembler,
std::vector< ProcessVariable > const & variables,
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const & parameters,
std::optional< ParameterLib::CoordinateSystem > const & local_coordinate_system,
unsigned const integration_order,
BaseLib::ConfigTree const & config,
std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const & media )
Input File Parameter
prj__processes__process__type
Input File Parameter
prj__processes__process__TH2M__coupling_scheme

Process Variables

Input File Parameter
prj__processes__process__TH2M__process_variables

Primary process variables as they appear in the global component vector:

Input File Parameter
prj__processes__process__TH2M__process_variables__gas_pressure
Input File Parameter
prj__processes__process__TH2M__process_variables__capillary_pressure
Input File Parameter
prj__processes__process__TH2M__process_variables__temperature
Input File Parameter
prj__processes__process__TH2M__process_variables__displacement

Process Parameters

Input File Parameter
prj__processes__process__TH2M__reference_temperature
Input File Parameter
prj__processes__process__TH2M__specific_body_force
Input File Parameter
prj__processes__process__TH2M__mass_lumping
Input File Parameter
prj__processes__process__linear
Input File Parameter
prj__processes__process__THERMO_RICHARDS_MECHANICS__initialize_porosity_from_medium_property

Definition at line 50 of file CreateTH2MProcess.cpp.

59{
61 config.checkConfigParameter("type", "TH2M");
62 DBUG("Create TH2M Process.");
63 DBUG(" ");
64
65 auto const coupling_scheme =
67 config.getConfigParameterOptional<std::string>("coupling_scheme");
68 const bool use_monolithic_scheme =
69 !(coupling_scheme && (*coupling_scheme == "staggered"));
70
72
74 auto const pv_config = config.getConfigSubtree("process_variables");
75
76 ProcessVariable* variable_pGR;
77 ProcessVariable* variable_pCap;
78 ProcessVariable* variable_T;
79 ProcessVariable* variable_u;
80 std::vector<std::vector<std::reference_wrapper<ProcessVariable>>>
81 process_variables;
82 if (use_monolithic_scheme) // monolithic scheme.
83 {
86 auto per_process_variables = findProcessVariables(
87 variables, pv_config,
88 {
89 "gas_pressure",
91 "capillary_pressure",
93 "temperature",
95 "displacement"});
96 variable_pGR = &per_process_variables[0].get();
97 variable_pCap = &per_process_variables[1].get();
98 variable_T = &per_process_variables[2].get();
99 variable_u = &per_process_variables[3].get();
100 process_variables.push_back(std::move(per_process_variables));
101 }
102 else // staggered scheme.
103 {
104 OGS_FATAL("A Staggered version of TH2M is not implemented.");
105
106 using namespace std::string_literals;
107 for (auto const& variable_name :
108 {"gas_pressure"s, "capillary_pressure"s, "temperature"s,
109 "displacement"s})
110 {
111 auto per_process_variables =
112 findProcessVariables(variables, pv_config, {variable_name});
113 process_variables.push_back(std::move(per_process_variables));
114 }
115 variable_pGR = &process_variables[0][0].get();
116 variable_pCap = &process_variables[1][0].get();
117 variable_T = &process_variables[2][0].get();
118 variable_u = &process_variables[3][0].get();
119 }
120
121 DBUG("Associate displacement with process variable '{:s}'.",
122 variable_u->getName());
123
124 if (variable_u->getNumberOfGlobalComponents() != DisplacementDim)
125 {
126 OGS_FATAL(
127 "Number of components of the process variable '{:s}' is different "
128 "from the displacement dimension: got {:d}, expected {:d}",
129 variable_u->getName(),
130 variable_u->getNumberOfGlobalComponents(),
131 DisplacementDim);
132 }
133
134 DBUG("Associate gas pressure with process variable '{:s}'.",
135 variable_pGR->getName());
136 if (variable_pGR->getNumberOfGlobalComponents() != 1)
137 {
138 OGS_FATAL(
139 "Gas pressure process variable '{:s}' is not a scalar variable but "
140 "has "
141 "{:d} components.",
142 variable_pGR->getName(),
143 variable_pGR->getNumberOfGlobalComponents());
144 }
145
146 DBUG("Associate capillary pressure with process variable '{:s}'.",
147 variable_pCap->getName());
148 if (variable_pCap->getNumberOfGlobalComponents() != 1)
149 {
150 OGS_FATAL(
151 "Capillary pressure process variable '{:s}' is not a scalar "
152 "variable but has "
153 "{:d} components.",
154 variable_pCap->getName(),
155 variable_pCap->getNumberOfGlobalComponents());
156 }
157
158 DBUG("Associate temperature with process variable '{:s}'.",
159 variable_T->getName());
160 if (variable_T->getNumberOfGlobalComponents() != 1)
161 {
162 OGS_FATAL(
163 "temperature process variable '{:s}' is not a scalar variable but "
164 "has {:d} components.",
165 variable_T->getName(),
166 variable_T->getNumberOfGlobalComponents());
167 }
168
170 auto solid_constitutive_relations =
172 parameters, local_coordinate_system, materialIDs(mesh), config);
173
174 // reference temperature
176 config,
178 "reference_temperature", parameters, 1, &mesh);
179 DBUG("Use '{:s}' as reference temperature parameter.",
181
182 // Specific body force
183 Eigen::Matrix<double, DisplacementDim, 1> specific_body_force;
184 {
185 std::vector<double> const b =
187 config.getConfigParameter<std::vector<double>>(
188 "specific_body_force");
189 if (b.size() != DisplacementDim)
190 {
191 OGS_FATAL(
192 "The size of the specific body force vector does not match the "
193 "displacement dimension. Vector size is {:d}, displacement "
194 "dimension is {:d}",
195 b.size(), DisplacementDim);
196 }
197
198 std::copy_n(b.data(), b.size(), specific_body_force.data());
199 }
200
201 // Initial stress conditions
203 config, parameters, mesh);
204
205 auto const mass_lumping =
207 config.getConfigParameter<bool>("mass_lumping", false);
208 auto const is_linear =
210 config.getConfigParameter("linear", false);
211
212 auto media_map =
214
215 auto phase_transition_model = createPhaseTransitionModel(media);
216
217 const bool use_TaylorHood_elements =
218 variable_pCap->getShapeFunctionOrder() !=
219 variable_u->getShapeFunctionOrder()
220 ? true
221 : false;
222 bool const initialize_porosity_from_medium_property =
224 config.getConfigParameter("initialize_porosity_from_medium_property",
225 true);
226
228 materialIDs(mesh),
229 std::move(media_map),
230 std::move(solid_constitutive_relations),
231 std::move(phase_transition_model),
233 std::move(initial_stress),
234 specific_body_force,
235 mass_lumping,
236 use_TaylorHood_elements,
238 initialize_porosity_from_medium_property}};
239
240 SecondaryVariableCollection secondary_variables;
241
242 ProcessLib::createSecondaryVariables(config, secondary_variables);
243
244 return std::make_unique<TH2MProcess<DisplacementDim>>(
245 std::move(name), mesh, std::move(jacobian_assembler), parameters,
246 integration_order, std::move(process_variables),
247 std::move(process_data), std::move(secondary_variables),
248 use_monolithic_scheme, is_linear);
249}
#define OGS_FATAL(...)
Definition Error.h:19
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:22
unsigned getShapeFunctionOrder() const
std::string const & getName() const
int getNumberOfGlobalComponents() const
Returns the number of components of the process variable.
std::map< int, std::shared_ptr< MaterialLib::Solids::MechanicsBase< DisplacementDim > > > createConstitutiveRelations(std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, MeshLib::PropertyVector< int > const *const material_ids, BaseLib::ConfigTree const &config)
MaterialSpatialDistributionMap createMaterialSpatialDistributionMap(std::map< int, std::shared_ptr< Medium > > const &media, MeshLib::Mesh const &mesh)
PropertyVector< int > const * materialIDs(Mesh const &mesh)
Definition Mesh.cpp:258
OGS_NO_DANGLING Parameter< ParameterDataType > & findParameter(std::string const &parameter_name, std::vector< std::unique_ptr< ParameterBase > > const &parameters, int const num_components, MeshLib::Mesh const *const mesh=nullptr)
std::unique_ptr< ConstitutiveRelations::PhaseTransitionModel > createPhaseTransitionModel(std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
BaseLib::StrongType< bool, struct InitializePorosityFromMediumPropertyTag > InitializePorosityFromMediumProperty
A type helping to avoid confusion of different boolean values.
std::vector< std::reference_wrapper< ProcessVariable > > findProcessVariables(std::vector< ProcessVariable > const &variables, BaseLib::ConfigTree const &pv_config, std::initializer_list< std::string > tags)
InitialStress createInitialStress(BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, MeshLib::Mesh const &mesh, bool const mandatory_stress_type)
void createSecondaryVariables(BaseLib::ConfigTree const &config, SecondaryVariableCollection &secondary_variables)

References BaseLib::ConfigTree::checkConfigParameter(), MaterialLib::Solids::createConstitutiveRelations(), ProcessLib::createInitialStress(), MaterialPropertyLib::createMaterialSpatialDistributionMap(), createPhaseTransitionModel(), ProcessLib::createSecondaryVariables(), DBUG(), ParameterLib::findParameter(), ProcessLib::findProcessVariables(), BaseLib::ConfigTree::getConfigParameter(), BaseLib::ConfigTree::getConfigParameterOptional(), BaseLib::ConfigTree::getConfigSubtree(), ProcessLib::ProcessVariable::getName(), ProcessLib::ProcessVariable::getNumberOfGlobalComponents(), ProcessLib::ProcessVariable::getShapeFunctionOrder(), and OGS_FATAL.

◆ createTH2MProcess< 2 >()

template std::unique_ptr< Process > ProcessLib::TH2M::createTH2MProcess< 2 > ( std::string const & name,
MeshLib::Mesh & mesh,
std::unique_ptr< ProcessLib::AbstractJacobianAssembler > && jacobian_assembler,
std::vector< ProcessVariable > const & variables,
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const & parameters,
std::optional< ParameterLib::CoordinateSystem > const & local_coordinate_system,
unsigned const integration_order,
BaseLib::ConfigTree const & config,
std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const & media )

◆ createTH2MProcess< 3 >()

template std::unique_ptr< Process > ProcessLib::TH2M::createTH2MProcess< 3 > ( std::string const & name,
MeshLib::Mesh & mesh,
std::unique_ptr< ProcessLib::AbstractJacobianAssembler > && jacobian_assembler,
std::vector< ProcessVariable > const & variables,
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const & parameters,
std::optional< ParameterLib::CoordinateSystem > const & local_coordinate_system,
unsigned const integration_order,
BaseLib::ConfigTree const & config,
std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const & media )