Nektar++
MMFAdvection.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File MMFAdvection.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: MMF advection solve routines
32 //
33 ///////////////////////////////////////////////////////////////////////////////
34 
35 #ifndef NEKTAR_SOLVERS_ADRSOLVER_EQUATIONSYSTEMS_MMFADVECTION_H
36 #define NEKTAR_SOLVERS_ADRSOLVER_EQUATIONSYSTEMS_MMFADVECTION_H
37 
39 #include <SolverUtils/MMFSystem.h>
42 
44 {
49  SIZE_TestType ///< Length of enum list
50 };
51 
52 const char *const TestTypeMap[] = {
53  "TestPlane", "TestPlaneMassConsv", "TestCube", "AdvectionBell",
54 };
55 
56 namespace Nektar
57 {
59 {
60 public:
61  friend class MemoryManager<MMFAdvection>;
62 
63  /// Creates an instance of this class
67  {
70  p->InitObject();
71  return p;
72  }
73  /// Name of class
74  static std::string className;
75 
77 
78  /// Destructor
79  virtual ~MMFAdvection();
80 
81 protected:
83 
86 
89 
90  /// Advection velocity
93 
96 
97  // Plane (used only for Discontinous projection
98  // with 3DHomogenoeus1D expansion)
100 
101  /// Session reader
103  const SpatialDomains::MeshGraphSharedPtr& pGraph);
104 
106  const Array<OneD, Array<OneD, NekDouble>> &InField,
107  Array<OneD, Array<OneD, NekDouble>> &OutField);
108 
109  /// Evaluate the flux at each solution point
110  void GetFluxVector(const Array<OneD, Array<OneD, NekDouble>> &physfield,
112 
113  /// Evaluate the flux at each solution point using dealiasing
115  const Array<OneD, Array<OneD, NekDouble>> &physfield,
117 
118  /// Compute the RHS
119  void DoOdeRhs(const Array<OneD, const Array<OneD, NekDouble>> &inarray,
120  Array<OneD, Array<OneD, NekDouble>> &outarray,
121  const NekDouble time);
122 
123  /// Compute the projection
124  void DoOdeProjection(
125  const Array<OneD, const Array<OneD, NekDouble>> &inarray,
126  Array<OneD, Array<OneD, NekDouble>> &outarray, const NekDouble time);
127 
128  // Compute the velocity vector
130  Array<OneD, Array<OneD, NekDouble>> &velocity);
131 
132  // Compute arclenght of the surface at zlebel
134  const NekDouble Rhs);
135 
136  /// Get the normal velocity
138 
140 
142 
145 
146  void Test2Dproblem(const NekDouble time, Array<OneD, NekDouble> &outfield);
147  void Test3Dproblem(const NekDouble time, Array<OneD, NekDouble> &outfield);
148 
149  /// Initialise the object
150  virtual void v_InitObject();
151 
152  virtual void v_DoSolve();
153 
154  /// Print Summary
156 
157  virtual void v_SetInitialConditions(const NekDouble initialtime,
158  bool dumpInitialConditions,
159  const int domain);
160 
161  virtual void v_EvaluateExactSolution(unsigned int field,
162  Array<OneD, NekDouble> &outfield,
163  const NekDouble time);
164 
165 private:
166 };
167 }
168 
169 #endif
const char *const TestTypeMap[]
Definition: MMFAdvection.h:52
TestType
Definition: MMFAdvection.h:44
@ SIZE_TestType
Length of enum list.
Definition: MMFAdvection.h:49
@ eTestPlaneMassConsv
Definition: MMFAdvection.h:46
@ eTestPlane
Definition: MMFAdvection.h:45
@ eAdvectionBell
Definition: MMFAdvection.h:48
@ eTestCube
Definition: MMFAdvection.h:47
void Test2Dproblem(const NekDouble time, Array< OneD, NekDouble > &outfield)
virtual void v_DoSolve()
Solves an unsteady problem.
virtual ~MMFAdvection()
Destructor.
Array< OneD, Array< OneD, NekDouble > > m_veldotMF
Definition: MMFAdvection.h:94
void Test3Dproblem(const NekDouble time, Array< OneD, NekDouble > &outfield)
void AdvectionBellSphere(Array< OneD, NekDouble > &outfield)
NekDouble ComputeCirculatingArclength(const NekDouble zlevel, const NekDouble Rhs)
MMFAdvection(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Session reader.
void ComputeNablaCdotVelocity(Array< OneD, NekDouble > &vellc)
virtual void v_GenerateSummary(SolverUtils::SummaryList &s)
Print Summary.
void EvaluateAdvectionVelocity(Array< OneD, Array< OneD, NekDouble >> &velocity)
void DoOdeRhs(const Array< OneD, const Array< OneD, NekDouble >> &inarray, Array< OneD, Array< OneD, NekDouble >> &outarray, const NekDouble time)
Compute the RHS.
void DoOdeProjection(const Array< OneD, const Array< OneD, NekDouble >> &inarray, Array< OneD, Array< OneD, NekDouble >> &outarray, const NekDouble time)
Compute the projection.
virtual void v_EvaluateExactSolution(unsigned int field, Array< OneD, NekDouble > &outfield, const NekDouble time)
void WeakDGDirectionalAdvection(const Array< OneD, Array< OneD, NekDouble >> &InField, Array< OneD, Array< OneD, NekDouble >> &OutField)
void GetFluxVector(const Array< OneD, Array< OneD, NekDouble >> &physfield, Array< OneD, Array< OneD, Array< OneD, NekDouble >>> &flux)
Evaluate the flux at each solution point.
void ComputeveldotMF(Array< OneD, Array< OneD, NekDouble >> &veldotMF)
static SolverUtils::EquationSystemSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Creates an instance of this class.
Definition: MMFAdvection.h:64
SolverUtils::RiemannSolverSharedPtr m_riemannSolver
Definition: MMFAdvection.h:82
Array< OneD, Array< OneD, NekDouble > > m_velocity
Advection velocity.
Definition: MMFAdvection.h:91
Array< OneD, NekDouble > & GetNormalVelocity()
Get the normal velocity.
virtual void v_InitObject()
Initialise the object.
virtual void v_SetInitialConditions(const NekDouble initialtime, bool dumpInitialConditions, const int domain)
void GetFluxVectorDeAlias(const Array< OneD, Array< OneD, NekDouble >> &physfield, Array< OneD, Array< OneD, Array< OneD, NekDouble >>> &flux)
Evaluate the flux at each solution point using dealiasing.
static std::string className
Name of class.
Definition: MMFAdvection.h:74
Array< OneD, NekDouble > m_vellc
Definition: MMFAdvection.h:95
void AdvectionBellPlane(Array< OneD, NekDouble > &outfield)
Array< OneD, NekDouble > m_traceVn
Definition: MMFAdvection.h:92
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.
A base class for PDEs which include an advection component.
Definition: MMFSystem.h:141
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::shared_ptr< RiemannSolver > RiemannSolverSharedPtr
A shared pointer to an EquationSystem object.
std::vector< std::pair< std::string, std::string > > SummaryList
Definition: Misc.h:46
std::shared_ptr< EquationSystem > EquationSystemSharedPtr
A shared pointer to an EquationSystem object.
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
Definition: MeshGraph.h:174
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:1
double NekDouble