35namespace ThermoRichardsMechanics
38 std::map<
int, std::shared_ptr<MaterialPropertyLib::Medium>>
const& media)
40 std::array
const required_medium_properties = {
45 std::array
const required_liquid_properties = {
51 for (
auto const& m : media)
53 checkRequiredProperties(*m.second, required_medium_properties);
54 checkRequiredProperties(m.second->phase(
"AqueousLiquid"),
55 required_liquid_properties);
56 checkRequiredProperties(m.second->phase(
"Solid"),
57 required_solid_properties);
64 DBUG(
"Associate displacement with process variable '{:s}'.",
70 "Number of components of the process variable '{:s}' is different "
71 "from the displacement dimension: got {:d}, expected {:d}",
78template <
int DisplacementDim,
typename ConstitutiveTraits,
79 typename CreateConstitutiveSetting>
82 std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&& jacobian_assembler,
83 std::vector<ProcessVariable>
const& variables,
84 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>
const& parameters,
85 std::optional<ParameterLib::CoordinateSystem>
const&
86 local_coordinate_system,
88 std::map<
int, std::shared_ptr<MaterialPropertyLib::Medium>>
const& media,
89 bool const mandatory_stress0_type)
91 auto const coupling_scheme =
94 const bool use_monolithic_scheme =
95 !(coupling_scheme && (*coupling_scheme ==
"staggered"));
105 std::vector<std::vector<std::reference_wrapper<ProcessVariable>>>
107 if (use_monolithic_scheme)
112 variables, pv_config,
119 variable_T = &per_process_variables[0].get();
120 variable_p = &per_process_variables[1].get();
121 variable_u = &per_process_variables[2].get();
122 process_variables.push_back(std::move(per_process_variables));
127 "So far, only the monolithic scheme is implemented for "
128 "THERMO_RICHARDS_MECHANICS");
137 auto solid_constitutive_relations =
138 CreateConstitutiveSetting::createSolidConstitutiveRelations(
139 parameters, local_coordinate_system, config);
142 Eigen::Matrix<double, DisplacementDim, 1> specific_body_force;
144 std::vector<double>
const b =
147 "specific_body_force");
148 if (b.size() != DisplacementDim)
151 "The size of the specific body force vector does not match the "
152 "displacement dimension. Vector size is {:d}, displacement "
154 b.size(), DisplacementDim);
157 std::copy_n(b.data(), b.size(), specific_body_force.data());
163 "Check the media properties of ThermoRichardsMechanics process "
166 DBUG(
"Media properties verified.");
168 auto initial_stress = ProcessLib::createInitialStress<DisplacementDim>(
169 config, parameters, mesh, mandatory_stress0_type);
171 bool mass_lumping =
false;
172 if (
auto const mass_lumping_ptr =
176 DBUG(
"Using mass lumping for the Richards flow equation.");
177 mass_lumping = *mass_lumping_ptr;
180 bool const apply_body_force_for_deformation =
185 bool const initialize_porosity_from_medium_property =
190 const bool use_TaylorHood_elements =
197 process_data{materialIDs(mesh),
198 std::move(media_map),
199 std::move(solid_constitutive_relations),
200 std::move(initial_stress),
203 use_TaylorHood_elements,
204 apply_body_force_for_deformation,
206 initialize_porosity_from_medium_property}};
212 return std::make_unique<
214 name, mesh, std::move(jacobian_assembler), parameters,
215 integration_order, std::move(process_variables),
216 std::move(process_data), std::move(secondary_variables),
217 use_monolithic_scheme);
220template <
int DisplacementDim>
222 std::string
const& name,
224 std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&& jacobian_assembler,
225 std::vector<ProcessVariable>
const& variables,
226 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>
const& parameters,
227 std::optional<ParameterLib::CoordinateSystem>
const&
228 local_coordinate_system,
229 unsigned const integration_order,
231 std::map<
int, std::shared_ptr<MaterialPropertyLib::Medium>>
const& media)
235 DBUG(
"Create ThermoRichardsMechanicsProcess.");
240 "Stress_StrainTemperature");
241 INFO(
"TRM process subtype is '{}'", subtype);
243 if (subtype ==
"Stress_StrainTemperature")
245 bool const mandatory_stress0_type =
false;
251 DisplacementDim>>(name, mesh, std::move(jacobian_assembler),
252 variables, parameters,
253 local_coordinate_system, integration_order,
254 config, media, mandatory_stress0_type);
257 if (subtype ==
"StressSaturation_StrainPressureTemperature")
260 bool const mandatory_stress0_type =
true;
263 ConstitutiveStressSaturation_StrainPressureTemperature::
264 ConstitutiveTraits<DisplacementDim>,
265 ConstitutiveStressSaturation_StrainPressureTemperature::
266 CreateConstitutiveSetting<DisplacementDim>>(
267 name, mesh, std::move(jacobian_assembler), variables, parameters,
268 local_coordinate_system, integration_order, config, media,
269 mandatory_stress0_type);
272 "TRM process subtype 'StressSaturation_StrainPressureTemperature' "
273 "is not supported, because OGS has not been built with MFront.");
277 OGS_FATAL(
"Unknown TRM process subtype '{}'.", subtype);
281 std::string
const& name,
283 std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&& jacobian_assembler,
284 std::vector<ProcessVariable>
const& variables,
285 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>
const& parameters,
286 std::optional<ParameterLib::CoordinateSystem>
const&
287 local_coordinate_system,
288 unsigned const integration_order,
290 std::map<
int, std::shared_ptr<MaterialPropertyLib::Medium>>
const& media);
293 std::string
const& name,
295 std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&& jacobian_assembler,
296 std::vector<ProcessVariable>
const& variables,
297 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>
const& parameters,
298 std::optional<ParameterLib::CoordinateSystem>
const&
299 local_coordinate_system,
300 unsigned const integration_order,
302 std::map<
int, std::shared_ptr<MaterialPropertyLib::Medium>>
const& media);
void INFO(fmt::format_string< Args... > fmt, Args &&... args)
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
std::optional< T > getConfigParameterOptional(std::string const ¶m) const
T getConfigParameter(std::string const ¶m) const
ConfigTree getConfigSubtree(std::string const &root) const
void checkConfigParameter(std::string const ¶m, std::string_view const value) const
unsigned getShapeFunctionOrder() const
std::string const & getName() const
int getNumberOfGlobalComponents() const
Returns the number of components of the process variable.
Handles configuration of several secondary variables from the project file.
Global assembler for the monolithic scheme of the non-isothermal Richards flow coupled with mechanics...
MaterialSpatialDistributionMap createMaterialSpatialDistributionMap(std::map< int, std::shared_ptr< Medium > > const &media, MeshLib::Mesh const &mesh)
@ bishops_effective_stress
void checkMPLProperties(std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
std::unique_ptr< Process > createThermoRichardsMechanicsProcessStage2(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 ¶meters, 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, bool const mandatory_stress0_type)
void checkProcessVariableComponents(ProcessVariable const &variable, const int dim)
template std::unique_ptr< Process > createThermoRichardsMechanicsProcess< 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 ¶meters, 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< Process > createThermoRichardsMechanicsProcess< 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 ¶meters, 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)
std::unique_ptr< Process > createThermoRichardsMechanicsProcess(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 ¶meters, 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)
std::vector< std::reference_wrapper< ProcessVariable > > findProcessVariables(std::vector< ProcessVariable > const &variables, BaseLib::ConfigTree const &pv_config, std::initializer_list< std::string > tags)
void createSecondaryVariables(BaseLib::ConfigTree const &config, SecondaryVariableCollection &secondary_variables)