OGS
ProcessLib::ThermoRichardsMechanics Namespace Reference

Namespaces

 detail
 

Classes

struct  IntegrationPointData
 
struct  LocalAssemblerInterface
 
class  LocalDataInitializer
 
struct  SecondaryData
 
class  ThermoRichardsMechanicsLocalAssembler
 
class  ThermoRichardsMechanicsProcess
 Global assembler for the monolithic scheme of the non-isothermal Richards flow coupled with mechanics. More...
 
struct  ThermoRichardsMechanicsProcessData
 

Functions

template<int GlobalDim, template< typename, typename, typename, int > class LocalAssemblerImplementation, typename LocalAssemblerInterface , typename... ExtraCtorArgs>
void createLocalAssemblers (const unsigned, std::vector< MeshLib::Element * > const &mesh_elements, NumLib::LocalToGlobalIndexMap const &dof_table, const unsigned shapefunction_order, std::vector< std::unique_ptr< LocalAssemblerInterface >> &local_assemblers, ExtraCtorArgs &&... extra_ctor_args)
 
void checkMPLProperties (std::map< int, std::shared_ptr< MaterialPropertyLib::Medium >> const &media)
 
void checkProcessVariableComponents (ProcessVariable const &variable, const int dim)
 
template<int DisplacementDim>
std::unique_ptr< ProcesscreateThermoRichardsMechanicsProcess (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, 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< ProcesscreateThermoRichardsMechanicsProcess< 2 > (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, 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< ProcesscreateThermoRichardsMechanicsProcess< 3 > (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, 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)
 

Function Documentation

◆ checkMPLProperties()

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

Definition at line 30 of file CreateThermoRichardsMechanicsProcess.cpp.

32 {
33  std::array const required_medium_properties = {
38  std::array const required_liquid_properties = {
40  std::array const required_solid_properties = {MaterialPropertyLib::density};
41 
42  // Thermal properties are not checked because they can be phase property or
43  // meduim property (will be enabled later).
44  for (auto const& m : media)
45  {
46  checkRequiredProperties(*m.second, required_medium_properties);
47  checkRequiredProperties(m.second->phase("AqueousLiquid"),
48  required_liquid_properties);
49  checkRequiredProperties(m.second->phase("Solid"),
50  required_solid_properties);
51  }
52 }
void checkRequiredProperties(Component const &c, Container const &required_properties)
Definition: Component.h:96

References MaterialPropertyLib::biot_coefficient, MaterialPropertyLib::bishops_effective_stress, MaterialPropertyLib::checkRequiredProperties(), MaterialPropertyLib::density, MaterialPropertyLib::porosity, MaterialPropertyLib::relative_permeability, MaterialPropertyLib::saturation, and MaterialPropertyLib::viscosity.

Referenced by createThermoRichardsMechanicsProcess().

◆ checkProcessVariableComponents()

void ProcessLib::ThermoRichardsMechanics::checkProcessVariableComponents ( ProcessVariable const &  variable,
const int  dim 
)

Definition at line 54 of file CreateThermoRichardsMechanicsProcess.cpp.

56 {
57  DBUG("Associate displacement with process variable '{:s}'.",
58  variable.getName());
59 
60  if (variable.getNumberOfGlobalComponents() != dim)
61  {
62  OGS_FATAL(
63  "Number of components of the process variable '{:s}' is different "
64  "from the displacement dimension: got {:d}, expected {:d}",
65  variable.getName(),
66  variable.getNumberOfGlobalComponents(),
67  dim);
68  }
69 }
#define OGS_FATAL(...)
Definition: Error.h:26
void DBUG(char const *fmt, Args const &... args)
Definition: Logging.h:27

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

Referenced by createThermoRichardsMechanicsProcess().

◆ createLocalAssemblers()

template<int GlobalDim, template< typename, typename, typename, int > class LocalAssemblerImplementation, typename LocalAssemblerInterface , typename... ExtraCtorArgs>
void ProcessLib::ThermoRichardsMechanics::createLocalAssemblers ( const unsigned  ,
std::vector< MeshLib::Element * > const &  mesh_elements,
NumLib::LocalToGlobalIndexMap const &  dof_table,
const unsigned  shapefunction_order,
std::vector< std::unique_ptr< LocalAssemblerInterface >> &  local_assemblers,
ExtraCtorArgs &&...  extra_ctor_args 
)

Creates local assemblers for each element of the given mesh.

Template Parameters
LocalAssemblerImplementationthe individual local assembler type
LocalAssemblerInterfacethe general local assembler interface
ExtraCtorArgstypes of additional constructor arguments. Those arguments will be passed to the constructor of LocalAssemblerImplementation.

The first two template parameters cannot be deduced from the arguments. Therefore they always have to be provided manually.

Definition at line 68 of file CreateLocalAssemblers.h.

75 {
76  DBUG("Create local assemblers.");
77 
78  detail::createLocalAssemblers<GlobalDim, LocalAssemblerImplementation>(
79  dof_table, shapefunction_order, mesh_elements, local_assemblers,
80  std::forward<ExtraCtorArgs>(extra_ctor_args)...);
81 }

References DBUG().

Referenced by ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsProcess< DisplacementDim >::initializeConcreteProcess().

◆ createThermoRichardsMechanicsProcess()

template<int DisplacementDim>
std::unique_ptr< Process > ProcessLib::ThermoRichardsMechanics::createThermoRichardsMechanicsProcess ( 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,
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 
)
Input File Parameter:
prj__processes__process__type
Input File Parameter:
prj__processes__process__THERMO_RICHARDS_MECHANICS__coupling_scheme
Input File Parameter:
prj__processes__process__THERMO_RICHARDS_MECHANICS__process_variables
Input File Parameter:
prj__processes__process__THERMO_RICHARDS_MECHANICS__process_variables__temperature
Input File Parameter:
prj__processes__process__THERMO_RICHARDS_MECHANICS__process_variables__pressure
Input File Parameter:
prj__processes__process__THERMO_RICHARDS_MECHANICS__process_variables__displacement
Input File Parameter:
prj__processes__process__THERMO_RICHARDS_MECHANICS__specific_body_force
Input File Parameter:
prj__processes__process__THERMO_RICHARDS_MECHANICS__initial_stress
Input File Parameter:
prj__processes__process__THERMO_RICHARDS_MECHANICS__mass_lumping

Definition at line 72 of file CreateThermoRichardsMechanicsProcess.cpp.

83 {
85  config.checkConfigParameter("type", "THERMO_RICHARDS_MECHANICS");
86  DBUG("Create ThermoRichardsMechanicsProcess.");
87 
88  auto const coupling_scheme =
90  config.getConfigParameterOptional<std::string>("coupling_scheme");
91  const bool use_monolithic_scheme =
92  !(coupling_scheme && (*coupling_scheme == "staggered"));
93 
94  // Process variable.
95 
97  auto const pv_config = config.getConfigSubtree("process_variables");
98 
99  ProcessVariable* variable_T;
100  ProcessVariable* variable_p;
101  ProcessVariable* variable_u;
102  std::vector<std::vector<std::reference_wrapper<ProcessVariable>>>
103  process_variables;
104  if (use_monolithic_scheme) // monolithic scheme.
105  {
106  auto per_process_variables = findProcessVariables(
107  variables, pv_config,
108  {
109  "temperature",
111  "pressure",
113  "displacement"});
114  variable_T = &per_process_variables[0].get();
115  variable_p = &per_process_variables[1].get();
116  variable_u = &per_process_variables[2].get();
117  process_variables.push_back(std::move(per_process_variables));
118  }
119  else // staggered scheme.
120  {
121  OGS_FATAL(
122  "So far, only the monolithic scheme is implemented for "
123  "THERMO_RICHARDS_MECHANICS");
124  }
125 
126  checkProcessVariableComponents(*variable_T, 1);
127  checkProcessVariableComponents(*variable_p, 1);
128  checkProcessVariableComponents(*variable_u, DisplacementDim);
129 
130  auto solid_constitutive_relations =
131  MaterialLib::Solids::createConstitutiveRelations<DisplacementDim>(
132  parameters, local_coordinate_system, config);
133 
134  // Specific body force
135  Eigen::Matrix<double, DisplacementDim, 1> specific_body_force;
136  {
137  std::vector<double> const b =
139  config.getConfigParameter<std::vector<double>>(
140  "specific_body_force");
141  if (b.size() != DisplacementDim)
142  {
143  OGS_FATAL(
144  "The size of the specific body force vector does not match the "
145  "displacement dimension. Vector size is {:d}, displacement "
146  "dimension is {:d}",
147  b.size(), DisplacementDim);
148  }
149 
150  std::copy_n(b.data(), b.size(), specific_body_force.data());
151  }
152 
153  auto media_map =
155  DBUG(
156  "Check the media properties of ThermoRichardsMechanics process "
157  "...");
158  checkMPLProperties(media);
159  DBUG("Media properties verified.");
160 
161  // Initial stress conditions
162  auto const initial_stress = ParameterLib::findOptionalTagParameter<double>(
164  config, "initial_stress", parameters,
165  // Symmetric tensor size, 4 or 6, not a Kelvin vector.
167  &mesh);
168 
169  bool mass_lumping = false;
170  if (auto const mass_lumping_ptr =
172  config.getConfigParameterOptional<bool>("mass_lumping"))
173  {
174  DBUG("Using mass lumping for the Richards flow equation.");
175  mass_lumping = *mass_lumping_ptr;
176  }
177 
178  ThermoRichardsMechanicsProcessData<DisplacementDim> process_data{
179  materialIDs(mesh),
180  std::move(media_map),
181  std::move(solid_constitutive_relations),
182  initial_stress,
183  specific_body_force,
184  mass_lumping};
185 
186  SecondaryVariableCollection secondary_variables;
187 
188  ProcessLib::createSecondaryVariables(config, secondary_variables);
189 
190  return std::make_unique<ThermoRichardsMechanicsProcess<DisplacementDim>>(
191  std::move(name), mesh, std::move(jacobian_assembler), parameters,
192  integration_order, std::move(process_variables),
193  std::move(process_data), std::move(secondary_variables),
194  use_monolithic_scheme);
195 }
std::unique_ptr< MaterialSpatialDistributionMap > createMaterialSpatialDistributionMap(std::map< int, std::shared_ptr< Medium >> const &media, MeshLib::Mesh const &mesh)
constexpr int kelvin_vector_dimensions(int const displacement_dim)
Kelvin vector dimensions for given displacement dimension.
Definition: KelvinVector.h:23
PropertyVector< int > const * materialIDs(Mesh const &mesh)
Definition: Mesh.cpp:258
void checkProcessVariableComponents(ProcessVariable const &variable, const int dim)
void checkMPLProperties(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)

References BaseLib::ConfigTree::checkConfigParameter(), checkMPLProperties(), checkProcessVariableComponents(), MaterialPropertyLib::createMaterialSpatialDistributionMap(), ProcessLib::createSecondaryVariables(), DBUG(), ProcessLib::findProcessVariables(), BaseLib::ConfigTree::getConfigParameter(), BaseLib::ConfigTree::getConfigParameterOptional(), BaseLib::ConfigTree::getConfigSubtree(), MathLib::KelvinVector::kelvin_vector_dimensions(), MeshLib::materialIDs(), MaterialPropertyLib::name, and OGS_FATAL.

◆ createThermoRichardsMechanicsProcess< 2 >()

template std::unique_ptr< Process > ProcessLib::ThermoRichardsMechanics::createThermoRichardsMechanicsProcess< 2 > ( 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,
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 
)

◆ createThermoRichardsMechanicsProcess< 3 >()

template std::unique_ptr< Process > ProcessLib::ThermoRichardsMechanics::createThermoRichardsMechanicsProcess< 3 > ( 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,
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 
)