Nektar++
UnsteadyAdvectionDiffusion.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File: UnsteadyAdvectionDiffusion.h
4 //
5 // For more information, please see: http://www.nektar.info
6 //
7 // The MIT License
8 //
9 // Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
10 // Department of Aeronautics, Imperial College London (UK), and Scientific
11 // Computing and Imaging Institute, University of Utah (USA).
12 //
13 // Permission is hereby granted, free of charge, to any person obtaining a
14 // copy of this software and associated documentation files (the "Software"),
15 // to deal in the Software without restriction, including without limitation
16 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
17 // and/or sell copies of the Software, and to permit persons to whom the
18 // Software is furnished to do so, subject to the following conditions:
19 //
20 // The above copyright notice and this permission notice shall be included
21 // in all copies or substantial portions of the Software.
22 //
23 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29 // DEALINGS IN THE SOFTWARE.
30 //
31 // Description: Unsteady advection-diffusion solve routines
32 //
33 ///////////////////////////////////////////////////////////////////////////////
34 
35 #ifndef NEKTAR_SOLVERS_ADRSOLVER_EQUATIONSYSTEMS_UNSTEADYADVECTIONDIFFUSION_H
36 #define NEKTAR_SOLVERS_ADRSOLVER_EQUATIONSYSTEMS_UNSTEADYADVECTIONDIFFUSION_H
37 
43 
44 namespace Nektar
45 {
47 {
48 public:
50 
51  /// Creates an instance of this class
55  {
58  pSession, pGraph);
59  p->InitObject();
60  return p;
61  }
62  /// Name of class
63  static std::string className;
64 
65  /// Destructor
67 
68 protected:
72  // scaling factor for GJP penalisation, default = 1.0
74  NekDouble
75  m_sVVCutoffRatio; // cut off ratio from which to start decayhing modes
76  NekDouble m_sVVDiffCoeff; // Diffusion coefficient of SVV modes
81 
82  // Plane (used only for Discontinous projection
83  // with 3DHomogenoeus1D expansion)
85 
86  /// Forcing terms
87  std::vector<SolverUtils::ForcingSharedPtr> m_forcing;
88 
89  /// Session reader
93 
94  /// Evaluate the flux at each solution point for the advection part
95  void GetFluxVectorAdv(
96  const Array<OneD, Array<OneD, NekDouble>> &physfield,
98 
99  /// Evaluate the flux at each solution point for the diffusion part
100  void GetFluxVectorDiff(
101  const Array<OneD, Array<OneD, NekDouble>> &inarray,
102  const Array<OneD, Array<OneD, Array<OneD, NekDouble>>> &qfield,
103  Array<OneD, Array<OneD, Array<OneD, NekDouble>>> &viscousTensor);
104 
105  /// Compute the RHS
106  void DoOdeRhs(const Array<OneD, const Array<OneD, NekDouble>> &inarray,
107  Array<OneD, Array<OneD, NekDouble>> &outarray,
108  const NekDouble time);
109 
110  /// Perform the projection
111  void DoOdeProjection(
112  const Array<OneD, const Array<OneD, NekDouble>> &inarray,
113  Array<OneD, Array<OneD, NekDouble>> &outarray, const NekDouble time);
114 
115  /// Solve implicitly the diffusion term
116  void DoImplicitSolve(
117  const Array<OneD, const Array<OneD, NekDouble>> &inarray,
118  Array<OneD, Array<OneD, NekDouble>> &outarray, NekDouble time,
119  NekDouble lambda);
120 
121  /// Get the normal velocity based on m_velocity
123 
124  /// Get the normal velocity based on input velfield
126  const Array<OneD, const Array<OneD, NekDouble>> &velfield);
127 
128  /// Initialise the object
129  virtual void v_InitObject(bool DeclareFields = true) override;
130 
131  /// Print Summary
132  virtual void v_GenerateSummary(SolverUtils::SummaryList &s) override;
133 
134  /// PreIntegration step for substepping.
135  virtual bool v_PreIntegrate(int step) override;
136 
137  // SubsStepping methods -> Probably could be set up in separate class
138  void SubStepAdvance(int nstep, NekDouble time);
141  const LibUtilities::TimeIntegrationSchemeSharedPtr &IntegrationScheme);
142 
143  void SubStepAdvection(
144  const Array<OneD, const Array<OneD, NekDouble>> &inarray,
145  Array<OneD, Array<OneD, NekDouble>> &outarray, const NekDouble time);
146 
147  void SubStepProjection(
148  const Array<OneD, const Array<OneD, NekDouble>> &inarray,
149  Array<OneD, Array<OneD, NekDouble>> &outarray, const NekDouble time);
150 
152  const Array<OneD, const Array<OneD, NekDouble>> &velfield,
153  const Array<OneD, const Array<OneD, NekDouble>> &physfield,
154  Array<OneD, Array<OneD, NekDouble>> &Outarray);
155 
157  const Array<OneD, Array<OneD, NekDouble>> inarray);
158 
161 
163 
167 
168 private:
171 };
172 } // namespace Nektar
173 
174 #endif
Binds a set of functions for use by time integration schemes.
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
A base class for PDEs which include an advection component.
void GetFluxVectorAdv(const Array< OneD, Array< OneD, NekDouble >> &physfield, Array< OneD, Array< OneD, Array< OneD, NekDouble >>> &flux)
Evaluate the flux at each solution point for the advection part.
UnsteadyAdvectionDiffusion(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Session reader.
void DoOdeRhs(const Array< OneD, const Array< OneD, NekDouble >> &inarray, Array< OneD, Array< OneD, NekDouble >> &outarray, const NekDouble time)
Compute the RHS.
SolverUtils::DiffusionSharedPtr m_diffusion
Array< OneD, NekDouble > & GetNormalVelocity()
Get the normal velocity based on m_velocity.
void AddAdvectionPenaltyFlux(const Array< OneD, const Array< OneD, NekDouble >> &velfield, const Array< OneD, const Array< OneD, NekDouble >> &physfield, Array< OneD, Array< OneD, NekDouble >> &Outarray)
virtual bool v_PreIntegrate(int step) override
PreIntegration step for substepping.
void SubStepAdvection(const Array< OneD, const Array< OneD, NekDouble >> &inarray, Array< OneD, Array< OneD, NekDouble >> &outarray, const NekDouble time)
virtual void v_InitObject(bool DeclareFields=true) override
Initialise the object.
Array< OneD, Array< OneD, NekDouble > > m_velocity
void DoImplicitSolve(const Array< OneD, const Array< OneD, NekDouble >> &inarray, Array< OneD, Array< OneD, NekDouble >> &outarray, NekDouble time, NekDouble lambda)
Solve implicitly the diffusion term.
void SetUpSubSteppingTimeIntegration(const LibUtilities::TimeIntegrationSchemeSharedPtr &IntegrationScheme)
std::vector< SolverUtils::ForcingSharedPtr > m_forcing
Forcing terms.
void DoOdeProjection(const Array< OneD, const Array< OneD, NekDouble >> &inarray, Array< OneD, Array< OneD, NekDouble >> &outarray, const NekDouble time)
Perform the projection.
Array< OneD, NekDouble > GetMaxStdVelocity(const Array< OneD, Array< OneD, NekDouble >> inarray)
static SolverUtils::EquationSystemSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Creates an instance of this class.
void SubStepAdvance(int nstep, NekDouble time)
void GetFluxVectorDiff(const Array< OneD, Array< OneD, NekDouble >> &inarray, const Array< OneD, Array< OneD, Array< OneD, NekDouble >>> &qfield, Array< OneD, Array< OneD, Array< OneD, NekDouble >>> &viscousTensor)
Evaluate the flux at each solution point for the diffusion part.
static std::string className
Name of class.
SolverUtils::RiemannSolverSharedPtr m_riemannSolver
virtual void v_GenerateSummary(SolverUtils::SummaryList &s) override
Print Summary.
LibUtilities::TimeIntegrationSchemeSharedPtr m_subStepIntegrationScheme
Array< OneD, NekDouble > & GetNormalVel(const Array< OneD, const Array< OneD, NekDouble >> &velfield)
Get the normal velocity based on input velfield.
void SubStepProjection(const Array< OneD, const Array< OneD, NekDouble >> &inarray, Array< OneD, Array< OneD, NekDouble >> &outarray, const NekDouble time)
LibUtilities::TimeIntegrationSchemeOperators m_subStepIntegrationOps
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::shared_ptr< TimeIntegrationScheme > TimeIntegrationSchemeSharedPtr
std::shared_ptr< RiemannSolver > RiemannSolverSharedPtr
A shared pointer to an EquationSystem object.
std::vector< std::pair< std::string, std::string > > SummaryList
Definition: Misc.h:48
std::shared_ptr< EquationSystem > EquationSystemSharedPtr
A shared pointer to an EquationSystem object.
std::shared_ptr< SolverUtils::Diffusion > DiffusionSharedPtr
A shared pointer to an EquationSystem object.
Definition: Diffusion.h:550
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
Definition: MeshGraph.h:172
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:2
double NekDouble