Nektar++
VCSMapping.h
Go to the documentation of this file.
1///////////////////////////////////////////////////////////////////////////////
2//
3// File: VCSMapping.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: Velocity Correction Scheme with coordinate transformation header
32//
33///////////////////////////////////////////////////////////////////////////////
34
35#ifndef NEKTAR_SOLVERS_VCSMAPPING_H
36#define NEKTAR_SOLVERS_VCSMAPPING_H
37
40
41namespace Nektar
42{
44{
45public:
46 /// Creates an instance of this class
50 {
53 p->InitObject();
54 return p;
55 }
56
57 /// Name of class
58 static std::string className;
59
60 /// Constructor.
63
64 //
66 const Array<OneD, const Array<OneD, NekDouble>> &inarray,
68
69 ~VCSMapping() override;
70
71 void v_InitObject(bool DeclareField = true) override;
72
73protected:
74 // Mapping object
76
77 static std::string solverTypeLookupId;
78
80
81 // Flags defining how pressure and viscous mapping terms
82 // should be treated
86 // Tolerance and relaxation parameters for pressure and viscous
87 // systems (when solved iteratively)
92
93 // Pressure gradient (to avoid duplicate calculations)
95
96 // Virtual functions
97 void v_DoInitialise(bool dumpInitialConditions = true) override;
98
100 const Array<OneD, const Array<OneD, NekDouble>> &fields,
102 const NekDouble aii_Dt) override;
103
105 const Array<OneD, const Array<OneD, NekDouble>> &inarray,
107 const NekDouble aii_Dt) override;
108
109 void v_SolvePressure(const Array<OneD, NekDouble> &Forcing) override;
110
111 void v_SolveViscous(
113 const Array<OneD, const Array<OneD, NekDouble>> &inarray,
115 const NekDouble aii_Dt) override;
116
118 const Array<OneD, const Array<OneD, NekDouble>> &inarray,
120 const NekDouble time) override;
121
122private:
124
125 // Correction needed for convective terms = N(u) - ( -(u \nabla) u)
126 // velPhys is the velocity field (transformed for physical space)
128 const Array<OneD, const Array<OneD, NekDouble>> &velPhys,
129 Array<OneD, Array<OneD, NekDouble>> &outarray);
130
131 // Correction needed for time-derivative terms
132 // = U_coord^j u^i_,j - u^j U_coord^i_,j
133 // vel is the velocity field (can be in wavespace)
134 // velPhys is the velocity field (transformed for physical space)
136 const Array<OneD, const Array<OneD, NekDouble>> &vel,
137 const Array<OneD, const Array<OneD, NekDouble>> &velPhys,
138 Array<OneD, Array<OneD, NekDouble>> &outarray);
139
140 // Correction needed for pressure terms
141 // = -g^(ij)p_j + (\nabla p)/J for variable Jacobian
142 // = -g^(ij)p_j + (\nabla p) for constant Jacobian
143 // the pressure field can be in wavespace
145 Array<OneD, Array<OneD, NekDouble>> &outarray);
146
147 // Correction needed for viscous terms = g^jk u^i_{,jk}-(\nabla^2 u)
148 // vel is the velocity field (can be in wavespace)
149 // velPhys is the velocity field (transformed for physical space)
151 const Array<OneD, const Array<OneD, NekDouble>> &velPhys,
152 Array<OneD, Array<OneD, NekDouble>> &outarray);
153};
154
155typedef std::shared_ptr<VCSMapping> VCSMappingSharedPtr;
156
157} // namespace Nektar
158
159#endif // VELOCITY_CORRECTION_SCHEME_H
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
Defines a forcing term to be explicitly applied.
Definition: Forcing.h:71
void v_SolvePressure(const Array< OneD, NekDouble > &Forcing) override
Definition: VCSMapping.cpp:420
void v_SetUpPressureForcing(const Array< OneD, const Array< OneD, NekDouble > > &fields, Array< OneD, Array< OneD, NekDouble > > &Forcing, const NekDouble aii_Dt) override
Definition: VCSMapping.cpp:218
void MappingViscousCorrection(const Array< OneD, const Array< OneD, NekDouble > > &velPhys, Array< OneD, Array< OneD, NekDouble > > &outarray)
Definition: VCSMapping.cpp:935
void v_DoInitialise(bool dumpInitialConditions=true) override
Sets up initial conditions.
Definition: VCSMapping.cpp:136
void v_SetUpViscousForcing(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &Forcing, const NekDouble aii_Dt) override
Definition: VCSMapping.cpp:343
NekDouble m_pressureTolerance
Definition: VCSMapping.h:88
NekDouble m_viscousRelaxation
Definition: VCSMapping.h:91
static std::string className
Name of class.
Definition: VCSMapping.h:58
NekDouble m_pressureRelaxation
Definition: VCSMapping.h:90
static SolverUtils::EquationSystemSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Creates an instance of this class.
Definition: VCSMapping.h:47
NekDouble m_viscousTolerance
Definition: VCSMapping.h:89
void v_EvaluateAdvection_SetPressureBCs(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time) override
Definition: VCSMapping.cpp:175
void v_SolveViscous(const Array< OneD, const Array< OneD, NekDouble > > &Forcing, const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble aii_Dt) override
Definition: VCSMapping.cpp:558
~VCSMapping() override
Definition: VCSMapping.cpp:132
static std::string solverTypeLookupId
Definition: VCSMapping.h:77
GlobalMapping::MappingSharedPtr m_mapping
Definition: VCSMapping.h:75
void MappingPressureCorrection(Array< OneD, Array< OneD, NekDouble > > &outarray)
Definition: VCSMapping.cpp:909
void ApplyIncNSMappingForcing(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
Definition: VCSMapping.cpp:722
Array< OneD, Array< OneD, NekDouble > > m_presForcingCorrection
Definition: VCSMapping.h:123
VCSMapping(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Constructor.
Definition: VCSMapping.cpp:59
void v_InitObject(bool DeclareField=true) override
Initialisation object for EquationSystem.
Definition: VCSMapping.cpp:66
void MappingAccelerationCorrection(const Array< OneD, const Array< OneD, NekDouble > > &vel, const Array< OneD, const Array< OneD, NekDouble > > &velPhys, Array< OneD, Array< OneD, NekDouble > > &outarray)
Definition: VCSMapping.cpp:830
Array< OneD, Array< OneD, NekDouble > > m_gradP
Definition: VCSMapping.h:94
void MappingAdvectionCorrection(const Array< OneD, const Array< OneD, NekDouble > > &velPhys, Array< OneD, Array< OneD, NekDouble > > &outarray)
Definition: VCSMapping.cpp:805
GLOBAL_MAPPING_EXPORT typedef std::shared_ptr< Mapping > MappingSharedPtr
A shared pointer to a Mapping object.
Definition: Mapping.h:51
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::shared_ptr< EquationSystem > EquationSystemSharedPtr
A shared pointer to an EquationSystem object.
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
Definition: MeshGraph.h:174
std::shared_ptr< VCSMapping > VCSMappingSharedPtr
Definition: VCSMapping.h:155
double NekDouble