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()
39 .numberOfComponents() > 1) &&
40 (media.begin()
42 .numberOfComponents() > 1);
43 // Only if both fluids consist of more than one component, the model
44 // phase_transition is returned.
45 if (phase_transition)
46 {
47 return std::make_unique<ConstitutiveRelations::PhaseTransition>(media);
48 }
49 return std::make_unique<ConstitutiveRelations::NoPhaseTransition>(media);
50}

References MaterialPropertyLib::AqueousLiquid, and MaterialPropertyLib::Gas.

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 53 of file CreateTH2MProcess.cpp.

62{
64 config.checkConfigParameter("type", "TH2M");
65 DBUG("Create TH2M Process.");
66 DBUG(" ");
67
68 auto const coupling_scheme =
70 config.getConfigParameterOptional<std::string>("coupling_scheme");
71 const bool use_monolithic_scheme =
72 !(coupling_scheme && (*coupling_scheme == "staggered"));
73
75
77 auto const pv_config = config.getConfigSubtree("process_variables");
78
79 ProcessVariable* variable_pGR;
80 ProcessVariable* variable_pCap;
81 ProcessVariable* variable_T;
82 ProcessVariable* variable_u;
83 std::vector<std::vector<std::reference_wrapper<ProcessVariable>>>
84 process_variables;
85 if (use_monolithic_scheme) // monolithic scheme.
86 {
89 auto per_process_variables = findProcessVariables(
90 variables, pv_config,
91 {
92 "gas_pressure",
94 "capillary_pressure",
96 "temperature",
98 "displacement"});
99 variable_pGR = &per_process_variables[0].get();
100 variable_pCap = &per_process_variables[1].get();
101 variable_T = &per_process_variables[2].get();
102 variable_u = &per_process_variables[3].get();
103 process_variables.push_back(std::move(per_process_variables));
104 }
105 else // staggered scheme.
106 {
107 OGS_FATAL("A Staggered version of TH2M is not implemented.");
108
109 using namespace std::string_literals;
110 for (auto const& variable_name :
111 {"gas_pressure"s, "capillary_pressure"s, "temperature"s,
112 "displacement"s})
113 {
114 auto per_process_variables =
115 findProcessVariables(variables, pv_config, {variable_name});
116 process_variables.push_back(std::move(per_process_variables));
117 }
118 variable_pGR = &process_variables[0][0].get();
119 variable_pCap = &process_variables[1][0].get();
120 variable_T = &process_variables[2][0].get();
121 variable_u = &process_variables[3][0].get();
122 }
123
124 DBUG("Associate displacement with process variable '{:s}'.",
125 variable_u->getName());
126
127 if (variable_u->getNumberOfGlobalComponents() != DisplacementDim)
128 {
129 OGS_FATAL(
130 "Number of components of the process variable '{:s}' is different "
131 "from the displacement dimension: got {:d}, expected {:d}",
132 variable_u->getName(),
133 variable_u->getNumberOfGlobalComponents(),
134 DisplacementDim);
135 }
136
137 DBUG("Associate gas pressure with process variable '{:s}'.",
138 variable_pGR->getName());
139 if (variable_pGR->getNumberOfGlobalComponents() != 1)
140 {
141 OGS_FATAL(
142 "Gas pressure process variable '{:s}' is not a scalar variable but "
143 "has "
144 "{:d} components.",
145 variable_pGR->getName(),
146 variable_pGR->getNumberOfGlobalComponents());
147 }
148
149 DBUG("Associate capillary pressure with process variable '{:s}'.",
150 variable_pCap->getName());
151 if (variable_pCap->getNumberOfGlobalComponents() != 1)
152 {
153 OGS_FATAL(
154 "Capillary pressure process variable '{:s}' is not a scalar "
155 "variable but has "
156 "{:d} components.",
157 variable_pCap->getName(),
158 variable_pCap->getNumberOfGlobalComponents());
159 }
160
161 DBUG("Associate temperature with process variable '{:s}'.",
162 variable_T->getName());
163 if (variable_T->getNumberOfGlobalComponents() != 1)
164 {
165 OGS_FATAL(
166 "temperature process variable '{:s}' is not a scalar variable but "
167 "has {:d} components.",
168 variable_T->getName(),
169 variable_T->getNumberOfGlobalComponents());
170 }
171
173 auto solid_constitutive_relations =
175 parameters, local_coordinate_system, materialIDs(mesh), config);
176
177 // reference temperature
179 config,
181 "reference_temperature", parameters, 1, &mesh);
182 DBUG("Use '{:s}' as reference temperature parameter.",
184
185 // Specific body force
186 Eigen::Matrix<double, DisplacementDim, 1> specific_body_force;
187 {
188 std::vector<double> const b =
190 config.getConfigParameter<std::vector<double>>(
191 "specific_body_force");
192 if (b.size() != DisplacementDim)
193 {
194 OGS_FATAL(
195 "The size of the specific body force vector does not match the "
196 "displacement dimension. Vector size is {:d}, displacement "
197 "dimension is {:d}",
198 b.size(), DisplacementDim);
199 }
200
201 std::copy_n(b.data(), b.size(), specific_body_force.data());
202 }
203
204 // Initial stress conditions
206 config, parameters, mesh);
207
208 auto const mass_lumping =
210 config.getConfigParameter<bool>("mass_lumping", false);
211 auto const is_linear =
213 config.getConfigParameter("linear", false);
214
215 auto media_map =
217
218 auto phase_transition_model = createPhaseTransitionModel(media);
219
220 const bool use_TaylorHood_elements =
221 variable_pCap->getShapeFunctionOrder() !=
222 variable_u->getShapeFunctionOrder()
223 ? true
224 : false;
225 bool const initialize_porosity_from_medium_property =
227 config.getConfigParameter("initialize_porosity_from_medium_property",
228 true);
229
231 materialIDs(mesh),
232 std::move(media_map),
233 std::move(solid_constitutive_relations),
234 std::move(phase_transition_model),
236 std::move(initial_stress),
237 specific_body_force,
238 mass_lumping,
239 use_TaylorHood_elements,
241 initialize_porosity_from_medium_property}};
242
243 SecondaryVariableCollection secondary_variables;
244
245 ProcessLib::createSecondaryVariables(config, secondary_variables);
246
247 return std::make_unique<TH2MProcess<DisplacementDim>>(
248 std::move(name), mesh, std::move(jacobian_assembler), parameters,
249 integration_order, std::move(process_variables),
250 std::move(process_data), std::move(secondary_variables),
251 use_monolithic_scheme, is_linear);
252}
#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 )