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  using BASE::m_precond;
49 
50  // Aliasing public/protected members/methods of FlowSolverBase so we don't
51  // have to use this->member etc.
52  using BASE::m_numDofPerCell;
53  using BASE::m_isThermal;
54 
60  SinglePhaseFVM( const string & name,
61  dataRepository::Group * const parent );
62 
63 
65  SinglePhaseFVM() = delete;
66 
68  SinglePhaseFVM( SinglePhaseFVM const & ) = delete;
69 
71  SinglePhaseFVM( SinglePhaseFVM && ) = default;
72 
74  SinglePhaseFVM & operator=( SinglePhaseFVM const & ) = delete;
75 
78 
82  virtual ~SinglePhaseFVM() override = default;
83 
88  static string catalogName()
89  {
90  if constexpr ( std::is_same_v< BASE, SinglePhaseBase > )
91  {
92  return "SinglePhaseFVM";
93  }
94  else if constexpr ( std::is_same_v< BASE, SinglePhaseProppantBase > )
95  {
96  return "SinglePhaseProppantFVM";
97  }
98  else
99  {
100  return BASE::catalogName();
101  }
102  }
103 
107  string getCatalogName() const override { return catalogName(); }
108 
116  virtual void
117  setupDofs( DomainPartition const & domain,
118  DofManager & dofManager ) const override;
119 
120  virtual void
122  DofManager & dofManager,
123  CRSMatrix< real64, globalIndex > & localMatrix,
124  ParallelVector & rhs,
125  ParallelVector & solution,
126  bool const setSparsity = true ) override;
127 
128  virtual std::unique_ptr< PreconditionerBase< LAInterface > >
129  createPreconditioner( DomainPartition & domain ) const override;
130 
131  virtual void
133  real64 const dt,
134  DomainPartition & domain,
135  DofManager const & dofManager,
136  CRSMatrixView< real64, globalIndex const > const & localMatrix,
137  arrayView1d< real64 > const & localRhs ) override;
138 
139  virtual real64
140  calculateResidualNorm( real64 const & time_n,
141  real64 const & dt,
142  DomainPartition const & domain,
143  DofManager const & dofManager,
144  arrayView1d< real64 const > const & localRhs ) override;
145 
146  virtual void
147  applySystemSolution( DofManager const & dofManager,
148  arrayView1d< real64 const > const & localSolution,
149  real64 const scalingFactor,
150  real64 const dt,
151  DomainPartition & domain ) override;
152  virtual void
154  DomainPartition const & domain,
155  DofManager const & dofManager,
156  CRSMatrixView< real64, globalIndex const > const & localMatrix,
157  arrayView1d< real64 > const & localRhs ) override;
158 
159  virtual void
161  DomainPartition const & domain,
162  DofManager const & dofManager,
163  CRSMatrixView< real64, globalIndex const > const & localMatrix,
164  arrayView1d< real64 > const & localRhs ) override;
165  virtual void
167  real64 const dt,
168  DomainPartition const & domain,
169  DofManager const & dofManager,
170  CRSMatrixView< real64, globalIndex const > const & localMatrix,
171  arrayView1d< real64 > const & localRhs,
172  string const & jumpDofKey ) override final;
173 
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  CRSMatrixView< real64, localIndex const > const & dR_dAper ) override final;
182 
185  virtual void
186  applyAquiferBC( real64 const time,
187  real64 const dt,
188  DomainPartition & domain,
189  DofManager const & dofManager,
190  CRSMatrixView< real64, globalIndex const > const & localMatrix,
191  arrayView1d< real64 > const & localRhs ) const override;
192 
193  virtual void initializePreSubGroups() override;
194 
195 private:
196 
206  void applyFaceDirichletBC( real64 const time_n,
207  real64 const dt,
208  DofManager const & faceSet,
209  DomainPartition & domain,
210  CRSMatrixView< real64, globalIndex const > const & localMatrix,
211  arrayView1d< real64 > const & localRhs );
212 
213  // no data needed here, see SinglePhaseBase
214 
215 };
216 
217 } /* namespace geos */
218 
219 #endif //GEOS_PHYSICSSOLVERS_FLUIDFLOW_SINGLEPHASEFVM_HPP_
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...
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 std::unique_ptr< PreconditionerBase< LAInterface > > createPreconditioner(DomainPartition &domain) const override
Create a preconditioner for this solver's linear system.
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:179
LvArray::CRSMatrix< T, COL_INDEX, INDEX_TYPE, LvArray::ChaiBuffer > CRSMatrix
Alias for CRS Matrix class.
Definition: DataTypes.hpp:305
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
LAInterface::ParallelVector ParallelVector
Alias for ParallelVector.