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 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  // meduim 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, Container const &required_properties)
Definition: Component.h:96

References MaterialPropertyLib::biot_coefficient, MaterialPropertyLib::checkRequiredProperties(), 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  {
63  OGS_FATAL(
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(char const *fmt, Args const &... args)
Definition: Logging.h:27

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

Referenced by createThermoRichardsFlowProcess().

◆ createThermoRichardsFlowProcess()

std::unique_ptr< Process > ProcessLib::ThermoRichardsFlow::createThermoRichardsFlowProcess ( std::string  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
Input File Parameter:
prj__processes__process__THERMO_RICHARDS_FLOW__process_variables
Input File Parameter:
prj__processes__process__THERMO_RICHARDS_FLOW__process_variables__temperature
Input File Parameter:
prj__processes__process__THERMO_RICHARDS_FLOW__process_variables__pressure
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 
91  // Process variable.
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  {
102  auto per_process_variables = findProcessVariables(
103  variables, pv_config,
104  {
105  "temperature",
107  "pressure"});
108  variable_T = &per_process_variables[0].get();
109  variable_p = &per_process_variables[1].get();
110  process_variables.push_back(std::move(per_process_variables));
111  }
112  else // staggered scheme.
113  {
114  OGS_FATAL(
115  "So far, only the monolithic scheme is implemented for "
116  "THERMO_RICHARDS_FLOW");
117  }
118 
119  checkProcessVariableComponents(*variable_T);
120  checkProcessVariableComponents(*variable_p);
121 
122  // Specific body force parameter.
123  Eigen::VectorXd specific_body_force;
124  {
125  std::vector<double> const b =
127  config.getConfigParameter<std::vector<double>>(
128  "specific_body_force");
129  if (b.size() != mesh.getDimension())
130  {
131  OGS_FATAL(
132  "specific body force (gravity vector) has {:d} components, "
133  "but mesh dimension is {:d}",
134  b.size(), mesh.getDimension());
135  }
136  specific_body_force.resize(b.size());
137  std::copy_n(b.data(), b.size(), specific_body_force.data());
138  }
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 
155  ThermoRichardsFlowProcessData process_data{
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);
168 }
unsigned getDimension() const
Returns the dimension of the mesh (determined by the maximum dimension over all elements).
Definition: Mesh.h:71
std::unique_ptr< MaterialSpatialDistributionMap > createMaterialSpatialDistributionMap(std::map< int, std::shared_ptr< Medium >> const &media, MeshLib::Mesh const &mesh)
void checkProcessVariableComponents(ProcessVariable const &variable)
void checkMPLProperties(std::map< int, std::shared_ptr< MaterialPropertyLib::Medium >> const &media)
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(), MaterialPropertyLib::name, and OGS_FATAL.

Referenced by ProjectData::parseProcesses().