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);
47 required_liquid_properties);
50 required_solid_properties);
51 }
52}
void checkRequiredProperties(Component const &c, std::span< PropertyType const > const required_properties)
Definition Component.cpp:51

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

Referenced by createThermoRichardsFlowProcess().

◆ checkProcessVariableComponents()

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

Definition at line 54 of file CreateThermoRichardsFlowProcess.cpp.

55{
56 if (variable.getNumberOfGlobalComponents() != 1)
57 {
59 "Number of components of the process variable '{:s}' is different "
60 "from one: got {:d}.",
61 variable.getName(),
62 variable.getNumberOfGlobalComponents());
63 }
64}
#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 66 of file CreateThermoRichardsFlowProcess.cpp.

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