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::getLogLevel;
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 postInputInitialization() override;
86 
87  virtual void setupCoupling( DomainPartition const & domain,
88  DofManager & dofManager ) const override;
89 
90  virtual void assembleSystem( real64 const time,
91  real64 const dt,
92  DomainPartition & domain,
93  DofManager const & dofManager,
95  arrayView1d< real64 > const & localRhs ) override;
96 
97  void assembleElementBasedTerms( real64 const time,
98  real64 const dt,
99  DomainPartition & domain,
100  DofManager const & dofManager,
101  CRSMatrixView< real64, globalIndex const > const & localMatrix,
102  arrayView1d< real64 > const & localRhs );
103 
106 protected:
107 
109 
110  virtual void setMGRStrategy()
111  {
113  GEOS_ERROR( GEOS_FMT( "{}: MGR strategy is not implemented for {}", this->getName(), this->getCatalogName()));
114  }
115 
120  virtual void updateBulkDensity( ElementSubRegionBase & subRegion ) override;
121 
122 };
123 
124 } /* namespace geos */
125 
126 #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:44
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
virtual void initializePostInitialConditionsPreSubGroups() override
Called by InitializePostInitialConditions() prior to initializing sub-Groups.
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.
array1d< string > m_stabilizationRegionNames
Names of regions where stabilization applied.
real64 m_stabilizationMultiplier
Stabilization Multiplier.
stabilization::StabilizationType m_stabilizationType
Type of stabilization used.
std::tuple< SOLVERS *... > m_solvers
Pointers of the single-physics solvers.
string const & getName() const
Get group name.
Definition: Group.hpp:1329
integer getLogLevel() const
Definition: Group.hpp:1505
virtual void postInputInitialization() override
virtual void setupCoupling(DomainPartition const &domain, DofManager &dofManager) const override
Utility function to set the coupling between degrees of freedom.
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:180
LvArray::CRSMatrixView< T, COL_INDEX, localIndex const, LvArray::ChaiBuffer > CRSMatrixView
Alias for CRS Matrix View.
Definition: DataTypes.hpp:310
double real64
64-bit floating point type.
Definition: DataTypes.hpp:99
@ mgr
Multigrid reduction (Hypre only)
PreconditionerType preconditionerType
Preconditioner type.