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
38using namespace std;
39
40namespace Nektar
41{
42
43/**
44 *
45 */
47 : AcousticSolver(pSession)
48{
49 m_requiresRotation = true;
50}
51
52/**
53 *
54 */
55void 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
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 {
79 v_PointSolve(Fwd[0][i], Fwd[1][i], Fwd[2][i], 0.0, 0.0, Bwd[0][i],
80 Bwd[1][i], Bwd[2][i], 0.0, 0.0, bfFwd[0][i],
81 bfFwd[1][i], bfFwd[2][i], 0.0, 0.0, bfBwd[0][i],
82 bfBwd[1][i], bfBwd[2][i], 0.0, 0.0, flux[0][i],
83 flux[1][i], flux[2][i], vF, wF);
84 }
85 }
86 else if (expDim == 2)
87 {
88 for (int i = 0; i < nTracePts; ++i)
89 {
90 v_PointSolve(Fwd[0][i], Fwd[1][i], Fwd[2][i], Fwd[3][i], 0.0,
91 Bwd[0][i], Bwd[1][i], Bwd[2][i], Bwd[3][i], 0.0,
92 bfFwd[0][i], bfFwd[1][i], bfFwd[2][i], bfFwd[3][i],
93 0.0, bfBwd[0][i], bfBwd[1][i], bfBwd[2][i],
94 bfBwd[3][i], 0.0, flux[0][i], flux[1][i], flux[2][i],
95 flux[3][i], wF);
96 }
97 }
98 else if (expDim == 3)
99 {
100 for (int i = 0; i < nTracePts; ++i)
101 {
102 v_PointSolve(Fwd[0][i], Fwd[1][i], Fwd[2][i], Fwd[3][i], Fwd[4][i],
103 Bwd[0][i], Bwd[1][i], Bwd[2][i], Bwd[3][i], Bwd[4][i],
104 bfFwd[0][i], bfFwd[1][i], bfFwd[2][i], bfFwd[3][i],
105 bfFwd[4][i], bfBwd[0][i], bfBwd[1][i], bfBwd[2][i],
106 bfBwd[3][i], bfBwd[4][i], flux[0][i], flux[1][i],
107 flux[2][i], flux[3][i], flux[4][i]);
108 }
109 }
110}
111
112} // 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
LEESolver(const LibUtilities::SessionReaderSharedPtr &pSession)
Definition: LEESolver.cpp:46
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) override
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
double NekDouble
STL namespace.