Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 // 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: Vortex Wave Interaction class
33 //
34 ///////////////////////////////////////////////////////////////////////////////
35 
36 #ifndef NEKTAR_SOLVERS_VORTEXWAVEINTERACTION_H
37 #define NEKTAR_SOLVERS_VORTEXWAVEINTERACTION_H
38 
42 #include <MultiRegions/ExpList.h>
43 #include <string>
44 
45 using namespace Nektar::SolverUtils;
46 
47 #if defined(_MSC_VER) && defined(MoveFile)
48 #undef MoveFile
49 #endif
50 
51 namespace Nektar
52 {
53 
54 
56  {
62  };
63 
64  const std::string VWIIterationTypeMap[] =
65  {
66  "FixedAlpha",
67  "FixedWaveForcing",
68  "FixedAlphaWaveForcing",
69  "FixedWaveForcingWithSubIterationOnAlpha"
70  };
71 
73  {
74  public:
75  VortexWaveInteraction(int argc, char *argv[]);
76 
77  ~VortexWaveInteraction(void);
78 
79  void ExecuteRoll(void);
80  void ExecuteStreak(void);
81  void ExecuteWave(void);
82 
83  void ExecuteLoop(bool CalcWaveForce = true);
84  void SaveLoopDetails(string dir, int i);
85 
86  void CalcNonLinearWaveForce(void);
87  void CalcL2ToLinfPressure (void);
88 
89  void SaveFile(string fileend, string dir, int n);
90  void MoveFile(string fileend, string dir, int n);
91  void CopyFile(string file1end, string file2end);
92 
93 
94  bool CheckEigIsStationary(bool reset = false);
95  bool CheckIfAtNeutralPoint(void);
96  void UpdateAlpha(int n);
97  void UpdateWaveForceMag(int n);
98  void UpdateDAlphaDWaveForceMag(NekDouble alphainit);
99 
100 
101 
102  void AppendEvlToFile(std::string file, int n);
103  void AppendEvlToFile(std::string file, NekDouble WaveForceMag);
104 
105  int GetIterStart()
106  {
107  return m_iterStart;
108  }
109 
110  int GetIterEnd()
111  {
112  return m_iterEnd;
113  }
114 
115  VWIIterationType GetVWIIterationType(void)
116  {
117  return m_VWIIterationType;
118  }
119 
120  int GetNOuterIterations(void)
121  {
122  return m_nOuterIterations;
123  }
124 
125  int GetMaxOuterIterations(void)
126  {
127  return m_maxOuterIterations;
128  }
129 
130  NekDouble GetAlpha(void)
131  {
132  return m_alpha[0];
133  }
134 
135 
136  NekDouble GetAlphaStep(void)
137  {
138  return m_alphaStep;
139  }
140 
141  NekDouble GetWaveForceMag(void)
142  {
143  return m_waveForceMag[0];
144  }
145 
146  NekDouble GetWaveForceMagStep(void)
147  {
148  return m_waveForceMagStep;
149  }
150 
151  NekDouble GetDAlphaDWaveForceMag(void)
152  {
153  return m_dAlphaDWaveForceMag;
154  }
155 
156  int GetMaxWaveForceMagIter(void)
157  {
158  return m_maxWaveForceMagIter;
159  }
160 
161 
162  NekDouble GetEigRelTol(void)
163 
164  {
165  return m_eigRelTol;
166  }
167 
168  int GetMinInnerIterations(void)
169  {
170  return m_minInnerIterations;
171  }
172 
173  NekDouble GetPrevAlpha(void)
174  {
175  return m_prevAlpha;
176  }
177 
178  void SetAlpha(NekDouble alpha)
179  {
180  m_alpha[0] = alpha;
181  }
182 
183 
184  void SetWaveForceMag(NekDouble mag)
185  {
186  m_waveForceMag[0] = mag;
187  }
188 
189  void SetEigRelTol(NekDouble tol)
190  {
191  m_eigRelTol = tol;
192  }
193 
194  void SetAlphaStep(NekDouble step)
195  {
196  m_alphaStep = step;
197  }
198 
199  void SetMinInnerIterations(int niter)
200  {
201  m_minInnerIterations = niter;
202  }
203 
204  void SetPrevAlpha(NekDouble alpha)
205  {
206  m_prevAlpha = alpha;
207  }
208 
209  bool IfIterInterface(void)
210  {
211  return m_iterinterface;
212  }
213 
214  Array<OneD, int> GetReflectionIndex(void);
215 
216  void FileRelaxation( int reg);
217 
218  protected:
219 
220  private:
221  int m_iterStart; // Start iterations of inner loop
222  int m_iterEnd; // End iterations of inner loop
223 
225  int m_maxOuterIterations; // Maximum number of outer iterations
226  int m_minInnerIterations; // Minimum number of iterations in inner loop - based on relaxation factor
228 
229  bool m_deltaFcnApprox; // Activate delta function approximation around wave
230  bool m_useLinfPressureNorm; // Activate if use Pressure Linf Normalisation
231 
232  bool m_moveMeshToCriticalLayer; // move mesh to critical layer
233 
234  NekDouble m_deltaFcnDecay; // Delta function decay level
235 
236  Array<OneD, NekDouble> m_waveForceMag;
238 
240 
241  Array<OneD, NekDouble> m_leading_real_evl; /// < Leading real eigenvalue
242  Array<OneD, NekDouble> m_leading_imag_evl; /// < Leading imaginary eigenvalue
243 
244  Array<OneD, NekDouble> m_alpha;
245 
252 
254 
256 
257  Array<OneD, MultiRegions::ExpListSharedPtr> m_waveVelocities;
259 
260  Array<OneD, Array<OneD, NekDouble > > m_vwiForcing;
262 
263  Array<OneD, Array<OneD, NekDouble > > m_bcsForcing;
264 
265  Array<OneD, MultiRegions::ExpListSharedPtr> m_streakField;
266 
267  Array<OneD, MultiRegions::ExpListSharedPtr> m_rollField;
268 
271 
274 
277  };
278 }
279 
280 #endif