GEOS
MultiphasePoromechanicsConformingFractures.hpp
Go to the documentation of this file.
1 /*
2  * ------------------------------------------------------------------------------------------------------------
3  * SPDX-License-Identifier: LGPL-2.1-only
4  *
5  * Copyright (c) 2018-2020 Lawrence Livermore National Security LLC
6  * Copyright (c) 2018-2020 The Board of Trustees of the Leland Stanford Junior University
7  * Copyright (c) 2018-2020 TotalEnergies
8  * Copyright (c) 2019- GEOSX Contributors
9  * All rights reserved
10  *
11  * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
12  * ------------------------------------------------------------------------------------------------------------
13  */
14 
19 #ifndef GEOS_PHYSICSSOLVERS_MULTIPHYSICS_MULTIPHASEPOROMECHANICSCONFORMINGFRACTURES_HPP_
20 #define GEOS_PHYSICSSOLVERS_MULTIPHYSICS_MULTIPHASEPOROMECHANICSCONFORMINGFRACTURES_HPP_
21 
24 
25 namespace geos
26 {
27 
28 template< typename FLOW_SOLVER = CompositionalMultiphaseBase >
29 class MultiphasePoromechanicsConformingFractures : public MultiphasePoromechanics< FLOW_SOLVER, SolidMechanicsLagrangeContact >
30 {
31 public:
32 
34  using Base::m_solvers;
35  using Base::m_dofManager;
36  using Base::m_localMatrix;
37  using Base::m_rhs;
38  using Base::m_solution;
39 
41  static string coupledSolverAttributePrefix() { return "poromechanicsConformingFractures"; }
42 
49  dataRepository::Group * const parent );
50 
53 
59  static string catalogName()
60  {
61  if constexpr ( std::is_same_v< FLOW_SOLVER, CompositionalMultiphaseBase > )
62  {
63  return "MultiphasePoromechanicsConformingFractures";
64  }
65  else
66  {
67  return FLOW_SOLVER::catalogName() + "PoromechanicsConformingFractures";
68  }
69  }
70 
74  string getCatalogName() const override { return catalogName(); }
75 
83  virtual void setupCoupling( DomainPartition const & domain,
84  DofManager & dofManager ) const override;
85 
86  virtual void setupSystem( DomainPartition & domain,
87  DofManager & dofManager,
89  ParallelVector & rhs,
90  ParallelVector & solution,
91  bool const setSparsity = true ) override;
92 
93  virtual void assembleSystem( real64 const time,
94  real64 const dt,
95  DomainPartition & domain,
96  DofManager const & dofManager,
98  arrayView1d< real64 > const & localRhs ) override final;
99 
100  virtual void updateState( DomainPartition & domain ) override final;
101 
104 protected:
105 
106  virtual void postInputInitialization() override;
107 
108 private:
109 
110  struct viewKeyStruct : public Base::viewKeyStruct
111  {};
112 
113  static const localIndex m_maxFaceNodes=11; // Maximum number of nodes on a contact face
114 
115  void assembleElementBasedContributions( real64 const time_n,
116  real64 const dt,
117  DomainPartition & domain,
118  DofManager const & dofManager,
119  CRSMatrixView< real64, globalIndex const > const & localMatrix,
120  arrayView1d< real64 > const & localRhs );
121 
122  virtual void assembleCouplingTerms( real64 const time_n,
123  real64 const dt,
124  DomainPartition const & domain,
125  DofManager const & dofManager,
126  CRSMatrixView< real64, globalIndex const > const & localMatrix,
127  arrayView1d< real64 > const & localRhs ) override final;
128 
129  void assembleForceResidualDerivativeWrtPressure( MeshLevel const & mesh,
130  string_array const & regionNames,
131  DofManager const & dofManager,
132  CRSMatrixView< real64, globalIndex const > const & localMatrix,
133  arrayView1d< real64 > const & localRhs );
134 
135  void assembleFluidMassResidualDerivativeWrtDisplacement( MeshLevel const & mesh,
136  string_array const & regionNames,
137  DofManager const & dofManager,
138  CRSMatrixView< real64, globalIndex const > const & localMatrix,
139  arrayView1d< real64 > const & localRhs );
140 
147  void addTransmissibilityCouplingNNZ( DomainPartition const & domain,
148  DofManager const & dofManager,
149  arrayView1d< localIndex > const & rowLengths ) const;
150 
157  void addTransmissibilityCouplingPattern( DomainPartition const & domain,
158  DofManager const & dofManager,
159  SparsityPatternView< globalIndex > const & pattern ) const;
160 
168  void setUpDflux_dApertureMatrix( DomainPartition & domain,
169  DofManager const & dofManager,
170  CRSMatrix< real64, globalIndex > & localMatrix );
171 
177  void updateHydraulicApertureAndFracturePermeability( DomainPartition & domain );
178 
179 
180  std::unique_ptr< CRSMatrix< real64, localIndex > > & getRefDerivativeFluxResidual_dAperture()
181  {
182  return m_derivativeFluxResidual_dAperture;
183  }
184 
185  CRSMatrixView< real64, localIndex const > getDerivativeFluxResidual_dNormalJump()
186  {
187  return m_derivativeFluxResidual_dAperture->toViewConstSizes();
188  }
189 
190  CRSMatrixView< real64 const, localIndex const > getDerivativeFluxResidual_dNormalJump() const
191  {
192  return m_derivativeFluxResidual_dAperture->toViewConst();
193  }
194 
195  std::unique_ptr< CRSMatrix< real64, localIndex > > m_derivativeFluxResidual_dAperture;
196 
197  string const m_flowDofKey = CompositionalMultiphaseBase::viewKeyStruct::elemDofFieldString();
198 
199 };
200 
201 } /* namespace geos */
202 
203 #endif /* GEOS_PHYSICSSOLVERS_MULTIPHYSICS_MULTIPHASEPOROMECHANICSCONFORMINGFRACTURES_HPP_ */
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...
Class facilitating the representation of a multi-level discretization of a MeshBody.
Definition: MeshLevel.hpp:42
static string coupledSolverAttributePrefix()
String used to form the solverName used to register solvers in CoupledSolver.
static string catalogName()
name of the node manager in the object catalog
MultiphasePoromechanicsConformingFractures(const string &name, dataRepository::Group *const parent)
main constructor for MultiphasePoromechanicsConformingFractures objects
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.
std::tuple< SOLVERS *... > m_solvers
Pointers of the single-physics solvers.
virtual void updateState(DomainPartition &domain) override final
Recompute all dependent quantities from primary variables (including constitutive models)
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 final
function to assemble the linear system matrix and rhs
virtual void setupCoupling(DomainPartition const &domain, DofManager &dofManager) const override
Utility function to set the coupling between degrees of freedom.
virtual void setupSystem(DomainPartition &domain, DofManager &dofManager, CRSMatrix< real64, globalIndex > &localMatrix, ParallelVector &rhs, ParallelVector &solution, bool const setSparsity=true) override
Set up the linear system (DOF indices and sparsity patterns)
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
LvArray::SparsityPatternView< COL_INDEX, INDEX_TYPE const, LvArray::ChaiBuffer > SparsityPatternView
Alias for Sparsity pattern View.
Definition: DataTypes.hpp:302
double real64
64-bit floating point type.
Definition: DataTypes.hpp:99
GEOS_LOCALINDEX_TYPE localIndex
Local index type (for indexing objects within an MPI partition).
Definition: DataTypes.hpp:85
LvArray::CRSMatrix< T, COL_INDEX, localIndex, LvArray::ChaiBuffer > CRSMatrix
Alias for CRS Matrix class.
Definition: DataTypes.hpp:306
std::vector< string > string_array
A 1-dimensional array of geos::string types.
Definition: DataTypes.hpp:393
LAInterface::ParallelVector ParallelVector
Alias for ParallelVector.
Structure to hold scoped key names.
Definition: Group.hpp:1444