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 
39 #include <GlobalMapping/Mapping.h>
40 
41 namespace Nektar
42 {
44  {
45  public:
46 
47  /// Creates an instance of this class
51  {
54  p->InitObject();
55  return p;
56  }
57 
58  /// Name of class
59  static std::string className;
60 
61 
62  /// Constructor.
65 
66  //
68  const Array<OneD, const Array<OneD, NekDouble> > &inarray,
69  Array<OneD, Array<OneD, NekDouble> > &outarray);
70 
71  virtual ~VCSMapping();
72 
73  virtual void v_InitObject();
74 
75  protected:
76  // Mapping object
78 
79  bool m_verbose;
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(void);
98 
99 
100  virtual void v_SetUpPressureForcing(
101  const Array<OneD, const Array<OneD, NekDouble> > &fields,
103  const NekDouble aii_Dt);
104 
105  virtual void v_SetUpViscousForcing(
106  const Array<OneD, const Array<OneD, NekDouble> > &inarray,
108  const NekDouble aii_Dt);
109 
110  virtual void v_SolvePressure( const Array<OneD, NekDouble> &Forcing);
111 
112  virtual void v_SolveViscous(
113  const Array<OneD, const Array<OneD, NekDouble> > &Forcing,
114  Array<OneD, Array<OneD, NekDouble> > &outarray,
115  const NekDouble aii_Dt);
116 
118  const Array<OneD, const Array<OneD, NekDouble> > &inarray,
119  Array<OneD, Array<OneD, NekDouble> > &outarray,
120  const NekDouble time);
121 
122  private:
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  };
155 
156  typedef std::shared_ptr<VCSMapping>
158 
159 } //end of namespace
160 
161 
162 #endif //VELOCITY_CORRECTION_SCHEME_H
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
Definition: MeshGraph.h:163
virtual void v_InitObject()
Init object for UnsteadySystem class.
Definition: VCSMapping.cpp:65
NekDouble m_pressureTolerance
Definition: VCSMapping.h:88
virtual void v_DoInitialise(void)
Sets up initial conditions.
Definition: VCSMapping.cpp:153
void ApplyIncNSMappingForcing(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
Definition: VCSMapping.cpp:755
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:863
virtual void v_SolveViscous(const Array< OneD, const Array< OneD, NekDouble > > &Forcing, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble aii_Dt)
Definition: VCSMapping.cpp:588
void MappingAdvectionCorrection(const Array< OneD, const Array< OneD, NekDouble > > &velPhys, Array< OneD, Array< OneD, NekDouble > > &outarray)
Definition: VCSMapping.cpp:838
GlobalMapping::MappingSharedPtr m_mapping
Definition: VCSMapping.h:77
virtual void v_SetUpViscousForcing(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &Forcing, const NekDouble aii_Dt)
Definition: VCSMapping.cpp:367
NekDouble m_viscousRelaxation
Definition: VCSMapping.h:91
Array< OneD, Array< OneD, NekDouble > > m_gradP
Definition: VCSMapping.h:94
void MappingViscousCorrection(const Array< OneD, const Array< OneD, NekDouble > > &velPhys, Array< OneD, Array< OneD, NekDouble > > &outarray)
Definition: VCSMapping.cpp:969
virtual void v_SolvePressure(const Array< OneD, NekDouble > &Forcing)
Definition: VCSMapping.cpp:444
virtual void v_SetUpPressureForcing(const Array< OneD, const Array< OneD, NekDouble > > &fields, Array< OneD, Array< OneD, NekDouble > > &Forcing, const NekDouble aii_Dt)
Definition: VCSMapping.cpp:241
static SolverUtils::EquationSystemSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Creates an instance of this class.
Definition: VCSMapping.h:48
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
double NekDouble
Array< OneD, Array< OneD, NekDouble > > m_presForcingCorrection
Definition: VCSMapping.h:123
virtual ~VCSMapping()
Definition: VCSMapping.cpp:149
static std::string className
Name of class.
Definition: VCSMapping.h:59
void MappingPressureCorrection(Array< OneD, Array< OneD, NekDouble > > &outarray)
Definition: VCSMapping.cpp:942
std::shared_ptr< VCSMapping > VCSMappingSharedPtr
Definition: VCSMapping.h:157
NekDouble m_viscousTolerance
Definition: VCSMapping.h:89
VCSMapping(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Constructor.
Definition: VCSMapping.cpp:56
Defines a forcing term to be explicitly applied.
Definition: Forcing.h:72
GLOBAL_MAPPING_EXPORT typedef std::shared_ptr< Mapping > MappingSharedPtr
A shared pointer to a Mapping object.
Definition: Mapping.h:50
std::shared_ptr< SessionReader > SessionReaderSharedPtr
virtual void v_EvaluateAdvection_SetPressureBCs(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
Definition: VCSMapping.cpp:196
NekDouble m_pressureRelaxation
Definition: VCSMapping.h:90
std::shared_ptr< EquationSystem > EquationSystemSharedPtr
A shared pointer to an EquationSystem object.