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{
61
64{
65public:
66 friend class MemoryManager<MMFAdvection>;
67
68 /// Creates an instance of this class
72 {
75 p->InitObject();
76 return p;
77 }
78
79 /// Name of class
80 static std::string className;
81
82protected:
93
96
97 ~MMFAdvection() override = default;
98
99 /// Initialise the object
100 void v_InitObject(bool DeclareFields = true) override;
101
103 const Array<OneD, Array<OneD, NekDouble>> &InField,
104 Array<OneD, Array<OneD, NekDouble>> &OutField);
105
106 /// Get the normal velocity
108
109 /// Compute the RHS
110 void DoOdeRhs(const Array<OneD, const Array<OneD, NekDouble>> &inarray,
112 const NekDouble time);
113
114 /// Compute the projection
115 void DoOdeProjection(
116 const Array<OneD, const Array<OneD, NekDouble>> &inarray,
117 Array<OneD, Array<OneD, NekDouble>> &outarray, const NekDouble time);
118
119 /// Evaluate the flux at each solution point
120 void GetFluxVector(const Array<OneD, Array<OneD, NekDouble>> &physfield,
122
123 /// Evaluate the flux at each solution point using dealiasing
125 const Array<OneD, Array<OneD, NekDouble>> &physfield,
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
137
139
142
143 void Test2Dproblem(const NekDouble time, Array<OneD, NekDouble> &outfield);
144 void Test3Dproblem(const NekDouble time, Array<OneD, NekDouble> &outfield);
145
146 void v_DoSolve() override;
147
148 /// Print Summary
150
151 void v_SetInitialConditions(const NekDouble initialtime,
152 bool dumpInitialConditions,
153 const int domain) override;
154
155 void v_EvaluateExactSolution(unsigned int field,
156 Array<OneD, NekDouble> &outfield,
157 const NekDouble time) override;
158};
159
160} // namespace Nektar
161
162#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:91
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)
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:69
~MMFAdvection() override=default
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:83
void v_EvaluateExactSolution(unsigned int field, Array< OneD, NekDouble > &outfield, const NekDouble time) override
Array< OneD, Array< OneD, NekDouble > > m_velocity
Definition: MMFAdvection.h:89
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:80
Array< OneD, NekDouble > m_vellc
Definition: MMFAdvection.h:92
void AdvectionBellPlane(Array< OneD, NekDouble > &outfield)
Array< OneD, NekDouble > m_traceVn
Definition: MMFAdvection.h:90
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