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
42#include <string>
43
44using namespace Nektar::SolverUtils;
45
46#if defined(_MSC_VER) && defined(MoveFile)
47#undef MoveFile
48#endif
49
50namespace Nektar
51{
52
54{
60};
61
62const std::string VWIIterationTypeMap[] = {
63 "FixedAlpha", "FixedWaveForcing", "FixedAlphaWaveForcing",
64 "FixedWaveForcingWithSubIterationOnAlpha"};
65
67{
68public:
69 VortexWaveInteraction(int argc, char *argv[]);
70
72
73 void ExecuteRoll(void);
74 void ExecuteStreak(void);
75 void ExecuteWave(void);
76
77 void ExecuteLoop(bool CalcWaveForce = true);
78 void SaveLoopDetails(std::string dir, int i);
79
80 void CalcNonLinearWaveForce(void);
81 void CalcL2ToLinfPressure(void);
82
83 void SaveFile(std::string fileend, std::string dir, int n);
84 void MoveFile(std::string fileend, std::string dir, int n);
85 void CopyFile(std::string file1end, std::string file2end);
86
87 bool CheckEigIsStationary(bool reset = false);
88 bool CheckIfAtNeutralPoint(void);
89 void UpdateAlpha(int n);
90 void UpdateWaveForceMag(int n);
92
93 void AppendEvlToFile(std::string file, int n);
94 void AppendEvlToFile(std::string file, NekDouble WaveForceMag);
95
97 {
98 return m_iterStart;
99 }
100
102 {
103 return m_iterEnd;
104 }
105
107 {
108 return m_VWIIterationType;
109 }
110
112 {
113 return m_nOuterIterations;
114 }
115
117 {
119 }
120
122 {
123 return m_alpha[0];
124 }
125
127 {
128 return m_alphaStep;
129 }
130
132 {
133 return m_waveForceMag[0];
134 }
135
137 {
138 return m_waveForceMagStep;
139 }
140
142 {
144 }
145
147 {
149 }
150
152
153 {
154 return m_eigRelTol;
155 }
156
158 {
160 }
161
163 {
164 return m_prevAlpha;
165 }
166
167 void SetAlpha(NekDouble alpha)
168 {
169 m_alpha[0] = alpha;
170 }
171
173 {
174 m_waveForceMag[0] = mag;
175 }
176
178 {
179 m_eigRelTol = tol;
180 }
181
183 {
184 m_alphaStep = step;
185 }
186
187 void SetMinInnerIterations(int niter)
188 {
189 m_minInnerIterations = niter;
190 }
191
193 {
194 m_prevAlpha = alpha;
195 }
196
198 {
199 return m_iterinterface;
200 }
201
203
204 void FileRelaxation(int reg);
205
206protected:
207private:
208 int m_iterStart; // Start iterations of inner loop
209 int m_iterEnd; // End iterations of inner loop
210
212 int m_maxOuterIterations; // Maximum number of outer iterations
213 int m_minInnerIterations; // Minimum number of iterations in inner loop -
214 // based on relaxation factor
216
217 bool m_deltaFcnApprox; // Activate delta function approximation around wave
218 bool m_useLinfPressureNorm; // Activate if use Pressure Linf Normalisation
219
220 bool m_moveMeshToCriticalLayer; // move mesh to critical layer
221
222 NekDouble m_deltaFcnDecay; // Delta function decay level
223
226
228
229 Array<OneD, NekDouble> m_leading_real_evl; /// < Leading real eigenvalue
231 m_leading_imag_evl; /// < Leading imaginary eigenvalue
232
234
241
243
245
248
251
253
255
257
258 std::string m_sessionName;
260
264
269};
270} // namespace Nektar
271
272#endif
Array< OneD, MultiRegions::ExpListSharedPtr > m_streakField
Array< OneD, Array< OneD, NekDouble > > m_vwiForcing
bool CheckEigIsStationary(bool reset=false)
LibUtilities::SessionReaderSharedPtr m_sessionVWI
LibUtilities::SessionReaderSharedPtr m_sessionRoll
Array< OneD, NekDouble > m_alpha
< Leading imaginary eigenvalue
LibUtilities::SessionReaderSharedPtr m_sessionStreak
void SaveFile(std::string fileend, std::string dir, int n)
void CopyFile(std::string file1end, std::string file2end)
Array< OneD, int > GetReflectionIndex(void)
VortexWaveInteraction(int argc, char *argv[])
void SaveLoopDetails(std::string dir, int i)
SolverUtils::ForcingProgrammaticSharedPtr m_vwiForcingObj
Array< OneD, MultiRegions::ExpListSharedPtr > m_waveVelocities
void ExecuteLoop(bool CalcWaveForce=true)
SpatialDomains::MeshGraphSharedPtr m_graphStreak
Array< OneD, Array< OneD, NekDouble > > m_bcsForcing
SpatialDomains::MeshGraphSharedPtr m_graphRoll
Array< OneD, MultiRegions::ExpListSharedPtr > m_rollField
void MoveFile(std::string fileend, std::string dir, int n)
SpatialDomains::MeshGraphSharedPtr m_graphWave
Array< OneD, NekDouble > m_waveForceMag
void AppendEvlToFile(std::string file, int n)
LibUtilities::SessionReaderSharedPtr m_sessionWave
void UpdateDAlphaDWaveForceMag(NekDouble alphainit)
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
const std::string VWIIterationTypeMap[]
@ eFixedWaveForcingWithSubIterationOnAlpha
double NekDouble