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 
43  // Aliasing public/protected members/methods of Group so we don't
44  // have to use this->member etc.
45  using BASE::getLogLevel;
46 
47  // Aliasing public/protected members/methods of PhysicsSolverBase so we don't
48  // have to use this->member etc.
49  using BASE::forDiscretizationOnMeshTargets;
50  using BASE::m_cflFactor;
51  using BASE::m_maxStableDt;
52  using BASE::m_nextDt;
53  using BASE::m_discretizationName;
54  using BASE::m_dofManager;
55  using BASE::m_matrix;
56  using BASE::m_rhs;
57  using BASE::m_solution;
58  using BASE::m_localMatrix;
59  using BASE::m_linearSolverParameters;
60  using BASE::m_nonlinearSolverParameters;
61 
62  // Aliasing public/protected members/methods of FlowSolverBase so we don't
63  // have to use this->member etc.
64  using BASE::m_numDofPerCell;
65  using BASE::m_isThermal;
66 
72  SinglePhaseFVM( const string & name,
73  dataRepository::Group * const parent );
74 
75 
77  SinglePhaseFVM() = delete;
78 
80  SinglePhaseFVM( SinglePhaseFVM const & ) = delete;
81 
83  SinglePhaseFVM( SinglePhaseFVM && ) = default;
84 
86  SinglePhaseFVM & operator=( SinglePhaseFVM const & ) = delete;
87 
90 
94  virtual ~SinglePhaseFVM() override = default;
95 
100  static string catalogName()
101  {
102  if constexpr ( std::is_same_v< BASE, SinglePhaseBase > )
103  {
104  return "SinglePhaseFVM";
105  }
106  else if constexpr ( std::is_same_v< BASE, SinglePhaseProppantBase > )
107  {
108  return "SinglePhaseProppantFVM";
109  }
110  else
111  {
112  return BASE::catalogName();
113  }
114  }
115 
119  string getCatalogName() const override { return catalogName(); }
120 
128  virtual void
129  setupDofs( DomainPartition const & domain,
130  DofManager & dofManager ) const override;
131 
132  virtual void
134  DofManager & dofManager,
135  CRSMatrix< real64, globalIndex > & localMatrix,
136  ParallelVector & rhs,
137  ParallelVector & solution,
138  bool const setSparsity = true ) override;
139 
140  virtual void
142  real64 const dt,
143  DomainPartition & domain,
144  DofManager const & dofManager,
145  CRSMatrixView< real64, globalIndex const > const & localMatrix,
146  arrayView1d< real64 > const & localRhs ) override;
147 
148  virtual real64
149  calculateResidualNorm( real64 const & time_n,
150  real64 const & dt,
151  DomainPartition const & domain,
152  DofManager const & dofManager,
153  arrayView1d< real64 const > const & localRhs ) override;
154 
155  virtual void
156  applySystemSolution( DofManager const & dofManager,
157  arrayView1d< real64 const > const & localSolution,
158  real64 const scalingFactor,
159  real64 const dt,
160  DomainPartition & domain ) override;
161  virtual void
163  DomainPartition const & domain,
164  DofManager const & dofManager,
165  CRSMatrixView< real64, globalIndex const > const & localMatrix,
166  arrayView1d< real64 > const & localRhs ) override;
167 
168  virtual void
170  DomainPartition const & domain,
171  DofManager const & dofManager,
172  CRSMatrixView< real64, globalIndex const > const & localMatrix,
173  arrayView1d< real64 > const & localRhs ) override;
174  virtual void
176  real64 const dt,
177  DomainPartition const & domain,
178  DofManager const & dofManager,
179  CRSMatrixView< real64, globalIndex const > const & localMatrix,
180  arrayView1d< real64 > const & localRhs,
181  string const & jumpDofKey ) override final;
182 
183  virtual void
185  real64 const dt,
186  DomainPartition const & domain,
187  DofManager const & dofManager,
188  CRSMatrixView< real64, globalIndex const > const & localMatrix,
189  arrayView1d< real64 > const & localRhs,
190  CRSMatrixView< real64, localIndex const > const & dR_dAper ) override final;
191 
194  virtual void
195  applyAquiferBC( real64 const time,
196  real64 const dt,
197  DomainPartition & domain,
198  DofManager const & dofManager,
199  CRSMatrixView< real64, globalIndex const > const & localMatrix,
200  arrayView1d< real64 > const & localRhs ) const override;
201 
202  virtual void initializePreSubGroups() override;
203 
204 private:
205 
215  void applyFaceDirichletBC( real64 const time_n,
216  real64 const dt,
217  DofManager const & faceSet,
218  DomainPartition & domain,
219  CRSMatrixView< real64, globalIndex const > const & localMatrix,
220  arrayView1d< real64 > const & localRhs );
221 
222  // no data needed here, see SinglePhaseBase
223 
224 };
225 
226 } /* namespace geos */
227 
228 #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: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
LvArray::CRSMatrix< T, COL_INDEX, localIndex, LvArray::ChaiBuffer > CRSMatrix
Alias for CRS Matrix class.
Definition: DataTypes.hpp:306
LAInterface::ParallelVector ParallelVector
Alias for ParallelVector.