Nektar++
VortexWaveInteraction.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File VortexWaveInteraction.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: Vortex Wave Interaction class
32 //
33 ///////////////////////////////////////////////////////////////////////////////
34 
35 #ifndef NEKTAR_SOLVERS_VORTEXWAVEINTERACTION_H
36 #define NEKTAR_SOLVERS_VORTEXWAVEINTERACTION_H
37 
41 #include <MultiRegions/ExpList.h>
42 #include <string>
43 
44 using namespace Nektar::SolverUtils;
45 
46 #if defined(_MSC_VER) && defined(MoveFile)
47 #undef MoveFile
48 #endif
49 
50 namespace Nektar
51 {
52 
53 
55  {
61  };
62 
63  const std::string VWIIterationTypeMap[] =
64  {
65  "FixedAlpha",
66  "FixedWaveForcing",
67  "FixedAlphaWaveForcing",
68  "FixedWaveForcingWithSubIterationOnAlpha"
69  };
70 
72  {
73  public:
74  VortexWaveInteraction(int argc, char *argv[]);
75 
76  ~VortexWaveInteraction(void);
77 
78  void ExecuteRoll(void);
79  void ExecuteStreak(void);
80  void ExecuteWave(void);
81 
82  void ExecuteLoop(bool CalcWaveForce = true);
83  void SaveLoopDetails(std::string dir, int i);
84 
85  void CalcNonLinearWaveForce(void);
86  void CalcL2ToLinfPressure (void);
87 
88  void SaveFile(std::string fileend, std::string dir, int n);
89  void MoveFile(std::string fileend, std::string dir, int n);
90  void CopyFile(std::string file1end, std::string file2end);
91 
92 
93  bool CheckEigIsStationary(bool reset = false);
94  bool CheckIfAtNeutralPoint(void);
95  void UpdateAlpha(int n);
96  void UpdateWaveForceMag(int n);
97  void UpdateDAlphaDWaveForceMag(NekDouble alphainit);
98 
99 
100 
101  void AppendEvlToFile(std::string file, int n);
102  void AppendEvlToFile(std::string file, NekDouble WaveForceMag);
103 
105  {
106  return m_iterStart;
107  }
108 
110  {
111  return m_iterEnd;
112  }
113 
115  {
116  return m_VWIIterationType;
117  }
118 
120  {
121  return m_nOuterIterations;
122  }
123 
125  {
126  return m_maxOuterIterations;
127  }
128 
130  {
131  return m_alpha[0];
132  }
133 
134 
136  {
137  return m_alphaStep;
138  }
139 
141  {
142  return m_waveForceMag[0];
143  }
144 
146  {
147  return m_waveForceMagStep;
148  }
149 
151  {
152  return m_dAlphaDWaveForceMag;
153  }
154 
156  {
157  return m_maxWaveForceMagIter;
158  }
159 
160 
162 
163  {
164  return m_eigRelTol;
165  }
166 
168  {
169  return m_minInnerIterations;
170  }
171 
173  {
174  return m_prevAlpha;
175  }
176 
177  void SetAlpha(NekDouble alpha)
178  {
179  m_alpha[0] = alpha;
180  }
181 
182 
184  {
185  m_waveForceMag[0] = mag;
186  }
187 
189  {
190  m_eigRelTol = tol;
191  }
192 
194  {
195  m_alphaStep = step;
196  }
197 
198  void SetMinInnerIterations(int niter)
199  {
200  m_minInnerIterations = niter;
201  }
202 
204  {
205  m_prevAlpha = alpha;
206  }
207 
208  bool IfIterInterface(void)
209  {
210  return m_iterinterface;
211  }
212 
213  Array<OneD, int> GetReflectionIndex(void);
214 
215  void FileRelaxation( int reg);
216 
217  protected:
218 
219  private:
220  int m_iterStart; // Start iterations of inner loop
221  int m_iterEnd; // End iterations of inner loop
222 
224  int m_maxOuterIterations; // Maximum number of outer iterations
225  int m_minInnerIterations; // Minimum number of iterations in inner loop - based on relaxation factor
227 
228  bool m_deltaFcnApprox; // Activate delta function approximation around wave
229  bool m_useLinfPressureNorm; // Activate if use Pressure Linf Normalisation
230 
231  bool m_moveMeshToCriticalLayer; // move mesh to critical layer
232 
233  NekDouble m_deltaFcnDecay; // Delta function decay level
234 
237 
239 
240  Array<OneD, NekDouble> m_leading_real_evl; /// < Leading real eigenvalue
241  Array<OneD, NekDouble> m_leading_imag_evl; /// < Leading imaginary eigenvalue
242 
244 
251 
253 
255 
258 
261 
263 
265 
267 
268  std::string m_sessionName;
270 
274 
279  };
280 }
281 
282 #endif
Array< OneD, MultiRegions::ExpListSharedPtr > m_streakField
LibUtilities::SessionReaderSharedPtr m_sessionVWI
LibUtilities::SessionReaderSharedPtr m_sessionRoll
Array< OneD, NekDouble > m_alpha
< Leading imaginary eigenvalue
LibUtilities::SessionReaderSharedPtr m_sessionStreak
Array< OneD, Array< OneD, NekDouble > > m_vwiForcing
Array< OneD, Array< OneD, NekDouble > > m_bcsForcing
SolverUtils::ForcingProgrammaticSharedPtr m_vwiForcingObj
Array< OneD, MultiRegions::ExpListSharedPtr > m_waveVelocities
SpatialDomains::MeshGraphSharedPtr m_graphStreak
SpatialDomains::MeshGraphSharedPtr m_graphRoll
Array< OneD, MultiRegions::ExpListSharedPtr > m_rollField
SpatialDomains::MeshGraphSharedPtr m_graphWave
Array< OneD, NekDouble > m_waveForceMag
LibUtilities::SessionReaderSharedPtr m_sessionWave
MultiRegions::ExpListSharedPtr m_wavePressure
Array< OneD, NekDouble > m_leading_real_evl
Array< OneD, NekDouble > m_leading_imag_evl
< Leading real eigenvalue
VWIIterationType GetVWIIterationType(void)
EquationSystemSharedPtr m_solverRoll
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
std::shared_ptr< EquationSystem > EquationSystemSharedPtr
A shared pointer to an EquationSystem object.
SOLVER_UTILS_EXPORT typedef std::shared_ptr< ForcingProgrammatic > ForcingProgrammaticSharedPtr
A shared pointer to an EquationSystem object.
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
Definition: MeshGraph.h:174
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:1
const std::string VWIIterationTypeMap[]
@ eFixedWaveForcingWithSubIterationOnAlpha
double NekDouble