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 
106  {
107  return m_iterStart;
108  }
109 
111  {
112  return m_iterEnd;
113  }
114 
116  {
117  return m_VWIIterationType;
118  }
119 
121  {
122  return m_nOuterIterations;
123  }
124 
126  {
127  return m_maxOuterIterations;
128  }
129 
131  {
132  return m_alpha[0];
133  }
134 
135 
137  {
138  return m_alphaStep;
139  }
140 
142  {
143  return m_waveForceMag[0];
144  }
145 
147  {
148  return m_waveForceMagStep;
149  }
150 
152  {
153  return m_dAlphaDWaveForceMag;
154  }
155 
157  {
158  return m_maxWaveForceMagIter;
159  }
160 
161 
163 
164  {
165  return m_eigRelTol;
166  }
167 
169  {
170  return m_minInnerIterations;
171  }
172 
174  {
175  return m_prevAlpha;
176  }
177 
178  void SetAlpha(NekDouble alpha)
179  {
180  m_alpha[0] = alpha;
181  }
182 
183 
185  {
186  m_waveForceMag[0] = mag;
187  }
188 
190  {
191  m_eigRelTol = tol;
192  }
193 
195  {
196  m_alphaStep = step;
197  }
198 
199  void SetMinInnerIterations(int niter)
200  {
201  m_minInnerIterations = niter;
202  }
203 
205  {
206  m_prevAlpha = alpha;
207  }
208 
209  bool IfIterInterface(void)
210  {
211  return m_iterinterface;
212  }
213 
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 
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 
245 
252 
254 
256 
259 
262 
264 
266 
268 
271 
274 
277  };
278 }
279 
280 #endif
LibUtilities::SessionReaderSharedPtr m_sessionRoll
MultiRegions::ExpListSharedPtr m_wavePressure
Array< OneD, NekDouble > m_leading_imag_evl
< Leading real eigenvalue
Array< OneD, MultiRegions::ExpListSharedPtr > m_rollField
VWIIterationType GetVWIIterationType(void)
Array< OneD, MultiRegions::ExpListSharedPtr > m_waveVelocities
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
Definition: MeshPartition.h:51
EquationSystemSharedPtr m_solverRoll
SolverUtils::ForcingProgrammaticSharedPtr m_vwiForcingObj
boost::shared_ptr< EquationSystem > EquationSystemSharedPtr
A shared pointer to an EquationSystem object.
Array< OneD, NekDouble > m_leading_real_evl
Array< OneD, Array< OneD, NekDouble > > m_bcsForcing
SOLVER_UTILS_EXPORT typedef boost::shared_ptr< ForcingProgrammatic > ForcingProgrammaticSharedPtr
A shared pointer to an EquationSystem object.
LibUtilities::SessionReaderSharedPtr m_sessionWave
const std::string VWIIterationTypeMap[]
boost::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
Array< OneD, NekDouble > m_waveForceMag
double NekDouble
Array< OneD, int > GetReflectionIndex(MultiRegions::ExpListSharedPtr Exp, int Ireg)
Definition: FldCalcBCs.cpp:637
Array< OneD, Array< OneD, NekDouble > > m_vwiForcing
LibUtilities::SessionReaderSharedPtr m_sessionVWI
Array< OneD, MultiRegions::ExpListSharedPtr > m_streakField
Array< OneD, NekDouble > m_alpha
< Leading imaginary eigenvalue
LibUtilities::SessionReaderSharedPtr m_sessionStreak