Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties 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  const Array<OneD, const Array<OneD, NekDouble> > &inarray,
68  Array<OneD, Array<OneD, NekDouble> > &outarray);
69 
70  virtual ~VCSMapping();
71 
72  virtual void v_InitObject();
73 
74  protected:
75  // Mapping object
77 
78  bool m_verbose;
79 
80  // Flags defining how pressure and viscous mapping terms
81  //should be treated
85  // Tolerance and relaxation parameters for pressure and viscous
86  // systems (when solved iteratively)
91 
92  // Pressure gradient (to avoid duplicate calculations)
94 
95  // Virtual functions
96  virtual void v_DoInitialise(void);
97 
98 
99  virtual void v_SetUpPressureForcing(
100  const Array<OneD, const Array<OneD, NekDouble> > &fields,
102  const NekDouble aii_Dt);
103 
104  virtual void v_SetUpViscousForcing(
105  const Array<OneD, const Array<OneD, NekDouble> > &inarray,
107  const NekDouble aii_Dt);
108 
109  virtual void v_SolvePressure( const Array<OneD, NekDouble> &Forcing);
110 
111  virtual void v_SolveViscous(
112  const Array<OneD, const Array<OneD, NekDouble> > &Forcing,
113  Array<OneD, Array<OneD, NekDouble> > &outarray,
114  const NekDouble aii_Dt);
115 
117  const Array<OneD, const Array<OneD, NekDouble> > &inarray,
118  Array<OneD, Array<OneD, NekDouble> > &outarray,
119  const NekDouble time);
120 
121  private:
123 
124  // Correction needed for convective terms = N(u) - ( -(u \nabla) u)
125  // velPhys is the velocity field (transformed for physical space)
127  const Array<OneD, const Array<OneD, NekDouble> > &velPhys,
128  Array<OneD, Array<OneD, NekDouble> > &outarray);
129 
130  // Correction needed for time-derivative terms
131  // = U_coord^j u^i_,j - u^j U_coord^i_,j
132  // vel is the velocity field (can be in wavespace)
133  // velPhys is the velocity field (transformed for physical space)
135  const Array<OneD, const Array<OneD, NekDouble> > &vel,
136  const Array<OneD, const Array<OneD, NekDouble> > &velPhys,
137  Array<OneD, Array<OneD, NekDouble> > &outarray);
138 
139  // Correction needed for pressure terms
140  // = -g^(ij)p_j + (\nabla p)/J for variable Jacobian
141  // = -g^(ij)p_j + (\nabla p) for constant Jacobian
142  // the pressure field can be in wavespace
144  Array<OneD, Array<OneD, NekDouble> > &outarray);
145 
146  // Correction needed for viscous terms = g^jk u^i_{,jk}-(\nabla^2 u)
147  // vel is the velocity field (can be in wavespace)
148  // velPhys is the velocity field (transformed for physical space)
150  const Array<OneD, const Array<OneD, NekDouble> > &velPhys,
151  Array<OneD, Array<OneD, NekDouble> > &outarray);
152 
153  };
154 
155  typedef boost::shared_ptr<VCSMapping>
157 
158 } //end of namespace
159 
160 
161 #endif //VELOCITY_CORRECTION_SCHEME_H
virtual void v_InitObject()
Init object for UnsteadySystem class.
Definition: VCSMapping.cpp:65
NekDouble m_pressureTolerance
Definition: VCSMapping.h:87
virtual void v_DoInitialise(void)
Sets up initial conditions.
Definition: VCSMapping.cpp:147
void ApplyIncNSMappingForcing(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
Definition: VCSMapping.cpp:750
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:858
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
VCSMapping(const LibUtilities::SessionReaderSharedPtr &pSession)
Constructor.
Definition: VCSMapping.cpp:57
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:583
void MappingAdvectionCorrection(const Array< OneD, const Array< OneD, NekDouble > > &velPhys, Array< OneD, Array< OneD, NekDouble > > &outarray)
Definition: VCSMapping.cpp:833
GlobalMapping::MappingSharedPtr m_mapping
Definition: VCSMapping.h:76
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:362
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
Definition: MeshPartition.h:51
NekDouble m_viscousRelaxation
Definition: VCSMapping.h:90
Array< OneD, Array< OneD, NekDouble > > m_gradP
Definition: VCSMapping.h:93
void MappingViscousCorrection(const Array< OneD, const Array< OneD, NekDouble > > &velPhys, Array< OneD, Array< OneD, NekDouble > > &outarray)
Definition: VCSMapping.cpp:964
boost::shared_ptr< EquationSystem > EquationSystemSharedPtr
A shared pointer to an EquationSystem object.
virtual void v_SolvePressure(const Array< OneD, NekDouble > &Forcing)
Definition: VCSMapping.cpp:439
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:236
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:122
virtual ~VCSMapping()
Definition: VCSMapping.cpp:143
GLOBAL_MAPPING_EXPORT typedef boost::shared_ptr< Mapping > MappingSharedPtr
A shared pointer to a Mapping object.
Definition: Mapping.h:51
static std::string className
Name of class.
Definition: VCSMapping.h:59
void MappingPressureCorrection(Array< OneD, Array< OneD, NekDouble > > &outarray)
Definition: VCSMapping.cpp:937
boost::shared_ptr< VCSMapping > VCSMappingSharedPtr
Definition: VCSMapping.h:156
NekDouble m_viscousTolerance
Definition: VCSMapping.h:88
Defines a forcing term to be explicitly applied.
Definition: Forcing.h:70
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:190
NekDouble m_pressureRelaxation
Definition: VCSMapping.h:89