OGS
ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsProcess< DisplacementDim > Class Template Referencefinal

Detailed Description

template<int DisplacementDim>
class ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsProcess< DisplacementDim >

Global assembler for the monolithic scheme of the non-isothermal Richards flow coupled with mechanics.

Governing equations without vapor diffusion

The energy balance equation is given by

\[ (\rho c_p)^{eff}\dot T - \nabla (\mathbf{k}_T^{eff} \nabla T)+\rho^l c_p^l \nabla T \cdot \mathbf{v}^l = Q_T \]

with \(T\) the temperature, \((\rho c_p)^{eff}\) the effective volumetric heat capacity, \(\mathbf{k}_T^{eff} \) the effective thermal conductivity, \(\rho^l\) the density of liquid, \(c_p^l\) the specific heat capacity of liquid, \(\mathbf{v}^l\) the liquid velocity, and \(Q_T\) the point heat source. The effective volumetric heat can be considered as a composite of the contributions of solid phase and the liquid phase as

\[ (\rho c_p)^{eff} = (1-\phi) \rho^s c_p^s + S^l \phi \rho^l c_p^l \]

with \(\phi\) the porosity, \(S^l\) the liquid saturation, \(\rho^s \) the solid density, and \(c_p^s\) the specific heat capacity of solid. Similarly, the effective thermal conductivity is given by

\[ \mathbf{k}_T^{eff} = (1-\phi) \mathbf{k}_T^s + S^l \phi k_T^l \mathbf I \]

where \(\mathbf{k}_T^s\) is the thermal conductivity tensor of solid, \( k_T^l\) is the thermal conductivity of liquid, and \(\mathbf I\) is the identity tensor.

The mass balance equation is given by

\begin{eqnarray*} \left(S^l\beta - \phi\frac{\partial S}{\partial p_c}\right) \rho^l\dot p - S \left( \frac{\partial \rho^l}{\partial T} +\rho^l(\alpha_B -S) \alpha_T^s \right)\dot T\\ +\nabla (\rho^l \mathbf{v}^l) + S \alpha_B \rho^l \nabla \cdot \dot {\mathbf u}= Q_H \end{eqnarray*}

where \(p\) is the pore pressure, \(p_c\) is the capillary pressure, which is \(-p\) under the single phase assumption, \(\beta\) is a composite coefficient by the liquid compressibility and solid compressibility, \(\alpha_B\) is the Biot's constant, \(\alpha_T^s\) is the linear thermal expansivity of solid, \(Q_H\) is the point source or sink term, \( \mathbf u\) is the displacement, and \(H(S-1)\) is the Heaviside function. The liquid velocity \(\mathbf{v}^l\) is described by the Darcy's law as

\[ \mathbf{v}^l=-\frac{{\mathbf k} k_{ref}}{\mu} (\nabla p - \rho^l \mathbf g) \]

with \({\mathbf k}\) the intrinsic permeability, \(k_{ref}\) the relative permeability, \(\mathbf g\) the gravitational force.

The momentum balance equation takes the form of

\[ \nabla (\mathbf{\sigma}-b(S)\alpha_B p^l \mathbf I) +\mathbf f=0 \]

with \(\mathbf{\sigma}\) the effective stress tensor, \(b(S)\) the Bishop model, \(\mathbf f\) the body force, and \(\mathbf I\) the identity. The primary unknowns of the momentum balance equation are the displacement \(\mathbf u\), which is associated with the stress by the the generalized Hook's law as

\[ {\dot {\mathbf {\sigma}}} = C {\dot {\mathbf \epsilon}}^e = C ( {\dot {\mathbf \epsilon}} - {\dot {\mathbf \epsilon}}^T -{\dot {\mathbf \epsilon}}^p - {\dot {\mathbf \epsilon}}^{sw}-\cdots ) \]

with \(C\) the forth order elastic tensor, \({\dot {\mathbf \epsilon}}\) the total strain rate, \({\dot {\mathbf \epsilon}}^e\) the elastic strain rate, \({\dot {\mathbf \epsilon}}^T\) the thermal strain rate, \({\dot {\mathbf \epsilon}}^p\) the plastic strain rate, \({\dot {\mathbf \epsilon}}^{sw}\) the swelling strain rate.

The strain tensor is given by displacement vector as

\[ \mathbf \epsilon = \frac{1}{2} \left((\nabla \mathbf u)^{\text T}+\nabla \mathbf u\right) \]

where the superscript \({\text T}\) means transpose,

Definition at line 109 of file ThermoRichardsMechanicsProcess.h.

#include <ThermoRichardsMechanicsProcess.h>

Inheritance diagram for ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsProcess< DisplacementDim >:
[legend]
Collaboration diagram for ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsProcess< DisplacementDim >:
[legend]

Public Member Functions

 ThermoRichardsMechanicsProcess (std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters, unsigned const integration_order, std::vector< std::vector< std::reference_wrapper< ProcessVariable >>> &&process_variables, ThermoRichardsMechanicsProcessData< DisplacementDim > &&process_data, SecondaryVariableCollection &&secondary_variables, bool const use_monolithic_scheme)
 
MathLib::MatrixSpecifications getMatrixSpecifications (const int process_id) const override
 
ODESystem interface
bool isLinear () const override
 
- Public Member Functions inherited from ProcessLib::Process
 Process (std::string name_, MeshLib::Mesh &mesh, std::unique_ptr< AbstractJacobianAssembler > &&jacobian_assembler, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters, unsigned const integration_order, std::vector< std::vector< std::reference_wrapper< ProcessVariable >>> &&process_variables, SecondaryVariableCollection &&secondary_variables, const bool use_monolithic_scheme=true)
 
void preTimestep (std::vector< GlobalVector * > const &x, const double t, const double delta_t, const int process_id)
 Preprocessing before starting assembly for new timestep. More...
 
void postTimestep (std::vector< GlobalVector * > const &x, const double t, const double delta_t, int const process_id)
 Postprocessing after a complete timestep. More...
 
void postNonLinearSolver (GlobalVector const &x, GlobalVector const &xdot, const double t, double const dt, int const process_id)
 
void preIteration (const unsigned iter, GlobalVector const &x) final
 
void computeSecondaryVariable (double const t, double const dt, std::vector< GlobalVector * > const &x, GlobalVector const &x_dot, int const process_id)
 compute secondary variables for the coupled equations or for output. More...
 
NumLib::IterationResult postIteration (GlobalVector const &x) final
 
void initialize ()
 
void setInitialConditions (std::vector< GlobalVector * > &process_solutions, std::vector< GlobalVector * > const &process_solutions_prev, double const t, int const process_id)
 
MathLib::MatrixSpecifications getMatrixSpecifications (const int process_id) const override
 
void setCoupledSolutionsForStaggeredScheme (CoupledSolutionsForStaggeredScheme *const coupled_solutions)
 
void updateDeactivatedSubdomains (double const time, const int process_id)
 
bool isMonolithicSchemeUsed () const
 
virtual void setCoupledTermForTheStaggeredSchemeToLocalAssemblers (int const)
 
virtual void extrapolateIntegrationPointValuesToNodes (const double, std::vector< GlobalVector * > const &, std::vector< GlobalVector * > &)
 
void preAssemble (const double t, double const dt, GlobalVector const &x) final
 
void assemble (const double t, double const dt, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &xdot, int const process_id, GlobalMatrix &M, GlobalMatrix &K, GlobalVector &b) final
 
void assembleWithJacobian (const double t, double const dt, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &xdot, const double dxdot_dx, const double dx_dx, int const process_id, GlobalMatrix &M, GlobalMatrix &K, GlobalVector &b, GlobalMatrix &Jac) final
 
std::vector< NumLib::IndexValueVector< GlobalIndexType > > const * getKnownSolutions (double const t, GlobalVector const &x, int const process_id) const final
 
MeshLib::MeshgetMesh () const
 
std::vector< std::reference_wrapper< ProcessVariable > > const & getProcessVariables (const int process_id) const
 
SecondaryVariableCollection const & getSecondaryVariables () const
 
std::vector< std::unique_ptr< IntegrationPointWriter > > const * getIntegrationPointWriter (MeshLib::Mesh const &mesh) const
 
virtual Eigen::Vector3d getFlux (std::size_t, MathLib::Point3d const &, double const, std::vector< GlobalVector * > const &) const
 
virtual void solveReactionEquation (std::vector< GlobalVector * > &, std::vector< GlobalVector * > const &, double const, double const, NumLib::EquationSystem &, int const)
 

Private Types

using LocalAssemblerIF = LocalAssemblerInterface< DisplacementDim >
 

Private Member Functions

void constructDofTable () override
 
void initializeConcreteProcess (NumLib::LocalToGlobalIndexMap const &dof_table, MeshLib::Mesh const &mesh, unsigned const integration_order) override
 Process specific initialization called by initialize(). More...
 
void initializeBoundaryConditions () override
 
void setInitialConditionsConcreteProcess (std::vector< GlobalVector * > &x, double const t, int const process_id) override
 
void assembleConcreteProcess (const double t, double const dt, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &xdot, int const process_id, GlobalMatrix &M, GlobalMatrix &K, GlobalVector &b) override
 
void assembleWithJacobianConcreteProcess (const double t, double const dt, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &xdot, const double dxdot_dx, const double dx_dx, int const process_id, GlobalMatrix &M, GlobalMatrix &K, GlobalVector &b, GlobalMatrix &Jac) override
 
void postTimestepConcreteProcess (std::vector< GlobalVector * > const &x, double const t, double const dt, const int process_id) override
 
NumLib::LocalToGlobalIndexMap const & getDOFTable (const int process_id) const override
 
void computeSecondaryVariableConcrete (double const t, double const dt, std::vector< GlobalVector * > const &x, GlobalVector const &x_dot, int const process_id) override
 
std::tuple< NumLib::LocalToGlobalIndexMap *, bool > getDOFTableForExtrapolatorData () const override
 
std::vector< NumLib::LocalToGlobalIndexMap const * > getDOFTables (const int number_of_processes) const
 
bool hasMechanicalProcess (int const) const
 

Private Attributes

std::vector< MeshLib::Node * > base_nodes_
 
std::unique_ptr< MeshLib::MeshSubset const > mesh_subset_base_nodes_
 
ThermoRichardsMechanicsProcessData< DisplacementDim > process_data_
 
std::vector< std::unique_ptr< LocalAssemblerIF > > local_assemblers_
 
std::unique_ptr< NumLib::LocalToGlobalIndexMaplocal_to_global_index_map_single_component_
 
std::unique_ptr< NumLib::LocalToGlobalIndexMaplocal_to_global_index_map_with_base_nodes_
 
GlobalSparsityPattern sparsity_pattern_with_linear_element_
 
MeshLib::PropertyVector< double > * nodal_forces_ = nullptr
 
MeshLib::PropertyVector< double > * hydraulic_flow_ = nullptr
 
MeshLib::PropertyVector< double > * heat_flux_ = nullptr
 

Additional Inherited Members

- Public Types inherited from ProcessLib::Process
using NonlinearSolver = NumLib::NonlinearSolverBase
 
using TimeDiscretization = NumLib::TimeDiscretization
 
- Public Attributes inherited from ProcessLib::Process
std::string const name
 
- Protected Member Functions inherited from ProcessLib::Process
NumLib::ExtrapolatorgetExtrapolator () const
 
NumLib::LocalToGlobalIndexMap const & getSingleComponentDOFTable () const
 
void initializeProcessBoundaryConditionsAndSourceTerms (const NumLib::LocalToGlobalIndexMap &dof_table, const int process_id)
 
void constructMonolithicProcessDofTable ()
 
void constructDofTableOfSpecifiedProcessStaggeredScheme (const int specified_prosess_id)
 
- Protected Attributes inherited from ProcessLib::Process
MeshLib::Mesh_mesh
 
std::unique_ptr< MeshLib::MeshSubset const > _mesh_subset_all_nodes
 
std::unique_ptr< NumLib::LocalToGlobalIndexMap_local_to_global_index_map
 
SecondaryVariableCollection _secondary_variables
 
VectorMatrixAssembler _global_assembler
 
const bool _use_monolithic_scheme
 
CoupledSolutionsForStaggeredScheme_coupled_solutions
 
unsigned const _integration_order
 
std::vector< std::unique_ptr< IntegrationPointWriter > > _integration_point_writer
 
GlobalSparsityPattern _sparsity_pattern
 
std::vector< std::vector< std::reference_wrapper< ProcessVariable > > > _process_variables
 
std::vector< BoundaryConditionCollection_boundary_conditions
 

Member Typedef Documentation

◆ LocalAssemblerIF

template<int DisplacementDim>
using ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsProcess< DisplacementDim >::LocalAssemblerIF = LocalAssemblerInterface<DisplacementDim>
private

Definition at line 148 of file ThermoRichardsMechanicsProcess.h.

Constructor & Destructor Documentation

◆ ThermoRichardsMechanicsProcess()

template<int DisplacementDim>
ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsProcess< DisplacementDim >::ThermoRichardsMechanicsProcess ( std::string  name,
MeshLib::Mesh mesh,
std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&  jacobian_assembler,
std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &  parameters,
unsigned const  integration_order,
std::vector< std::vector< std::reference_wrapper< ProcessVariable >>> &&  process_variables,
ThermoRichardsMechanicsProcessData< DisplacementDim > &&  process_data,
SecondaryVariableCollection &&  secondary_variables,
bool const  use_monolithic_scheme 
)

Definition at line 28 of file ThermoRichardsMechanicsProcess.cpp.

39  : Process(std::move(name), mesh, std::move(jacobian_assembler), parameters,
40  integration_order, std::move(process_variables),
41  std::move(secondary_variables), use_monolithic_scheme),
42  process_data_(std::move(process_data))
43 {
44  nodal_forces_ = MeshLib::getOrCreateMeshProperty<double>(
45  mesh, "NodalForces", MeshLib::MeshItemType::Node, DisplacementDim);
46 
47  hydraulic_flow_ = MeshLib::getOrCreateMeshProperty<double>(
48  mesh, "HydraulicFlow", MeshLib::MeshItemType::Node, 1);
49 
50  heat_flux_ = MeshLib::getOrCreateMeshProperty<double>(
51  mesh, "HeatFlux", MeshLib::MeshItemType::Node, 1);
52 
53  // TODO (naumov) remove ip suffix. Probably needs modification of the mesh
54  // properties, s.t. there is no "overlapping" with cell/point data.
55  // See getOrCreateMeshProperty.
56  _integration_point_writer.emplace_back(
57  std::make_unique<IntegrationPointWriter>(
58  "sigma_ip",
59  static_cast<int>(mesh.getDimension() == 2 ? 4 : 6) /*n components*/,
60  integration_order, local_assemblers_, &LocalAssemblerIF::getSigma));
61 
62  _integration_point_writer.emplace_back(
63  std::make_unique<IntegrationPointWriter>(
64  "saturation_ip", 1 /*n components*/, integration_order,
66 
67  _integration_point_writer.emplace_back(
68  std::make_unique<IntegrationPointWriter>(
69  "porosity_ip", 1 /*n components*/, integration_order,
71 
72  _integration_point_writer.emplace_back(
73  std::make_unique<IntegrationPointWriter>(
74  "transport_porosity_ip", 1 /*n components*/, integration_order,
76 
77  _integration_point_writer.emplace_back(
78  std::make_unique<IntegrationPointWriter>(
79  "swelling_stress_ip",
80  static_cast<int>(mesh.getDimension() == 2 ? 4 : 6) /*n components*/,
81  integration_order, local_assemblers_,
83 
84  _integration_point_writer.emplace_back(
85  std::make_unique<IntegrationPointWriter>(
86  "epsilon_ip",
87  static_cast<int>(mesh.getDimension() == 2 ? 4 : 6) /*n components*/,
88  integration_order, local_assemblers_,
90 }
unsigned getDimension() const
Returns the dimension of the mesh (determined by the maximum dimension over all elements).
Definition: Mesh.h:71
std::string const name
Definition: Process.h:323
std::vector< std::unique_ptr< IntegrationPointWriter > > _integration_point_writer
Definition: Process.h:350
Process(std::string name_, MeshLib::Mesh &mesh, std::unique_ptr< AbstractJacobianAssembler > &&jacobian_assembler, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters, unsigned const integration_order, std::vector< std::vector< std::reference_wrapper< ProcessVariable >>> &&process_variables, SecondaryVariableCollection &&secondary_variables, const bool use_monolithic_scheme=true)
Definition: Process.cpp:22
ThermoRichardsMechanicsProcessData< DisplacementDim > process_data_
virtual std::vector< double > getTransportPorosity() const =0
virtual std::vector< double > getPorosity() const =0
virtual std::vector< double > getEpsilon() const =0
virtual std::vector< double > getSaturation() const =0
virtual std::vector< double > getSigma() const =0
virtual std::vector< double > getSwellingStress() const =0

References ProcessLib::Process::_integration_point_writer, MeshLib::Mesh::getDimension(), ProcessLib::ThermoRichardsMechanics::LocalAssemblerInterface< DisplacementDim >::getEpsilon(), ProcessLib::ThermoRichardsMechanics::LocalAssemblerInterface< DisplacementDim >::getPorosity(), ProcessLib::ThermoRichardsMechanics::LocalAssemblerInterface< DisplacementDim >::getSaturation(), ProcessLib::ThermoRichardsMechanics::LocalAssemblerInterface< DisplacementDim >::getSigma(), ProcessLib::ThermoRichardsMechanics::LocalAssemblerInterface< DisplacementDim >::getSwellingStress(), ProcessLib::ThermoRichardsMechanics::LocalAssemblerInterface< DisplacementDim >::getTransportPorosity(), ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsProcess< DisplacementDim >::heat_flux_, ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsProcess< DisplacementDim >::hydraulic_flow_, ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsProcess< DisplacementDim >::local_assemblers_, ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsProcess< DisplacementDim >::nodal_forces_, and MeshLib::Node.

Member Function Documentation

◆ assembleConcreteProcess()

template<int DisplacementDim>
void ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsProcess< DisplacementDim >::assembleConcreteProcess ( const double  t,
double const  dt,
std::vector< GlobalVector * > const &  x,
std::vector< GlobalVector * > const &  xdot,
int const  process_id,
GlobalMatrix M,
GlobalMatrix K,
GlobalVector b 
)
overrideprivatevirtual

Implements ProcessLib::Process.

Definition at line 322 of file ThermoRichardsMechanicsProcess.cpp.

327 {
328  OGS_FATAL(
329  "The Picard method or the Newton-Raphson method with numerical "
330  "Jacobian is not implemented for ThermoRichardsMechanics with the full "
331  "monolithic coupling scheme");
332 }
#define OGS_FATAL(...)
Definition: Error.h:26

References OGS_FATAL.

◆ assembleWithJacobianConcreteProcess()

template<int DisplacementDim>
void ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsProcess< DisplacementDim >::assembleWithJacobianConcreteProcess ( const double  t,
double const  dt,
std::vector< GlobalVector * > const &  x,
std::vector< GlobalVector * > const &  xdot,
const double  dxdot_dx,
const double  dx_dx,
int const  process_id,
GlobalMatrix M,
GlobalMatrix K,
GlobalVector b,
GlobalMatrix Jac 
)
overrideprivatevirtual

Implements ProcessLib::Process.

Definition at line 335 of file ThermoRichardsMechanicsProcess.cpp.

341 {
342  std::vector<std::reference_wrapper<NumLib::LocalToGlobalIndexMap>>
343  dof_tables;
344 
345  DBUG(
346  "Assemble the Jacobian of ThermoRichardsMechanics for the monolithic "
347  "scheme.");
348  dof_tables.emplace_back(*_local_to_global_index_map);
349 
350  ProcessLib::ProcessVariable const& pv = getProcessVariables(process_id)[0];
351 
354  local_assemblers_, pv.getActiveElementIDs(), dof_tables, t, dt, x, xdot,
355  dxdot_dx, dx_dx, process_id, M, K, b, Jac);
356 
357  auto copyRhs = [&](int const variable_id, auto& output_vector)
358  {
359  transformVariableFromGlobalVector(b, variable_id, dof_tables[0],
360  output_vector, std::negate<double>());
361  };
362 
363  copyRhs(0, *heat_flux_);
364  copyRhs(1, *hydraulic_flow_);
365  copyRhs(2, *nodal_forces_);
366 }
void DBUG(char const *fmt, Args const &... args)
Definition: Logging.h:27
std::vector< std::size_t > const & getActiveElementIDs() const
std::vector< std::reference_wrapper< ProcessVariable > > const & getProcessVariables(const int process_id) const
Definition: Process.h:145
VectorMatrixAssembler _global_assembler
Definition: Process.h:333
std::unique_ptr< NumLib::LocalToGlobalIndexMap > _local_to_global_index_map
Definition: Process.h:329
void assembleWithJacobian(std::size_t const mesh_item_id, LocalAssemblerInterface &local_assembler, std::vector< std::reference_wrapper< NumLib::LocalToGlobalIndexMap >> const &dof_tables, const double t, double const dt, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &xdot, const double dxdot_dx, const double dx_dx, int const process_id, GlobalMatrix &M, GlobalMatrix &K, GlobalVector &b, GlobalMatrix &Jac)
void transformVariableFromGlobalVector(GlobalVector const &input_vector, int const variable_id, NumLib::LocalToGlobalIndexMap const &local_to_global_index_map, MeshLib::PropertyVector< double > &output_vector, Functor mapFunction)
Definition: DOFTableUtil.h:59
static void executeSelectedMemberDereferenced(Object &object, Method method, Container const &container, std::vector< std::size_t > const &active_container_ids, Args &&... args)

References ProcessLib::VectorMatrixAssembler::assembleWithJacobian(), DBUG(), NumLib::SerialExecutor::executeSelectedMemberDereferenced(), ProcessLib::ProcessVariable::getActiveElementIDs(), and NumLib::transformVariableFromGlobalVector().

◆ computeSecondaryVariableConcrete()

template<int DisplacementDim>
void ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsProcess< DisplacementDim >::computeSecondaryVariableConcrete ( double const  t,
double const  dt,
std::vector< GlobalVector * > const &  x,
GlobalVector const &  x_dot,
int const  process_id 
)
overrideprivatevirtual

Reimplemented from ProcessLib::Process.

Definition at line 385 of file ThermoRichardsMechanicsProcess.cpp.

390 {
391  DBUG("Compute the secondary variables for ThermoRichardsMechanicsProcess.");
392 
393  auto const dof_tables = getDOFTables(x.size());
394 
395  ProcessLib::ProcessVariable const& pv = getProcessVariables(process_id)[0];
396 
399  pv.getActiveElementIDs(), dof_tables, t, dt, x, x_dot, process_id);
400 }
virtual void computeSecondaryVariable(std::size_t const mesh_item_id, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, double const t, double const dt, std::vector< GlobalVector * > const &x, GlobalVector const &x_dot, int const process_id)
std::vector< NumLib::LocalToGlobalIndexMap const * > getDOFTables(const int number_of_processes) const
static void executeSelectedMemberOnDereferenced(Method method, Container const &container, std::vector< std::size_t > const &active_container_ids, Args &&... args)

References DBUG(), NumLib::SerialExecutor::executeSelectedMemberOnDereferenced(), and ProcessLib::ProcessVariable::getActiveElementIDs().

◆ constructDofTable()

template<int DisplacementDim>
void ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsProcess< DisplacementDim >::constructDofTable
overrideprivatevirtual

This function is for general cases, in which all equations of the coupled processes have the same number of unknowns. For the general cases with the staggered scheme, all equations of the coupled processes share one DOF table hold by _local_to_global_index_map. Other cases can be considered by overloading this member function in the derived class.

Reimplemented from ProcessLib::Process.

Definition at line 109 of file ThermoRichardsMechanicsProcess.cpp.

110 {
111  // Create single component dof in every of the mesh's nodes.
113  std::make_unique<MeshLib::MeshSubset>(_mesh, _mesh.getNodes());
114  // Create single component dof in the mesh's base nodes.
117  std::make_unique<MeshLib::MeshSubset>(_mesh, base_nodes_);
118 
119  // TODO move the two data members somewhere else.
120  // for extrapolation of secondary variables of stress or strain
121  std::vector<MeshLib::MeshSubset> all__meshsubsets_single_component{
124  std::make_unique<NumLib::LocalToGlobalIndexMap>(
125  std::move(all__meshsubsets_single_component),
126  // by location order is needed for output
128 
129  // For temperature, which is the first variable.
130  std::vector<MeshLib::MeshSubset> all__meshsubsets{*mesh_subset_base_nodes_};
131 
132  // For pressure, which is the second variable
133  all__meshsubsets.push_back(*mesh_subset_base_nodes_);
134 
135  // For displacement.
136  const int monolithic_process_id = 0;
137  std::generate_n(std::back_inserter(all__meshsubsets),
138  getProcessVariables(monolithic_process_id)[2]
139  .get()
140  .getNumberOfGlobalComponents(),
141  [&]() { return *_mesh_subset_all_nodes; });
142 
143  std::vector<int> const vec_n_components{1, 1, DisplacementDim};
145  std::make_unique<NumLib::LocalToGlobalIndexMap>(
146  std::move(all__meshsubsets), vec_n_components,
149 }
std::vector< Node * > const & getNodes() const
Get the nodes-vector for the mesh.
Definition: Mesh.h:95
std::vector< Element * > const & getElements() const
Get the element-vector for the mesh.
Definition: Mesh.h:98
std::unique_ptr< MeshLib::MeshSubset const > _mesh_subset_all_nodes
Definition: Process.h:327
MeshLib::Mesh & _mesh
Definition: Process.h:326
std::unique_ptr< NumLib::LocalToGlobalIndexMap > local_to_global_index_map_single_component_
std::vector< Node * > getBaseNodes(std::vector< Element * > const &elements)
Definition: Utils.h:26
@ BY_LOCATION
Ordering data by spatial location.

References NumLib::BY_LOCATION, and MeshLib::getBaseNodes().

◆ getDOFTable()

template<int DisplacementDim>
NumLib::LocalToGlobalIndexMap const & ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsProcess< DisplacementDim >::getDOFTable ( const int  process_id) const
overrideprivatevirtual

Reimplemented from ProcessLib::Process.

Definition at line 413 of file ThermoRichardsMechanicsProcess.cpp.

415 {
417 }

◆ getDOFTableForExtrapolatorData()

template<int DisplacementDim>
std::tuple< NumLib::LocalToGlobalIndexMap *, bool > ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsProcess< DisplacementDim >::getDOFTableForExtrapolatorData
overrideprivatevirtual

Get the address of a LocalToGlobalIndexMap, and the status of its memory. If the LocalToGlobalIndexMap is created as new in this function, the function also returns a true boolean value to let Extrapolator manage the memory by the address returned by this function.

Returns
Address of a LocalToGlobalIndexMap and its memory status.

Reimplemented from ProcessLib::Process.

Definition at line 404 of file ThermoRichardsMechanicsProcess.cpp.

405 {
406  const bool manage_storage = false;
407  return std::make_tuple(local_to_global_index_map_single_component_.get(),
408  manage_storage);
409 }

◆ getDOFTables()

template<int DisplacementDim>
std::vector< NumLib::LocalToGlobalIndexMap const * > ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsProcess< DisplacementDim >::getDOFTables ( const int  number_of_processes) const
private

Definition at line 421 of file ThermoRichardsMechanicsProcess.cpp.

423 {
424  std::vector<NumLib::LocalToGlobalIndexMap const*> dof_tables;
425  dof_tables.reserve(number_of_processes);
426  std::generate_n(std::back_inserter(dof_tables), number_of_processes,
427  [&]() { return &getDOFTable(dof_tables.size()); });
428  return dof_tables;
429 }
NumLib::LocalToGlobalIndexMap const & getDOFTable(const int process_id) const override

◆ getMatrixSpecifications()

template<int DisplacementDim>
MathLib::MatrixSpecifications ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsProcess< DisplacementDim >::getMatrixSpecifications ( const int  process_id) const
override

Get the size and the sparse pattern of the global matrix in order to create the global matrices and vectors for the system equations of this process.

Parameters
process_idProcess ID. If the monolithic scheme is applied, process_id = 0. For the staggered scheme, process_id = 0 represents the hydraulic (H) process, while process_id = 1 represents the mechanical (M) process.
Returns
Matrix specifications including size and sparse pattern.

Definition at line 100 of file ThermoRichardsMechanicsProcess.cpp.

102 {
103  auto const& l = *_local_to_global_index_map;
104  return {l.dofSizeWithoutGhosts(), l.dofSizeWithoutGhosts(),
105  &l.getGhostIndices(), &this->_sparsity_pattern};
106 }
GlobalSparsityPattern _sparsity_pattern
Definition: Process.h:352

◆ hasMechanicalProcess()

template<int DisplacementDim>
bool ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsProcess< DisplacementDim >::hasMechanicalProcess ( int const  ) const
inlineprivate

Check whether the process represented by process_id is/has mechanical process. In the present implementation, the mechanical process has process_id == 1 in the staggered scheme.

Definition at line 217 of file ThermoRichardsMechanicsProcess.h.

217 { return true; }

◆ initializeBoundaryConditions()

template<int DisplacementDim>
void ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsProcess< DisplacementDim >::initializeBoundaryConditions
overrideprivatevirtual

Member function to initialize the boundary conditions for all coupled processes. It is called by initialize().

Reimplemented from ProcessLib::Process.

Definition at line 300 of file ThermoRichardsMechanicsProcess.cpp.

301 {
302  const int process_id = 0;
304  *_local_to_global_index_map, process_id);
305 }
void initializeProcessBoundaryConditionsAndSourceTerms(const NumLib::LocalToGlobalIndexMap &dof_table, const int process_id)
Definition: Process.cpp:67

◆ initializeConcreteProcess()

template<int DisplacementDim>
void ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsProcess< DisplacementDim >::initializeConcreteProcess ( NumLib::LocalToGlobalIndexMap const &  dof_table,
MeshLib::Mesh const &  mesh,
unsigned const  integration_order 
)
overrideprivatevirtual

Process specific initialization called by initialize().

Implements ProcessLib::Process.

Definition at line 152 of file ThermoRichardsMechanicsProcess.cpp.

156 {
157  using nlohmann::json;
158 
159  const int mechanical_process_id = 0;
160  const int deformation_variable_id = 2;
161  createLocalAssemblers<DisplacementDim,
162  ThermoRichardsMechanicsLocalAssembler>(
163  mesh.getDimension(), mesh.getElements(), dof_table,
164  // use displacement process variable to set shape function order
165  getProcessVariables(mechanical_process_id)[deformation_variable_id]
166  .get()
167  .getShapeFunctionOrder(),
168  local_assemblers_, mesh.isAxiallySymmetric(), integration_order,
169  process_data_);
170 
171  auto add_secondary_variable = [&](std::string const& name,
172  int const num_components,
173  auto get_ip_values_function)
174  {
176  name,
177  makeExtrapolator(num_components, getExtrapolator(),
179  std::move(get_ip_values_function)));
180  };
181 
182  add_secondary_variable("sigma",
184  DisplacementDim>::RowsAtCompileTime,
186 
187  add_secondary_variable("swelling_stress",
189  DisplacementDim>::RowsAtCompileTime,
191 
192  add_secondary_variable("epsilon",
194  DisplacementDim>::RowsAtCompileTime,
196 
197  add_secondary_variable("velocity", DisplacementDim,
199 
200  add_secondary_variable("saturation", 1,
202 
203  add_secondary_variable("porosity", 1, &LocalAssemblerIF::getIntPtPorosity);
204 
205  add_secondary_variable("transport_porosity", 1,
207 
208  add_secondary_variable("dry_density_solid", 1,
210 
211  //
212  // enable output of internal variables defined by material models
213  //
215  LocalAssemblerIF>(process_data_.solid_materials,
216  add_secondary_variable);
217 
218  process_data_.element_saturation = MeshLib::getOrCreateMeshProperty<double>(
219  const_cast<MeshLib::Mesh&>(mesh), "saturation_avg",
221 
222  process_data_.element_porosity = MeshLib::getOrCreateMeshProperty<double>(
223  const_cast<MeshLib::Mesh&>(mesh), "porosity_avg",
225 
226  process_data_.element_stresses = MeshLib::getOrCreateMeshProperty<double>(
227  const_cast<MeshLib::Mesh&>(mesh), "stress_avg",
230  DisplacementDim>::RowsAtCompileTime);
231 
232  process_data_.pressure_interpolated =
233  MeshLib::getOrCreateMeshProperty<double>(
234  const_cast<MeshLib::Mesh&>(mesh), "pressure_interpolated",
236  process_data_.temperature_interpolated =
237  MeshLib::getOrCreateMeshProperty<double>(
238  const_cast<MeshLib::Mesh&>(mesh), "temperature_interpolated",
240 
241  // Set initial conditions for integration point data.
242  for (auto const& ip_writer : _integration_point_writer)
243  {
244  // Find the mesh property with integration point writer's name.
245  auto const& name = ip_writer->name();
246  if (!mesh.getProperties().existsPropertyVector<double>(name))
247  {
248  continue;
249  }
250  auto const& _meshproperty =
251  *mesh.getProperties().template getPropertyVector<double>(name);
252 
253  // The mesh property must be defined on integration points.
254  if (_meshproperty.getMeshItemType() !=
256  {
257  continue;
258  }
259 
260  auto const ip_meta_data = getIntegrationPointMetaData(mesh, name);
261 
262  // Check the number of components.
263  if (ip_meta_data.n_components !=
264  _meshproperty.getNumberOfGlobalComponents())
265  {
266  OGS_FATAL(
267  "Different number of components in meta data ({:d}) than in "
268  "the integration point field data for '{:s}': {:d}.",
269  ip_meta_data.n_components, name,
270  _meshproperty.getNumberOfGlobalComponents());
271  }
272 
273  // Now we have a properly named vtk's field data array and the
274  // corresponding meta data.
275  std::size_t position = 0;
276  for (auto& local_asm : local_assemblers_)
277  {
278  std::size_t const integration_points_read =
279  local_asm->setIPDataInitialConditions(
280  name, &_meshproperty[position],
281  ip_meta_data.integration_order);
282  if (integration_points_read == 0)
283  {
284  OGS_FATAL(
285  "No integration points read in the integration point "
286  "initial conditions set function.");
287  }
288  position += integration_points_read * ip_meta_data.n_components;
289  }
290  }
291 
292  // Initialize local assemblers after all variables have been set.
296 }
virtual void initialize(std::size_t const mesh_item_id, NumLib::LocalToGlobalIndexMap const &dof_table)
NumLib::Extrapolator & getExtrapolator() const
Definition: Process.h:185
SecondaryVariableCollection _secondary_variables
Definition: Process.h:331
void addSecondaryVariable(std::string const &internal_name, SecondaryVariableFunctions &&fcts)
Eigen::Matrix< double, kelvin_vector_dimensions(DisplacementDim), 1, Eigen::ColMajor > KelvinVectorType
Definition: KelvinVector.h:48
void solidMaterialInternalToSecondaryVariables(std::map< int, std::unique_ptr< MaterialLib::Solids::MechanicsBase< DisplacementDim >>> const &solid_materials, AddSecondaryVariableCallback const &add_secondary_variable)
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)
IntegrationPointMetaData getIntegrationPointMetaData(MeshLib::Mesh const &mesh, std::string const &name)
SecondaryVariableFunctions makeExtrapolator(const unsigned num_components, NumLib::Extrapolator &extrapolator, LocalAssemblerCollection const &local_assemblers, typename NumLib::ExtrapolatableLocalAssemblerCollection< LocalAssemblerCollection >::IntegrationPointValuesMethod integration_point_values_method)
static void executeMemberOnDereferenced(Method method, Container const &container, Args &&... args)
virtual std::vector< double > const & getIntPtTransportPorosity(const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const =0
virtual std::vector< double > const & getIntPtDarcyVelocity(const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const =0
virtual std::vector< double > const & getIntPtEpsilon(const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const =0
virtual std::vector< double > const & getIntPtSigma(const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const =0
virtual std::vector< double > const & getIntPtSwellingStress(const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const =0
virtual std::vector< double > const & getIntPtSaturation(const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const =0
virtual std::vector< double > const & getIntPtDryDensitySolid(const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const =0
virtual std::vector< double > const & getIntPtPorosity(const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const =0

References MeshLib::Cell, ProcessLib::ThermoRichardsMechanics::createLocalAssemblers(), NumLib::SerialExecutor::executeMemberOnDereferenced(), MeshLib::Properties::existsPropertyVector(), MeshLib::Mesh::getDimension(), MeshLib::Mesh::getElements(), ProcessLib::getIntegrationPointMetaData(), MeshLib::Mesh::getProperties(), MeshLib::IntegrationPoint, MeshLib::Mesh::isAxiallySymmetric(), ProcessLib::makeExtrapolator(), MaterialPropertyLib::name, MeshLib::Node, OGS_FATAL, and ProcessLib::Deformation::solidMaterialInternalToSecondaryVariables().

◆ isLinear()

template<int DisplacementDim>
bool ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsProcess< DisplacementDim >::isLinear
override

Definition at line 93 of file ThermoRichardsMechanicsProcess.cpp.

94 {
95  return false;
96 }

◆ postTimestepConcreteProcess()

template<int DisplacementDim>
void ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsProcess< DisplacementDim >::postTimestepConcreteProcess ( std::vector< GlobalVector * > const &  x,
double const  t,
double const  dt,
const int  process_id 
)
overrideprivatevirtual

Reimplemented from ProcessLib::Process.

Definition at line 369 of file ThermoRichardsMechanicsProcess.cpp.

373 {
374  DBUG("PostTimestep ThermoRichardsMechanicsProcess.");
375 
376  auto const dof_tables = getDOFTables(x.size());
377 
378  ProcessLib::ProcessVariable const& pv = getProcessVariables(process_id)[0];
381  pv.getActiveElementIDs(), dof_tables, x, t, dt);
382 }
virtual void postTimestep(std::size_t const mesh_item_id, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, std::vector< GlobalVector * > const &x, double const t, double const dt)

References DBUG(), NumLib::SerialExecutor::executeSelectedMemberOnDereferenced(), and ProcessLib::ProcessVariable::getActiveElementIDs().

◆ setInitialConditionsConcreteProcess()

template<int DisplacementDim>
void ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsProcess< DisplacementDim >::setInitialConditionsConcreteProcess ( std::vector< GlobalVector * > &  x,
double const  t,
int const  process_id 
)
overrideprivatevirtual

Reimplemented from ProcessLib::Process.

Definition at line 308 of file ThermoRichardsMechanicsProcess.cpp.

312 {
313  DBUG("SetInitialConditions ThermoRichardsMechanicsProcess.");
314 
318  process_id);
319 }
void setInitialConditions(std::size_t const mesh_item_id, NumLib::LocalToGlobalIndexMap const &dof_table, GlobalVector const &x, double const t, bool const use_monolithic_scheme, int const process_id)
const bool _use_monolithic_scheme
Definition: Process.h:335

References DBUG(), NumLib::SerialExecutor::executeMemberOnDereferenced(), and ProcessLib::setInitialConditions().

Member Data Documentation

◆ base_nodes_

template<int DisplacementDim>
std::vector<MeshLib::Node*> ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsProcess< DisplacementDim >::base_nodes_
private

Definition at line 183 of file ThermoRichardsMechanicsProcess.h.

◆ heat_flux_

◆ hydraulic_flow_

◆ local_assemblers_

◆ local_to_global_index_map_single_component_

template<int DisplacementDim>
std::unique_ptr<NumLib::LocalToGlobalIndexMap> ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsProcess< DisplacementDim >::local_to_global_index_map_single_component_
private

Definition at line 190 of file ThermoRichardsMechanicsProcess.h.

◆ local_to_global_index_map_with_base_nodes_

template<int DisplacementDim>
std::unique_ptr<NumLib::LocalToGlobalIndexMap> ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsProcess< DisplacementDim >::local_to_global_index_map_with_base_nodes_
private

Local to global index mapping for base nodes, which is used for linear interpolation for pressure in the staggered scheme.

Definition at line 195 of file ThermoRichardsMechanicsProcess.h.

◆ mesh_subset_base_nodes_

template<int DisplacementDim>
std::unique_ptr<MeshLib::MeshSubset const> ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsProcess< DisplacementDim >::mesh_subset_base_nodes_
private

Definition at line 184 of file ThermoRichardsMechanicsProcess.h.

◆ nodal_forces_

◆ process_data_

template<int DisplacementDim>
ThermoRichardsMechanicsProcessData<DisplacementDim> ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsProcess< DisplacementDim >::process_data_
private

Definition at line 185 of file ThermoRichardsMechanicsProcess.h.

◆ sparsity_pattern_with_linear_element_

template<int DisplacementDim>
GlobalSparsityPattern ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsProcess< DisplacementDim >::sparsity_pattern_with_linear_element_
private

Sparsity pattern for the flow equation, and it is initialized only if the staggered scheme is used.

Definition at line 199 of file ThermoRichardsMechanicsProcess.h.


The documentation for this class was generated from the following files: