GEOS
MultiphasePoromechanics.hpp
Go to the documentation of this file.
1 /*
2  * ------------------------------------------------------------------------------------------------------------
3  * SPDX-License-Identifier: LGPL-2.1-only
4  *
5  * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC
6  * Copyright (c) 2018-2024 TotalEnergies
7  * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University
8  * Copyright (c) 2023-2024 Chevron
9  * Copyright (c) 2019- GEOS/GEOSX Contributors
10  * All rights reserved
11  *
12  * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
13  * ------------------------------------------------------------------------------------------------------------
14  */
15 
20 #ifndef GEOS_PHYSICSSOLVERS_MULTIPHYSICS_MULTIPHASEPOROMECHANICS_HPP_
21 #define GEOS_PHYSICSSOLVERS_MULTIPHYSICS_MULTIPHASEPOROMECHANICS_HPP_
22 
26 
27 namespace geos
28 {
29 
30 template< typename FLOW_SOLVER = CompositionalMultiphaseBase, typename MECHANICS_SOLVER = SolidMechanicsLagrangianFEM >
31 class MultiphasePoromechanics : public PoromechanicsSolver< FLOW_SOLVER, MECHANICS_SOLVER >
32 {
33 public:
34 
36  using Base::m_solvers;
37  using Base::m_dofManager;
38  using Base::m_localMatrix;
39  using Base::m_rhs;
40  using Base::m_solution;
44  using Base::updateBulkDensity;
45 
51  MultiphasePoromechanics( const string & name,
52  dataRepository::Group * const parent );
53 
55  ~MultiphasePoromechanics() override {};
56 
61  static string catalogName()
62  {
63  if constexpr ( std::is_same_v< FLOW_SOLVER, CompositionalMultiphaseBase > ) // special case
64  {
65  return "MultiphasePoromechanics";
66  }
67  else // default
68  {
69  return FLOW_SOLVER::catalogName() + "Poromechanics";
70  }
71  }
72 
76  string getCatalogName() const override { return catalogName(); }
77 
85  virtual void assembleSystem( real64 const time,
86  real64 const dt,
87  DomainPartition & domain,
88  DofManager const & dofManager,
90  arrayView1d< real64 > const & localRhs ) override
91  { Base::assembleSystem( time, dt, domain, dofManager, localMatrix, localRhs ); }
92 
93  virtual void assembleElementBasedTerms( real64 const time,
94  real64 const dt,
95  DomainPartition & domain,
96  DofManager const & dofManager,
98  arrayView1d< real64 > const & localRhs ) override;
99 
102 protected:
103 
104  virtual void setMGRStrategy() override
105  {
107  GEOS_ERROR( GEOS_FMT( "{}: MGR strategy is not implemented for {}", this->getName(), this->getCatalogName()));
108  }
109 
114  virtual void updateBulkDensity( ElementSubRegionBase & subRegion ) override;
115 
116  virtual string getFlowDofKey() const override { return CompositionalMultiphaseBase::viewKeyStruct::elemDofFieldString(); }
117 
118 };
119 
120 } /* namespace geos */
121 
122 #endif /* GEOS_PHYSICSSOLVERS_MULTIPHYSICS_MULTIPHASEPOROMECHANICS_HPP_ */
#define GEOS_ERROR(msg)
Raise a hard error and terminate the program.
Definition: Logger.hpp:157
The DoFManager is responsible for allocating global dofs, constructing sparsity patterns,...
Definition: DofManager.hpp:45
Partition of the decomposed physical domain. It also manages the connexion information to its neighbo...
string getCatalogName() const override
~MultiphasePoromechanics() override
Destructor for the class.
static string catalogName()
name of the node manager in the object catalog
MultiphasePoromechanics(const string &name, dataRepository::Group *const parent)
main constructor for MultiphasePoromechanics Objects
virtual void updateBulkDensity(ElementSubRegionBase &subRegion) override
Helper function to recompute the bulk density.
CRSMatrix< real64, globalIndex > m_localMatrix
Local system matrix and rhs.
DofManager m_dofManager
Data structure to handle degrees of freedom.
ParallelVector m_solution
System solution vector.
ParallelVector m_rhs
System right-hand side vector.
LinearSolverParametersInput m_linearSolverParameters
Linear solver parameters.
real64 m_stabilizationMultiplier
Stabilization Multiplier.
stabilization::StabilizationType m_stabilizationType
Type of stabilization used.
string_array m_stabilizationRegionNames
Names of regions where stabilization applied.
std::tuple< SOLVERS *... > m_solvers
Pointers of the single-physics solvers.
virtual void assembleSystem(real64 const time, real64 const dt, DomainPartition &domain, DofManager const &dofManager, CRSMatrixView< real64, globalIndex const > const &localMatrix, arrayView1d< real64 > const &localRhs) override
function to assemble the linear system matrix and rhs
string const & getName() const
Get group name.
Definition: Group.hpp:1331
virtual void assembleSystem(real64 const time, real64 const dt, DomainPartition &domain, DofManager const &dofManager, CRSMatrixView< real64, globalIndex const > const &localMatrix, arrayView1d< real64 > const &localRhs) override
function to assemble the linear system matrix and rhs
ArrayView< T, 1 > arrayView1d
Alias for 1D array view.
Definition: DataTypes.hpp:179
double real64
64-bit floating point type.
Definition: DataTypes.hpp:98
LvArray::CRSMatrixView< T, COL_INDEX, INDEX_TYPE const, LvArray::ChaiBuffer > CRSMatrixView
Alias for CRS Matrix View.
Definition: DataTypes.hpp:309
@ mgr
Multigrid reduction (Hypre only)
PreconditionerType preconditionerType
Preconditioner type.