GEOS
SinglePhaseFVM.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_FLUIDFLOW_SINGLEPHASEFVM_HPP_
21 #define GEOS_PHYSICSSOLVERS_FLUIDFLOW_SINGLEPHASEFVM_HPP_
22 
25 
26 namespace geos
27 {
28 
29 
37 template< typename BASE = SinglePhaseBase >
38 class SinglePhaseFVM : public BASE
39 {
40 public:
41 
42  // Aliasing public/protected members/methods of PhysicsSolverBase so we don't
43  // have to use this->member etc.
44  using BASE::forDiscretizationOnMeshTargets;
45  using BASE::m_discretizationName;
46  using BASE::m_linearSolverParameters;
47  using BASE::m_nonlinearSolverParameters;
48 
49  // Aliasing public/protected members/methods of FlowSolverBase so we don't
50  // have to use this->member etc.
51  using BASE::m_numDofPerCell;
52  using BASE::m_isThermal;
53 
59  SinglePhaseFVM( const string & name,
60  dataRepository::Group * const parent );
61 
62 
64  SinglePhaseFVM() = delete;
65 
67  SinglePhaseFVM( SinglePhaseFVM const & ) = delete;
68 
70  SinglePhaseFVM( SinglePhaseFVM && ) = default;
71 
73  SinglePhaseFVM & operator=( SinglePhaseFVM const & ) = delete;
74 
77 
81  virtual ~SinglePhaseFVM() override = default;
82 
87  static string catalogName()
88  {
89  if constexpr ( std::is_same_v< BASE, SinglePhaseBase > )
90  {
91  return "SinglePhaseFVM";
92  }
93  else if constexpr ( std::is_same_v< BASE, SinglePhaseProppantBase > )
94  {
95  return "SinglePhaseProppantFVM";
96  }
97  else
98  {
99  return BASE::catalogName();
100  }
101  }
102 
106  string getCatalogName() const override { return catalogName(); }
107 
115  virtual void
116  setupDofs( DomainPartition const & domain,
117  DofManager & dofManager ) const override;
118 
119  virtual void
121  DofManager & dofManager,
122  CRSMatrix< real64, globalIndex > & localMatrix,
123  ParallelVector & rhs,
124  ParallelVector & solution,
125  bool const setSparsity = true ) override;
126 
127  virtual void
129  real64 const dt,
130  DomainPartition & domain,
131  DofManager const & dofManager,
132  CRSMatrixView< real64, globalIndex const > const & localMatrix,
133  arrayView1d< real64 > const & localRhs ) override;
134 
135  virtual real64
136  calculateResidualNorm( real64 const & time_n,
137  real64 const & dt,
138  DomainPartition const & domain,
139  DofManager const & dofManager,
140  arrayView1d< real64 const > const & localRhs ) override;
141 
142  virtual void
143  applySystemSolution( DofManager const & dofManager,
144  arrayView1d< real64 const > const & localSolution,
145  real64 const scalingFactor,
146  real64 const dt,
147  DomainPartition & domain ) override;
148  virtual void
150  DomainPartition const & domain,
151  DofManager const & dofManager,
152  CRSMatrixView< real64, globalIndex const > const & localMatrix,
153  arrayView1d< real64 > const & localRhs ) override;
154 
155  virtual void
157  DomainPartition const & domain,
158  DofManager const & dofManager,
159  CRSMatrixView< real64, globalIndex const > const & localMatrix,
160  arrayView1d< real64 > const & localRhs ) override;
161  virtual void
163  real64 const dt,
164  DomainPartition const & domain,
165  DofManager const & dofManager,
166  CRSMatrixView< real64, globalIndex const > const & localMatrix,
167  arrayView1d< real64 > const & localRhs,
168  string const & jumpDofKey ) override final;
169 
170  virtual void
172  real64 const dt,
173  DomainPartition const & domain,
174  DofManager const & dofManager,
175  CRSMatrixView< real64, globalIndex const > const & localMatrix,
176  arrayView1d< real64 > const & localRhs,
177  CRSMatrixView< real64, localIndex const > const & dR_dAper ) override final;
178 
181  virtual void
182  applyAquiferBC( real64 const time,
183  real64 const dt,
184  DomainPartition & domain,
185  DofManager const & dofManager,
186  CRSMatrixView< real64, globalIndex const > const & localMatrix,
187  arrayView1d< real64 > const & localRhs ) const override;
188 
189  virtual void initializePreSubGroups() override;
190 
191 private:
192 
202  void applyFaceDirichletBC( real64 const time_n,
203  real64 const dt,
204  DofManager const & faceSet,
205  DomainPartition & domain,
206  CRSMatrixView< real64, globalIndex const > const & localMatrix,
207  arrayView1d< real64 > const & localRhs );
208 
209  // no data needed here, see SinglePhaseBase
210 
211 };
212 
213 } /* namespace geos */
214 
215 #endif //GEOS_PHYSICSSOLVERS_FLUIDFLOW_SINGLEPHASEFVM_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...
SinglePhaseFVM & operator=(SinglePhaseFVM const &)=delete
deleted assignment operator
SinglePhaseFVM()=delete
deleted default constructor
virtual void initializePreSubGroups() override
Called by Initialize() prior to initializing sub-Groups.
SinglePhaseFVM(const string &name, dataRepository::Group *const parent)
main constructor for Group Objects
static string catalogName()
name of the node manager in the object catalog
SinglePhaseFVM & operator=(SinglePhaseFVM &&)=delete
deleted move operator
virtual void applyAquiferBC(real64 const time, real64 const dt, DomainPartition &domain, DofManager const &dofManager, CRSMatrixView< real64, globalIndex const > const &localMatrix, arrayView1d< real64 > const &localRhs) const override
Apply aquifer boundary conditions to the system.
virtual ~SinglePhaseFVM() override=default
default destructor
SinglePhaseFVM(SinglePhaseFVM const &)=delete
deleted copy constructor
string getCatalogName() const override
SinglePhaseFVM(SinglePhaseFVM &&)=default
default move constructor
virtual void assembleFluxTerms(real64 const dt, DomainPartition const &domain, DofManager const &dofManager, CRSMatrixView< real64, globalIndex const > const &localMatrix, arrayView1d< real64 > const &localRhs) override
assembles the flux terms for all cells
virtual void assembleStabilizedFluxTerms(real64 const dt, DomainPartition const &domain, DofManager const &dofManager, CRSMatrixView< real64, globalIndex const > const &localMatrix, arrayView1d< real64 > const &localRhs) override
assembles the flux terms for all cells including jump stabilization
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)
virtual void applySystemSolution(DofManager const &dofManager, arrayView1d< real64 const > const &localSolution, real64 const scalingFactor, real64 const dt, DomainPartition &domain) override
Function to apply the solution vector to the state.
virtual real64 calculateResidualNorm(real64 const &time_n, real64 const &dt, DomainPartition const &domain, DofManager const &dofManager, arrayView1d< real64 const > const &localRhs) override
calculate the norm of the global system residual
virtual void assembleEDFMFluxTerms(real64 const time_n, real64 const dt, DomainPartition const &domain, DofManager const &dofManager, CRSMatrixView< real64, globalIndex const > const &localMatrix, arrayView1d< real64 > const &localRhs, string const &jumpDofKey) override final
assembles the flux terms for all cells for the poroelastic case
virtual void applyBoundaryConditions(real64 const time_n, real64 const dt, DomainPartition &domain, DofManager const &dofManager, CRSMatrixView< real64, globalIndex const > const &localMatrix, arrayView1d< real64 > const &localRhs) override
apply boundary condition to system
virtual void setupDofs(DomainPartition const &domain, DofManager &dofManager) const override
Populate degree-of-freedom manager with fields relevant to this solver.
virtual void assembleHydrofracFluxTerms(real64 const time_n, real64 const dt, DomainPartition const &domain, DofManager const &dofManager, CRSMatrixView< real64, globalIndex const > const &localMatrix, arrayView1d< real64 > const &localRhs, CRSMatrixView< real64, localIndex const > const &dR_dAper) override final
assembles the flux terms for all cells for the hydrofracture case
ArrayView< T, 1 > arrayView1d
Alias for 1D array view.
Definition: DataTypes.hpp:188
LvArray::CRSMatrixView< T, COL_INDEX, localIndex const, LvArray::ChaiBuffer > CRSMatrixView
Alias for CRS Matrix View.
Definition: DataTypes.hpp:318
double real64
64-bit floating point type.
Definition: DataTypes.hpp:98
LvArray::CRSMatrix< T, COL_INDEX, localIndex, LvArray::ChaiBuffer > CRSMatrix
Alias for CRS Matrix class.
Definition: DataTypes.hpp:314
LAInterface::ParallelVector ParallelVector
Alias for ParallelVector.