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
38#include <boost/core/ignore_unused.hpp>
39
44
45using namespace Nektar::SolverUtils;
46
47namespace Nektar
48{
50{
51public:
52 static DiffusionSharedPtr create(std::string diffType)
53 {
54 boost::ignore_unused(diffType);
56 }
57
58 static std::string type;
59
60protected:
62
63 /// Penalty coefficient for LDGNS
65
66 /// h scaling for penalty term
68
73
74 /// Equation of system for computing temperature
76
78
80
81 std::size_t m_spaceDim;
82 std::size_t m_diffDim;
83
84 virtual void v_InitObject(
87
88 virtual void v_Diffuse(
89 const std::size_t nConvective,
91 const Array<OneD, Array<OneD, NekDouble>> &inarray,
93 const Array<OneD, Array<OneD, NekDouble>> &pFwd,
94 const Array<OneD, Array<OneD, NekDouble>> &pBwd) override;
95
96 virtual void v_DiffuseCoeffs(
97 const std::size_t nConvective,
99 const Array<OneD, Array<OneD, NekDouble>> &inarray,
101 const Array<OneD, Array<OneD, NekDouble>> &pFwd,
102 const Array<OneD, Array<OneD, NekDouble>> &pBwd) override;
103
104 virtual void v_DiffuseCalcDerivative(
106 const Array<OneD, Array<OneD, NekDouble>> &inarray,
108 const Array<OneD, Array<OneD, NekDouble>> &pFwd,
109 const Array<OneD, Array<OneD, NekDouble>> &pBwd) override;
110
111 virtual void v_DiffuseVolumeFlux(
113 const Array<OneD, Array<OneD, NekDouble>> &inarray,
115 TensorOfArray3D<NekDouble> &VolumeFlux,
116 Array<OneD, int> &nonZeroIndex) override;
117
118 virtual void v_DiffuseTraceFlux(
120 const Array<OneD, Array<OneD, NekDouble>> &inarray,
122 TensorOfArray3D<NekDouble> &VolumeFlux,
123 Array<OneD, Array<OneD, NekDouble>> &TraceFlux,
124 const Array<OneD, Array<OneD, NekDouble>> &pFwd,
125 const Array<OneD, Array<OneD, NekDouble>> &pBwd,
126 Array<OneD, int> &nonZeroIndex) override;
127
128 virtual void v_SetHomoDerivs(
129 Array<OneD, Array<OneD, NekDouble>> &deriv) override
130 {
131 m_homoDerivs = deriv;
132 }
133
135 {
136 return m_viscTensor;
137 }
138
139private:
140 void NumericalFluxO1(
142 const Array<OneD, Array<OneD, NekDouble>> &inarray,
143 TensorOfArray3D<NekDouble> &numericalFluxO1,
144 const Array<OneD, Array<OneD, NekDouble>> &pFwd,
145 const Array<OneD, Array<OneD, NekDouble>> &pBwd);
146
148 const Array<OneD, Array<OneD, NekDouble>> &inarray,
149 const Array<OneD, Array<OneD, NekDouble>> &pFwd,
150 const Array<OneD, Array<OneD, NekDouble>> &pBwd,
152
153 void NumericalFluxO2(
157 const Array<OneD, Array<OneD, NekDouble>> &pFwd,
158 const Array<OneD, Array<OneD, NekDouble>> &pBwd);
159
161 const std::size_t var, const std::size_t dir,
162 const Array<OneD, const NekDouble> &qfield,
165 Array<OneD, NekDouble> &penaltyflux);
166};
167
168typedef std::shared_ptr<DiffusionLDGNS> DiffusionLDGNSSharedPtr;
169} // namespace Nektar
170
171#endif
virtual 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
virtual 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.
virtual 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.
virtual void v_InitObject(LibUtilities::SessionReaderSharedPtr pSession, Array< OneD, MultiRegions::ExpListSharedPtr > pFields) override
static std::string type
virtual 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.
virtual 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
virtual 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)
virtual void v_SetHomoDerivs(Array< OneD, Array< OneD, NekDouble > > &deriv) override
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:58
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:2
std::shared_ptr< DiffusionLDGNS > DiffusionLDGNSSharedPtr
std::shared_ptr< EquationOfState > EquationOfStateSharedPtr
A shared pointer to an equation of state object.
double NekDouble