Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 // License for the specific language governing rights and limitations under
14 // Permission is hereby granted, free of charge, to any person obtaining a
15 // copy of this software and associated documentation files (the "Software"),
16 // to deal in the Software without restriction, including without limitation
17 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
18 // and/or sell copies of the Software, and to permit persons to whom the
19 // Software is furnished to do so, subject to the following conditions:
20 //
21 // The above copyright notice and this permission notice shall be included
22 // in all copies or substantial portions of the Software.
23 //
24 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
25 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
27 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
29 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
30 // DEALINGS IN THE SOFTWARE.
31 //
32 // Description: Velocity Correction Scheme with coordinate transformation header
33 //
34 ///////////////////////////////////////////////////////////////////////////////
35 
36 #ifndef NEKTAR_SOLVERS_VCSMAPPING_H
37 #define NEKTAR_SOLVERS_VCSMAPPING_H
38 
40 #include <GlobalMapping/Mapping.h>
41 
42 namespace Nektar
43 {
45  {
46  public:
47 
48  /// Creates an instance of this class
50  const LibUtilities::SessionReaderSharedPtr& pSession) {
53  AllocateSharedPtr(pSession);
54  p->InitObject();
55  return p;
56  }
57 
58  /// Name of class
59  static std::string className;
60 
61 
62  /// Constructor.
64 
65  //
67  Array<OneD, Array<OneD, NekDouble> > &outarray);
68 
69  virtual ~VCSMapping();
70 
71  virtual void v_InitObject();
72 
73  protected:
74  // Mapping object
76 
77  bool m_verbose;
78 
79  // Flags defining how pressure and viscous mapping terms
80  //should be treated
84  // Tolerance and relaxation parameters for pressure and viscous
85  // systems (when solved iteratively)
90 
91  // Pressure gradient (to avoid duplicate calculations)
93 
94  // Virtual functions
95  virtual void v_DoInitialise(void);
96 
97 
98  virtual void v_SetUpPressureForcing(
99  const Array<OneD, const Array<OneD, NekDouble> > &fields,
100  Array<OneD, Array<OneD, NekDouble> > &Forcing,
101  const NekDouble aii_Dt);
102 
103  virtual void v_SetUpViscousForcing(
104  const Array<OneD, const Array<OneD, NekDouble> > &inarray,
105  Array<OneD, Array<OneD, NekDouble> > &Forcing,
106  const NekDouble aii_Dt);
107 
108  virtual void v_SolvePressure( const Array<OneD, NekDouble> &Forcing);
109 
110  virtual void v_SolveViscous(
111  const Array<OneD, const Array<OneD, NekDouble> > &Forcing,
112  Array<OneD, Array<OneD, NekDouble> > &outarray,
113  const NekDouble aii_Dt);
114 
116  const Array<OneD, const Array<OneD, NekDouble> > &inarray,
117  Array<OneD, Array<OneD, NekDouble> > &outarray,
118  const NekDouble time);
119 
120  private:
122 
123  // Correction needed for convective terms = N(u) - ( -(u \nabla) u)
124  // velPhys is the velocity field (transformed for physical space)
126  const Array<OneD, Array<OneD, NekDouble> > &velPhys,
127  Array<OneD, Array<OneD, NekDouble> > &outarray);
128 
129  // Correction needed for time-derivative terms
130  // = U_coord^j u^i_,j - u^j U_coord^i_,j
131  // vel is the velocity field (can be in wavespace)
132  // velPhys is the velocity field (transformed for physical space)
134  const Array<OneD, Array<OneD, NekDouble> > &vel,
135  const Array<OneD, Array<OneD, NekDouble> > &velPhys,
136  Array<OneD, Array<OneD, NekDouble> > &outarray);
137 
138  // Correction needed for pressure terms
139  // = -g^(ij)p_j + (\nabla p)/J for variable Jacobian
140  // = -g^(ij)p_j + (\nabla p) for constant Jacobian
141  // the pressure field can be in wavespace
143  Array<OneD, Array<OneD, NekDouble> > &outarray);
144 
145  // Correction needed for viscous terms = g^jk u^i_{,jk}-(\nabla^2 u)
146  // vel is the velocity field (can be in wavespace)
147  // velPhys is the velocity field (transformed for physical space)
149  const Array<OneD, Array<OneD, NekDouble> > &velPhys,
150  Array<OneD, Array<OneD, NekDouble> > &outarray);
151 
152  };
153 
154  typedef boost::shared_ptr<VCSMapping>
156 
157 } //end of namespace
158 
159 
160 #endif //VELOCITY_CORRECTION_SCHEME_H
virtual void v_InitObject()
Init object for UnsteadySystem class.
Definition: VCSMapping.cpp:63
NekDouble m_pressureTolerance
Definition: VCSMapping.h:86
virtual void v_DoInitialise(void)
Sets up initial conditions.
Definition: VCSMapping.cpp:145
void ApplyIncNSMappingForcing(Array< OneD, Array< OneD, NekDouble > > &outarray)
Definition: VCSMapping.cpp:739
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
VCSMapping(const LibUtilities::SessionReaderSharedPtr &pSession)
Constructor.
Definition: VCSMapping.cpp:55
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:572
void MappingAccelerationCorrection(const Array< OneD, Array< OneD, NekDouble > > &vel, const Array< OneD, Array< OneD, NekDouble > > &velPhys, Array< OneD, Array< OneD, NekDouble > > &outarray)
Definition: VCSMapping.cpp:846
GlobalMapping::MappingSharedPtr m_mapping
Definition: VCSMapping.h:75
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:351
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
Definition: MeshPartition.h:51
NekDouble m_viscousRelaxation
Definition: VCSMapping.h:89
void MappingViscousCorrection(const Array< OneD, Array< OneD, NekDouble > > &velPhys, Array< OneD, Array< OneD, NekDouble > > &outarray)
Definition: VCSMapping.cpp:952
Array< OneD, Array< OneD, NekDouble > > m_gradP
Definition: VCSMapping.h:92
boost::shared_ptr< EquationSystem > EquationSystemSharedPtr
A shared pointer to an EquationSystem object.
virtual void v_SolvePressure(const Array< OneD, NekDouble > &Forcing)
Definition: VCSMapping.cpp:428
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:232
static SolverUtils::EquationSystemSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession)
Creates an instance of this class.
Definition: VCSMapping.h:49
double NekDouble
Array< OneD, Array< OneD, NekDouble > > m_presForcingCorrection
Definition: VCSMapping.h:121
virtual ~VCSMapping()
Definition: VCSMapping.cpp:141
GLOBAL_MAPPING_EXPORT typedef boost::shared_ptr< Mapping > MappingSharedPtr
A shared pointer to a Mapping object.
Definition: Mapping.h:51
void MappingAdvectionCorrection(const Array< OneD, Array< OneD, NekDouble > > &velPhys, Array< OneD, Array< OneD, NekDouble > > &outarray)
Definition: VCSMapping.cpp:821
static std::string className
Name of class.
Definition: VCSMapping.h:59
void MappingPressureCorrection(Array< OneD, Array< OneD, NekDouble > > &outarray)
Definition: VCSMapping.cpp:925
boost::shared_ptr< VCSMapping > VCSMappingSharedPtr
Definition: VCSMapping.h:155
NekDouble m_viscousTolerance
Definition: VCSMapping.h:87
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:186
NekDouble m_pressureRelaxation
Definition: VCSMapping.h:88