Nektar++
DiffusionLDGNS.h
Go to the documentation of this file.
1///////////////////////////////////////////////////////////////////////////////
2//
3// File: DiffusionLDGNS.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: LDG diffusion class.
32//
33///////////////////////////////////////////////////////////////////////////////
34
35#ifndef NEKTAR_SOLVERS_COMPRESSIBLEFLOWSOLVER_DIFFUSIONLDGNS
36#define NEKTAR_SOLVERS_COMPRESSIBLEFLOWSOLVER_DIFFUSIONLDGNS
37
42
43using namespace Nektar::SolverUtils;
44
45namespace Nektar
46{
48{
49public:
50 static DiffusionSharedPtr create([[maybe_unused]] std::string diffType)
51 {
53 }
54
55 static std::string type;
56
57protected:
59
60 /// Penalty coefficient for LDGNS
62
63 /// h scaling for penalty term
65
70
71 /// Equation of system for computing temperature
73
75
77
78 std::size_t m_spaceDim;
79 std::size_t m_diffDim;
80
81 void v_InitObject(
84
85 void v_Diffuse(const std::size_t nConvective,
87 const Array<OneD, Array<OneD, NekDouble>> &inarray,
89 const Array<OneD, Array<OneD, NekDouble>> &pFwd,
90 const Array<OneD, Array<OneD, NekDouble>> &pBwd) override;
91
92 void v_DiffuseCoeffs(
93 const std::size_t nConvective,
95 const Array<OneD, Array<OneD, NekDouble>> &inarray,
97 const Array<OneD, Array<OneD, NekDouble>> &pFwd,
98 const Array<OneD, Array<OneD, NekDouble>> &pBwd) override;
99
102 const Array<OneD, Array<OneD, NekDouble>> &inarray,
104 const Array<OneD, Array<OneD, NekDouble>> &pFwd,
105 const Array<OneD, Array<OneD, NekDouble>> &pBwd) override;
106
109 const Array<OneD, Array<OneD, NekDouble>> &inarray,
111 TensorOfArray3D<NekDouble> &VolumeFlux,
112 Array<OneD, int> &nonZeroIndex) override;
113
116 const Array<OneD, Array<OneD, NekDouble>> &inarray,
118 TensorOfArray3D<NekDouble> &VolumeFlux,
119 Array<OneD, Array<OneD, NekDouble>> &TraceFlux,
120 const Array<OneD, Array<OneD, NekDouble>> &pFwd,
121 const Array<OneD, Array<OneD, NekDouble>> &pBwd,
122 Array<OneD, int> &nonZeroIndex) override;
123
125 {
126 m_homoDerivs = deriv;
127 }
128
130 {
131 return m_viscTensor;
132 }
133
134private:
135 void NumericalFluxO1(
137 const Array<OneD, Array<OneD, NekDouble>> &inarray,
138 TensorOfArray3D<NekDouble> &numericalFluxO1,
139 const Array<OneD, Array<OneD, NekDouble>> &pFwd,
140 const Array<OneD, Array<OneD, NekDouble>> &pBwd);
141
143 const Array<OneD, Array<OneD, NekDouble>> &inarray,
144 const Array<OneD, Array<OneD, NekDouble>> &pFwd,
145 const Array<OneD, Array<OneD, NekDouble>> &pBwd,
147
148 void NumericalFluxO2(
152 const Array<OneD, Array<OneD, NekDouble>> &pFwd,
153 const Array<OneD, Array<OneD, NekDouble>> &pBwd);
154
156 const std::size_t var, const std::size_t dir,
157 const Array<OneD, const NekDouble> &qfield,
160 Array<OneD, NekDouble> &penaltyflux);
161};
162
163typedef std::shared_ptr<DiffusionLDGNS> DiffusionLDGNSSharedPtr;
164} // namespace Nektar
165
166#endif
void v_DiffuseCoeffs(const std::size_t nConvective, const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const Array< OneD, Array< OneD, NekDouble > > &pFwd, const Array< OneD, Array< OneD, NekDouble > > &pBwd) override
Array< OneD, Array< OneD, NekDouble > > m_homoDerivs
void v_SetHomoDerivs(Array< OneD, Array< OneD, NekDouble > > &deriv) override
void v_Diffuse(const std::size_t nConvective, const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const Array< OneD, Array< OneD, NekDouble > > &pFwd, const Array< OneD, Array< OneD, NekDouble > > &pBwd) override
Calculate weak DG Diffusion in the LDG form for the Navier-Stokes (NS) equations:
EquationOfStateSharedPtr m_eos
Equation of system for computing temperature.
void NumericalFluxO1(const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, Array< OneD, NekDouble > > &inarray, TensorOfArray3D< NekDouble > &numericalFluxO1, const Array< OneD, Array< OneD, NekDouble > > &pFwd, const Array< OneD, Array< OneD, NekDouble > > &pBwd)
Builds the numerical flux for the 1st order derivatives.
LibUtilities::SessionReaderSharedPtr m_session
Array< OneD, Array< OneD, NekDouble > > m_traceVel
void NumericalFluxO2(const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, TensorOfArray3D< NekDouble > &qfield, Array< OneD, Array< OneD, NekDouble > > &qflux, const Array< OneD, Array< OneD, NekDouble > > &pFwd, const Array< OneD, Array< OneD, NekDouble > > &pBwd)
Build the numerical flux for the 2nd order derivatives.
NekDouble m_C11
Penalty coefficient for LDGNS.
void v_DiffuseTraceFlux(const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, Array< OneD, NekDouble > > &inarray, TensorOfArray3D< NekDouble > &qfields, TensorOfArray3D< NekDouble > &VolumeFlux, Array< OneD, Array< OneD, NekDouble > > &TraceFlux, const Array< OneD, Array< OneD, NekDouble > > &pFwd, const Array< OneD, Array< OneD, NekDouble > > &pBwd, Array< OneD, int > &nonZeroIndex) override
Diffusion term Trace Flux.
void v_InitObject(LibUtilities::SessionReaderSharedPtr pSession, Array< OneD, MultiRegions::ExpListSharedPtr > pFields) override
static std::string type
void v_DiffuseCalcDerivative(const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, Array< OneD, NekDouble > > &inarray, TensorOfArray3D< NekDouble > &qfields, const Array< OneD, Array< OneD, NekDouble > > &pFwd, const Array< OneD, Array< OneD, NekDouble > > &pBwd) override
Diffusion Flux, calculate the physical derivatives.
TensorOfArray3D< NekDouble > m_viscTensor
void ApplyBCsO2(const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const std::size_t var, const std::size_t dir, const Array< OneD, const NekDouble > &qfield, const Array< OneD, const NekDouble > &qFwd, const Array< OneD, const NekDouble > &qBwd, Array< OneD, NekDouble > &penaltyflux)
Imposes appropriate bcs for the 2nd order derivatives.
void v_DiffuseVolumeFlux(const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, Array< OneD, NekDouble > > &inarray, TensorOfArray3D< NekDouble > &qfields, TensorOfArray3D< NekDouble > &VolumeFlux, Array< OneD, int > &nonZeroIndex) override
Diffusion Volume Flux.
Array< OneD, NekDouble > m_traceOneOverH
h scaling for penalty term
TensorOfArray3D< NekDouble > & v_GetFluxTensor() override
void ApplyBCsO1(const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, Array< OneD, NekDouble > > &inarray, const Array< OneD, Array< OneD, NekDouble > > &pFwd, const Array< OneD, Array< OneD, NekDouble > > &pBwd, Array< OneD, Array< OneD, NekDouble > > &flux01)
Imposes appropriate bcs for the 1st order derivatives.
static DiffusionSharedPtr create(std::string diffType)
Array< OneD, Array< OneD, NekDouble > > m_traceNormals
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::shared_ptr< Diffusion > DiffusionSharedPtr
A shared pointer to an EquationSystem object.
Definition: Diffusion.h:55
std::shared_ptr< DiffusionLDGNS > DiffusionLDGNSSharedPtr
std::shared_ptr< EquationOfState > EquationOfStateSharedPtr
A shared pointer to an equation of state object.
double NekDouble