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 
45 using namespace Nektar::SolverUtils;
46 
47 namespace Nektar
48 {
49 class DiffusionLDGNS : public Diffusion
50 {
51 public:
52  static DiffusionSharedPtr create(std::string diffType)
53  {
54  boost::ignore_unused(diffType);
55  return DiffusionSharedPtr(new DiffusionLDGNS());
56  }
57 
58  static std::string type;
59 
60 protected:
62 
63  /// Penalty coefficient for LDGNS
65 
66  /// h scaling for penalty term
68 
73  /// Equation of system for computing temperature
75 
77 
79 
80  std::size_t m_spaceDim;
81  std::size_t m_diffDim;
82 
83  virtual void v_InitObject(
86 
87  virtual void v_Diffuse(
88  const std::size_t nConvective,
90  const Array<OneD, Array<OneD, NekDouble>> &inarray,
91  Array<OneD, Array<OneD, NekDouble>> &outarray,
92  const Array<OneD, Array<OneD, NekDouble>> &pFwd,
93  const Array<OneD, Array<OneD, NekDouble>> &pBwd) override;
94  virtual void v_DiffuseCoeffs(
95  const std::size_t nConvective,
97  const Array<OneD, Array<OneD, NekDouble>> &inarray,
98  Array<OneD, Array<OneD, NekDouble>> &outarray,
99  const Array<OneD, Array<OneD, NekDouble>> &pFwd,
100  const Array<OneD, Array<OneD, NekDouble>> &pBwd) override;
101 
102  virtual void v_DiffuseCalcDerivative(
104  const Array<OneD, Array<OneD, NekDouble>> &inarray,
106  const Array<OneD, Array<OneD, NekDouble>> &pFwd,
107  const Array<OneD, Array<OneD, NekDouble>> &pBwd) override;
108 
109  virtual void v_DiffuseVolumeFlux(
111  const Array<OneD, Array<OneD, NekDouble>> &inarray,
113  TensorOfArray3D<NekDouble> &VolumeFlux,
114  Array<OneD, int> &nonZeroIndex) override;
115  virtual void v_DiffuseTraceFlux(
117  const Array<OneD, Array<OneD, NekDouble>> &inarray,
119  TensorOfArray3D<NekDouble> &VolumeFlux,
120  Array<OneD, Array<OneD, NekDouble>> &TraceFlux,
121  const Array<OneD, Array<OneD, NekDouble>> &pFwd,
122  const Array<OneD, Array<OneD, NekDouble>> &pBwd,
123  Array<OneD, int> &nonZeroIndex) override;
124 
125  void NumericalFluxO1(
127  const Array<OneD, Array<OneD, NekDouble>> &inarray,
128  TensorOfArray3D<NekDouble> &numericalFluxO1,
129  const Array<OneD, Array<OneD, NekDouble>> &pFwd,
130  const Array<OneD, Array<OneD, NekDouble>> &pBwd);
131 
132  void ApplyBCsO1(const Array<OneD, MultiRegions::ExpListSharedPtr> &fields,
133  const Array<OneD, Array<OneD, NekDouble>> &inarray,
134  const Array<OneD, Array<OneD, NekDouble>> &pFwd,
135  const Array<OneD, Array<OneD, NekDouble>> &pBwd,
136  Array<OneD, Array<OneD, NekDouble>> &flux01);
137 
138  void NumericalFluxO2(
142  const Array<OneD, Array<OneD, NekDouble>> &pFwd,
143  const Array<OneD, Array<OneD, NekDouble>> &pBwd);
144 
145  void ApplyBCsO2(const Array<OneD, MultiRegions::ExpListSharedPtr> &fields,
146  const std::size_t var, const std::size_t dir,
147  const Array<OneD, const NekDouble> &qfield,
148  const Array<OneD, const NekDouble> &qFwd,
149  const Array<OneD, const NekDouble> &qBwd,
150  Array<OneD, NekDouble> &penaltyflux);
151 
152  virtual void v_SetHomoDerivs(
153  Array<OneD, Array<OneD, NekDouble>> &deriv) override
154  {
155  m_homoDerivs = deriv;
156  }
157 
159  {
160  return m_viscTensor;
161  }
162 
163  virtual void v_GetPrimVar(
165  const Array<OneD, Array<OneD, NekDouble>> &inarray,
166  Array<OneD, Array<OneD, NekDouble>> &primVar) override;
167 };
168 
169 typedef std::shared_ptr<DiffusionLDGNS> DiffusionLDGNSSharedPtr;
170 } // namespace Nektar
171 
172 #endif
Array< OneD, Array< OneD, NekDouble > > m_homoDerivs
EquationOfStateSharedPtr m_eos
Equation of system for computing temperature.
LibUtilities::SessionReaderSharedPtr m_session
Array< OneD, Array< OneD, NekDouble > > m_traceVel
virtual void v_SetHomoDerivs(Array< OneD, Array< OneD, NekDouble >> &deriv) override
NekDouble m_C11
Penalty coefficient for LDGNS.
static std::string type
TensorOfArray3D< NekDouble > m_viscTensor
virtual TensorOfArray3D< NekDouble > & v_GetFluxTensor() override
Array< OneD, NekDouble > m_traceOneOverH
h scaling for penalty term
static DiffusionSharedPtr create(std::string diffType)
Array< OneD, Array< OneD, NekDouble > > m_traceNormals
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::shared_ptr< SolverUtils::Diffusion > DiffusionSharedPtr
A shared pointer to an EquationSystem object.
Definition: Diffusion.h:550
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