Nektar++
LEESolver.cpp
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File: LEESolver.cpp
4 //
5 // For more information, please see: http://www.nektar.info
6 //
7 // The MIT License
8 //
9 // Copyright (c) 2015 Kilian Lackhove
10 // Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
11 // Department of Aeronautics, Imperial College London (UK), and Scientific
12 // Computing and Imaging Institute, University of Utah (USA).
13 //
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: Riemann solver base classs for the LEE equations.
33 //
34 ///////////////////////////////////////////////////////////////////////////////
35 
37 
38 using namespace std;
39 
40 namespace Nektar
41 {
42 
43 /**
44  *
45  */
46 LEESolver::LEESolver(const LibUtilities::SessionReaderSharedPtr &pSession)
47  : AcousticSolver(pSession)
48 {
49  m_requiresRotation = true;
50 }
51 
52 /**
53  *
54  */
55 void LEESolver::v_Solve(const int nDim,
56  const Array<OneD, const Array<OneD, NekDouble>> &Fwd,
57  const Array<OneD, const Array<OneD, NekDouble>> &Bwd,
59 {
60  int nTracePts = Fwd[0].size();
61 
62  Array<OneD, Array<OneD, NekDouble>> bfFwd(nDim + 3);
63  Array<OneD, Array<OneD, NekDouble>> bfBwd(nDim + 3);
64  for (int i = 0; i < nDim + 3; i++)
65  {
66  bfFwd[i] = Array<OneD, NekDouble>(nTracePts);
67  bfBwd[i] = Array<OneD, NekDouble>(nTracePts);
68  }
69 
70  GetRotBasefield(bfFwd, bfBwd);
71 
72  int expDim = nDim;
73  NekDouble vF, wF;
74 
75  if (expDim == 1)
76  {
77  for (int i = 0; i < nTracePts; ++i)
78  {
80  Fwd[0][i], Fwd[1][i], Fwd[2][i], 0.0, 0.0,
81  Bwd[0][i], Bwd[1][i], Bwd[2][i], 0.0, 0.0,
82  bfFwd[0][i], bfFwd[1][i], bfFwd[2][i], 0.0, 0.0,
83  bfBwd[0][i], bfBwd[1][i], bfBwd[2][i], 0.0, 0.0,
84  flux[0][i], flux[1][i], flux[2][i], vF, wF);
85  }
86  }
87  else if (expDim == 2)
88  {
89  for (int i = 0; i < nTracePts; ++i)
90  {
92  Fwd[0][i], Fwd[1][i], Fwd[2][i], Fwd[3][i], 0.0,
93  Bwd[0][i], Bwd[1][i], Bwd[2][i], Bwd[3][i], 0.0,
94  bfFwd[0][i], bfFwd[1][i], bfFwd[2][i], bfFwd[3][i], 0.0,
95  bfBwd[0][i], bfBwd[1][i], bfBwd[2][i], bfBwd[3][i], 0.0,
96  flux[0][i], flux[1][i], flux[2][i], flux[3][i], wF);
97  }
98  }
99  else if (expDim == 3)
100  {
101  for (int i = 0; i < nTracePts; ++i)
102  {
103  v_PointSolve(
104  Fwd[0][i], Fwd[1][i], Fwd[2][i], Fwd[3][i], Fwd[4][i],
105  Bwd[0][i], Bwd[1][i], Bwd[2][i], Bwd[3][i], Bwd[4][i],
106  bfFwd[0][i], bfFwd[1][i], bfFwd[2][i], bfFwd[3][i], bfFwd[4][i],
107  bfBwd[0][i], bfBwd[1][i], bfBwd[2][i], bfBwd[3][i], bfBwd[4][i],
108  flux[0][i], flux[1][i], flux[2][i], flux[3][i], flux[4][i]);
109  }
110  }
111 }
112 
113 } // namespace Nektar
void GetRotBasefield(Array< OneD, Array< OneD, NekDouble >> &bfFwd, Array< OneD, Array< OneD, NekDouble >> &bfBwd)
virtual void v_PointSolve(NekDouble pL, NekDouble rhoL, NekDouble uL, NekDouble vL, NekDouble wL, NekDouble pR, NekDouble rhoR, NekDouble uR, NekDouble vR, NekDouble wR, NekDouble c0sqL, NekDouble rho0L, NekDouble u0L, NekDouble v0L, NekDouble w0L, NekDouble c0sqR, NekDouble rho0R, NekDouble u0R, NekDouble v0R, NekDouble w0R, NekDouble &pF, NekDouble &rhoF, NekDouble &uF, NekDouble &vF, NekDouble &wF)=0
virtual void v_Solve(const int nDim, const Array< OneD, const Array< OneD, NekDouble >> &Fwd, const Array< OneD, const Array< OneD, NekDouble >> &Bwd, Array< OneD, Array< OneD, NekDouble >> &flux)
Definition: LEESolver.cpp:55
bool m_requiresRotation
Indicates whether the Riemann solver requires a rotation to be applied to the velocity fields.
std::shared_ptr< SessionReader > SessionReaderSharedPtr
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:1
double NekDouble