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 virtual ~VCSMapping();
70
71 virtual 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 virtual void v_DoInitialise(bool dumpInitialConditions = true) override;
98
99 virtual void v_SetUpPressureForcing(
100 const Array<OneD, const Array<OneD, NekDouble>> &fields,
102 const NekDouble aii_Dt) override;
103
104 virtual void v_SetUpViscousForcing(
105 const Array<OneD, const Array<OneD, NekDouble>> &inarray,
107 const NekDouble aii_Dt) override;
108
109 virtual void v_SolvePressure(
110 const Array<OneD, NekDouble> &Forcing) override;
111
112 virtual void v_SolveViscous(
114 const Array<OneD, const Array<OneD, NekDouble>> &inarray,
116 const NekDouble aii_Dt) override;
117
119 const Array<OneD, const Array<OneD, NekDouble>> &inarray,
121 const NekDouble time) override;
122
123private:
125
126 // Correction needed for convective terms = N(u) - ( -(u \nabla) u)
127 // velPhys is the velocity field (transformed for physical space)
129 const Array<OneD, const Array<OneD, NekDouble>> &velPhys,
130 Array<OneD, Array<OneD, NekDouble>> &outarray);
131
132 // Correction needed for time-derivative terms
133 // = U_coord^j u^i_,j - u^j U_coord^i_,j
134 // vel is the velocity field (can be in wavespace)
135 // velPhys is the velocity field (transformed for physical space)
137 const Array<OneD, const Array<OneD, NekDouble>> &vel,
138 const Array<OneD, const Array<OneD, NekDouble>> &velPhys,
139 Array<OneD, Array<OneD, NekDouble>> &outarray);
140
141 // Correction needed for pressure terms
142 // = -g^(ij)p_j + (\nabla p)/J for variable Jacobian
143 // = -g^(ij)p_j + (\nabla p) for constant Jacobian
144 // the pressure field can be in wavespace
146 Array<OneD, Array<OneD, NekDouble>> &outarray);
147
148 // Correction needed for viscous terms = g^jk u^i_{,jk}-(\nabla^2 u)
149 // vel is the velocity field (can be in wavespace)
150 // velPhys is the velocity field (transformed for physical space)
152 const Array<OneD, const Array<OneD, NekDouble>> &velPhys,
153 Array<OneD, Array<OneD, NekDouble>> &outarray);
154};
155
156typedef std::shared_ptr<VCSMapping> VCSMappingSharedPtr;
157
158} // namespace Nektar
159
160#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:73
virtual void v_SolvePressure(const Array< OneD, NekDouble > &Forcing) override
Definition: VCSMapping.cpp:419
virtual 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:217
void MappingViscousCorrection(const Array< OneD, const Array< OneD, NekDouble > > &velPhys, Array< OneD, Array< OneD, NekDouble > > &outarray)
Definition: VCSMapping.cpp:936
virtual ~VCSMapping()
Definition: VCSMapping.cpp:131
virtual void v_DoInitialise(bool dumpInitialConditions=true) override
Sets up initial conditions.
Definition: VCSMapping.cpp:135
virtual 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:342
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
virtual 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:174
virtual 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:557
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:910
void ApplyIncNSMappingForcing(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
Definition: VCSMapping.cpp:723
Array< OneD, Array< OneD, NekDouble > > m_presForcingCorrection
Definition: VCSMapping.h:124
VCSMapping(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Constructor.
Definition: VCSMapping.cpp:59
virtual void v_InitObject(bool DeclareField=true) override
Init object for UnsteadySystem class.
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:831
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:806
GLOBAL_MAPPING_EXPORT typedef std::shared_ptr< Mapping > MappingSharedPtr
A shared pointer to a Mapping object.
Definition: Mapping.h:53
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:176
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:2
std::shared_ptr< VCSMapping > VCSMappingSharedPtr
Definition: VCSMapping.h:156
double NekDouble