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 33 of file CreateThermoRichardsFlowProcess.cpp.

35{
36 std::array const required_medium_properties = {
41 std::array const required_liquid_properties = {
44 };
45 std::array const required_solid_properties = {MaterialPropertyLib::density};
46
47 // Thermal properties are not checked because they can be phase property or
48 // medium property (will be enabled later).
49 for (auto const& m : media)
50 {
51 checkRequiredProperties(*m.second, required_medium_properties);
52 checkRequiredProperties(m.second->phase("AqueousLiquid"),
53 required_liquid_properties);
54 checkRequiredProperties(m.second->phase("Solid"),
55 required_solid_properties);
56 }
57}
void checkRequiredProperties(Component const &c, std::span< PropertyType const > const required_properties)
Definition Component.cpp:60

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 59 of file CreateThermoRichardsFlowProcess.cpp.

60{
61 if (variable.getNumberOfGlobalComponents() != 1)
62 {
64 "Number of components of the process variable '{:s}' is different "
65 "from one: got {:d}.",
66 variable.getName(),
67 variable.getNumberOfGlobalComponents());
68 }
69}
#define OGS_FATAL(...)
Definition Error.h:26

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 27 of file CreateSimplifiedElasticityModel.cpp.

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

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__THERMO_RICHARDS_FLOW__mass_lumping

Definition at line 71 of file CreateThermoRichardsFlowProcess.cpp.

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