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
42
44{
49 SIZE_TestType ///< Length of enum list
50};
51
52const char *const TestTypeMap[] = {
53 "TestPlane",
54 "TestPlaneMassConsv",
55 "TestCube",
56 "AdvectionBell",
57};
58
59namespace Nektar
60{
63{
64public:
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 ~MMFAdvection() override = default;
84
85protected:
87
90
93
94 /// Advection velocity
97
100
101 /// Session reader
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,
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 void v_InitObject(bool DeclareFields = true) override;
151
152 void v_DoSolve() override;
153
154 /// Print Summary
156
157 void v_SetInitialConditions(const NekDouble initialtime,
158 bool dumpInitialConditions,
159 const int domain) override;
160
161 void v_EvaluateExactSolution(unsigned int field,
162 Array<OneD, NekDouble> &outfield,
163 const NekDouble time) override;
164
165private:
166};
167} // namespace Nektar
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)
void GetFluxVector(const Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &flux)
Evaluate the flux at each solution point.
Array< OneD, Array< OneD, NekDouble > > m_veldotMF
Definition: MMFAdvection.h:98
void DoOdeProjection(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
Compute the projection.
void Test3Dproblem(const NekDouble time, Array< OneD, NekDouble > &outfield)
void AdvectionBellSphere(Array< OneD, NekDouble > &outfield)
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.
NekDouble ComputeCirculatingArclength(const NekDouble zlevel, const NekDouble Rhs)
MMFAdvection(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Session reader.
void WeakDGDirectionalAdvection(const Array< OneD, Array< OneD, NekDouble > > &InField, Array< OneD, Array< OneD, NekDouble > > &OutField)
void DoOdeRhs(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
Compute the RHS.
void ComputeNablaCdotVelocity(Array< OneD, NekDouble > &vellc)
void ComputeveldotMF(Array< OneD, Array< OneD, NekDouble > > &veldotMF)
void v_SetInitialConditions(const NekDouble initialtime, bool dumpInitialConditions, const int domain) override
void EvaluateAdvectionVelocity(Array< OneD, Array< OneD, NekDouble > > &velocity)
static SolverUtils::EquationSystemSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Creates an instance of this class.
Definition: MMFAdvection.h:68
~MMFAdvection() override=default
Destructor.
void v_GenerateSummary(SolverUtils::SummaryList &s) override
Print Summary.
void v_InitObject(bool DeclareFields=true) override
Initialise the object.
SolverUtils::RiemannSolverSharedPtr m_riemannSolver
Definition: MMFAdvection.h:86
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.
void v_DoSolve() override
Solves an unsteady problem.
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:144
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
double NekDouble