OGS
ProcessLib::ThermoRichardsFlow Namespace Reference

Classes

struct  HydrostaticElasticityModel
struct  IntegrationPointData
struct  LocalAssemblerInterface
struct  RigidElasticityModel
struct  SimplifiedElasticityModel
class  ThermoRichardsFlowLocalAssembler
class  ThermoRichardsFlowProcess
 Global assembler for the monolithic scheme of the non-isothermal Richards flow. More...
struct  ThermoRichardsFlowProcessData
struct  UniaxialElasticityModel
struct  UserDefinedElasticityModel

Functions

std::unique_ptr< SimplifiedElasticityModelcreateElasticityModel (BaseLib::ConfigTree const &config)
void checkMPLProperties (std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
void checkProcessVariableComponents (ProcessVariable const &variable)
std::unique_ptr< ProcesscreateThermoRichardsFlowProcess (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, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)

Function Documentation

◆ checkMPLProperties()

void ProcessLib::ThermoRichardsFlow::checkMPLProperties ( std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const & media)

Definition at line 26 of file CreateThermoRichardsFlowProcess.cpp.

28{
29 std::array const required_medium_properties = {
34 std::array const required_liquid_properties = {
37 };
38 std::array const required_solid_properties = {MaterialPropertyLib::density};
39
40 // Thermal properties are not checked because they can be phase property or
41 // medium property (will be enabled later).
42 for (auto const& m : media)
43 {
44 checkRequiredProperties(*m.second, required_medium_properties);
45 checkRequiredProperties(m.second->phase("AqueousLiquid"),
46 required_liquid_properties);
47 checkRequiredProperties(m.second->phase("Solid"),
48 required_solid_properties);
49 }
50}
void checkRequiredProperties(Component const &c, std::span< PropertyType const > const required_properties)
Definition Component.cpp:51

References MaterialPropertyLib::biot_coefficient, MaterialPropertyLib::density, MaterialPropertyLib::permeability, MaterialPropertyLib::porosity, MaterialPropertyLib::relative_permeability, MaterialPropertyLib::saturation, and MaterialPropertyLib::viscosity.

Referenced by createThermoRichardsFlowProcess().

◆ checkProcessVariableComponents()

void ProcessLib::ThermoRichardsFlow::checkProcessVariableComponents ( ProcessVariable const & variable)

Definition at line 52 of file CreateThermoRichardsFlowProcess.cpp.

53{
54 if (variable.getNumberOfGlobalComponents() != 1)
55 {
57 "Number of components of the process variable '{:s}' is different "
58 "from one: got {:d}.",
59 variable.getName(),
60 variable.getNumberOfGlobalComponents());
61 }
62}
#define OGS_FATAL(...)
Definition Error.h:19

References ProcessLib::ProcessVariable::getName(), ProcessLib::ProcessVariable::getNumberOfGlobalComponents(), and OGS_FATAL.

Referenced by createThermoRichardsFlowProcess().

◆ createElasticityModel()

std::unique_ptr< SimplifiedElasticityModel > ProcessLib::ThermoRichardsFlow::createElasticityModel ( BaseLib::ConfigTree const & config)
Input File Parameter
prj__processes__process__THERMO_RICHARDS_FLOW__simplified_elasticity

Definition at line 20 of file CreateSimplifiedElasticityModel.cpp.

22{
23 std::unique_ptr<SimplifiedElasticityModel> simplified_elasticity =
24 std::make_unique<RigidElasticityModel>();
25 if (auto const simplified_elasticity_switch =
27 config.getConfigParameterOptional<std::string>("simplified_elasticity"))
28 {
29 DBUG("Using simplified_elasticity for the Richards flow equation");
30 if (*simplified_elasticity_switch == "uniaxial")
31 {
32 DBUG("assuming local uniaxial deformation only.");
33 simplified_elasticity = std::make_unique<UniaxialElasticityModel>();
34 }
35 else if (*simplified_elasticity_switch == "hydrostatic")
36 {
37 DBUG("assuming constant hydrostatic stress locally.");
38 simplified_elasticity =
39 std::make_unique<HydrostaticElasticityModel>();
40 }
41 else if (*simplified_elasticity_switch == "user_defined")
42 {
43 DBUG("using user defined elasticity model.");
44 simplified_elasticity =
45 std::make_unique<UserDefinedElasticityModel>();
46 }
47 else if (*simplified_elasticity_switch == "rigid")
48 {
49 DBUG("using user defined elasticity model.");
50 simplified_elasticity = std::make_unique<RigidElasticityModel>();
51 }
52 }
53 return simplified_elasticity;
54}
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:22

References DBUG(), and BaseLib::ConfigTree::getConfigParameterOptional().

Referenced by createThermoRichardsFlowProcess().

◆ createThermoRichardsFlowProcess()

std::unique_ptr< Process > ProcessLib::ThermoRichardsFlow::createThermoRichardsFlowProcess ( 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,
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__THERMO_RICHARDS_FLOW__coupling_scheme

Process Variables

Input File Parameter
prj__processes__process__THERMO_RICHARDS_FLOW__process_variables

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

Input File Parameter
prj__processes__process__THERMO_RICHARDS_FLOW__process_variables__temperature
Input File Parameter
prj__processes__process__THERMO_RICHARDS_FLOW__process_variables__pressure

Process Parameters

Input File Parameter
prj__processes__process__THERMO_RICHARDS_FLOW__specific_body_force
Input File Parameter
prj__processes__process__linear
Input File Parameter
prj__processes__process__THERMO_RICHARDS_FLOW__mass_lumping

Definition at line 64 of file CreateThermoRichardsFlowProcess.cpp.

73{
75 config.checkConfigParameter("type", "THERMO_RICHARDS_FLOW");
76 DBUG("Create ThermoRichardsFlowProcess.");
77
78 auto const coupling_scheme =
80 config.getConfigParameterOptional<std::string>("coupling_scheme");
81 const bool use_monolithic_scheme =
82 !(coupling_scheme && (*coupling_scheme == "staggered"));
83
85
87 auto const pv_config = config.getConfigSubtree("process_variables");
88
89 ProcessVariable* variable_T;
90 ProcessVariable* variable_p;
91 std::vector<std::vector<std::reference_wrapper<ProcessVariable>>>
92 process_variables;
93 if (use_monolithic_scheme) // monolithic scheme.
94 {
97 auto per_process_variables = findProcessVariables(
98 variables, pv_config,
99 {
100 "temperature",
102 "pressure"});
103 variable_T = &per_process_variables[0].get();
104 variable_p = &per_process_variables[1].get();
105 process_variables.push_back(std::move(per_process_variables));
106 }
107 else // staggered scheme.
108 {
109 OGS_FATAL(
110 "So far, only the monolithic scheme is implemented for "
111 "THERMO_RICHARDS_FLOW");
112 }
113
116
118 // Specific body force parameter.
119 Eigen::VectorXd specific_body_force;
120 {
121 std::vector<double> const b =
123 config.getConfigParameter<std::vector<double>>(
124 "specific_body_force");
125 if (b.size() != mesh.getDimension())
126 {
127 OGS_FATAL(
128 "specific body force (gravity vector) has {:d} components, "
129 "but mesh dimension is {:d}",
130 b.size(), mesh.getDimension());
131 }
132 specific_body_force.resize(b.size());
133 std::copy_n(b.data(), b.size(), specific_body_force.data());
134 }
135
136 auto const is_linear =
138 config.getConfigParameter("linear", false);
139
140 auto media_map =
142 DBUG(
143 "Check the media properties of ThermoRichardsFlow process "
144 "...");
145 checkMPLProperties(media);
146 DBUG("Media properties verified.");
147
148 bool const mass_lumping =
150 config.getConfigParameter<bool>("mass_lumping", false);
151
152 std::unique_ptr<SimplifiedElasticityModel> simplified_elasticity =
153 createElasticityModel(config);
154
156 std::move(media_map), std::move(specific_body_force), mass_lumping,
157 std::move(simplified_elasticity)};
158
159 SecondaryVariableCollection secondary_variables;
160
161 ProcessLib::createSecondaryVariables(config, secondary_variables);
162
163 return std::make_unique<ThermoRichardsFlowProcess>(
164 std::move(name), mesh, std::move(jacobian_assembler), parameters,
165 integration_order, std::move(process_variables),
166 std::move(process_data), std::move(secondary_variables),
167 use_monolithic_scheme, is_linear);
168}
unsigned getDimension() const
Returns the dimension of the mesh (determined by the maximum dimension over all elements).
Definition Mesh.h:79
MaterialSpatialDistributionMap createMaterialSpatialDistributionMap(std::map< int, std::shared_ptr< Medium > > const &media, MeshLib::Mesh const &mesh)
void checkMPLProperties(std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
void checkProcessVariableComponents(ProcessVariable const &variable)
std::unique_ptr< SimplifiedElasticityModel > createElasticityModel(BaseLib::ConfigTree const &config)
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)

References BaseLib::ConfigTree::checkConfigParameter(), checkMPLProperties(), checkProcessVariableComponents(), createElasticityModel(), MaterialPropertyLib::createMaterialSpatialDistributionMap(), ProcessLib::createSecondaryVariables(), DBUG(), ProcessLib::findProcessVariables(), BaseLib::ConfigTree::getConfigParameter(), BaseLib::ConfigTree::getConfigParameterOptional(), BaseLib::ConfigTree::getConfigSubtree(), MeshLib::Mesh::getDimension(), and OGS_FATAL.

Referenced by ProjectData::parseProcesses().