Nektar++
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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",
54  "TestPlaneMassConsv",
55  "TestCube",
56  "AdvectionBell",
57 };
58 
59 namespace Nektar
60 {
63 {
64 public:
65  friend class MemoryManager<MMFAdvection>;
66 
67  /// Creates an instance of this class
71  {
74  p->InitObject();
75  return p;
76  }
77  /// Name of class
78  static std::string className;
79 
81 
82  /// Destructor
83  virtual ~MMFAdvection();
84 
85 protected:
87 
90 
93 
94  /// Advection velocity
97 
100 
101  // Plane (used only for Discontinous projection
102  // with 3DHomogenoeus1D expansion)
104 
105  /// Session reader
107  const SpatialDomains::MeshGraphSharedPtr &pGraph);
108 
110  const Array<OneD, Array<OneD, NekDouble>> &InField,
111  Array<OneD, Array<OneD, NekDouble>> &OutField);
112 
113  /// Evaluate the flux at each solution point
114  void GetFluxVector(const Array<OneD, Array<OneD, NekDouble>> &physfield,
116 
117  /// Evaluate the flux at each solution point using dealiasing
119  const Array<OneD, Array<OneD, NekDouble>> &physfield,
121 
122  /// Compute the RHS
123  void DoOdeRhs(const Array<OneD, const Array<OneD, NekDouble>> &inarray,
124  Array<OneD, Array<OneD, NekDouble>> &outarray,
125  const NekDouble time);
126 
127  /// Compute the projection
128  void DoOdeProjection(
129  const Array<OneD, const Array<OneD, NekDouble>> &inarray,
130  Array<OneD, Array<OneD, NekDouble>> &outarray, const NekDouble time);
131 
132  // Compute the velocity vector
134  Array<OneD, Array<OneD, NekDouble>> &velocity);
135 
136  // Compute arclenght of the surface at zlebel
138  const NekDouble Rhs);
139 
140  /// Get the normal velocity
142 
144 
146 
149 
150  void Test2Dproblem(const NekDouble time, Array<OneD, NekDouble> &outfield);
151  void Test3Dproblem(const NekDouble time, Array<OneD, NekDouble> &outfield);
152 
153  /// Initialise the object
154  virtual void v_InitObject(bool DeclareFields = true) override;
155 
156  virtual void v_DoSolve() override;
157 
158  /// Print Summary
159  virtual void v_GenerateSummary(SolverUtils::SummaryList &s) override;
160 
161  virtual void v_SetInitialConditions(const NekDouble initialtime,
162  bool dumpInitialConditions,
163  const int domain) override;
164 
165  virtual void v_EvaluateExactSolution(unsigned int field,
166  Array<OneD, NekDouble> &outfield,
167  const NekDouble time) override;
168 
169 private:
170 };
171 } // namespace Nektar
172 
173 #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 ~MMFAdvection()
Destructor.
Array< OneD, Array< OneD, NekDouble > > m_veldotMF
Definition: MMFAdvection.h:98
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)
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.
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.
virtual void v_SetInitialConditions(const NekDouble initialtime, bool dumpInitialConditions, const int domain) override
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:68
virtual void v_GenerateSummary(SolverUtils::SummaryList &s) override
Print Summary.
virtual void v_InitObject(bool DeclareFields=true) override
Initialise the object.
SolverUtils::RiemannSolverSharedPtr m_riemannSolver
Definition: MMFAdvection.h:86
virtual void v_EvaluateExactSolution(unsigned int field, Array< OneD, NekDouble > &outfield, const NekDouble time) override
Array< OneD, Array< OneD, NekDouble > > m_velocity
Advection velocity.
Definition: MMFAdvection.h:95
Array< OneD, NekDouble > & GetNormalVelocity()
Get the normal velocity.
virtual void v_DoSolve() override
Solves an unsteady problem.
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:78
Array< OneD, NekDouble > m_vellc
Definition: MMFAdvection.h:99
void AdvectionBellPlane(Array< OneD, NekDouble > &outfield)
Array< OneD, NekDouble > m_traceVn
Definition: MMFAdvection.h:96
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:147
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:48
std::shared_ptr< EquationSystem > EquationSystemSharedPtr
A shared pointer to an EquationSystem object.
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