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);
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);
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);
108 
109  virtual void v_DiffuseVolumeFlux(
111  const Array<OneD, Array<OneD, NekDouble>> &inarray,
113  TensorOfArray3D<NekDouble> &VolumeFlux, Array<OneD, int> &nonZeroIndex);
114  virtual void v_DiffuseTraceFlux(
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);
123 
124  void NumericalFluxO1(
126  const Array<OneD, Array<OneD, NekDouble>> &inarray,
127  TensorOfArray3D<NekDouble> &numericalFluxO1,
128  const Array<OneD, Array<OneD, NekDouble>> &pFwd,
129  const Array<OneD, Array<OneD, NekDouble>> &pBwd);
130 
131  void ApplyBCsO1(const Array<OneD, MultiRegions::ExpListSharedPtr> &fields,
132  const Array<OneD, Array<OneD, NekDouble>> &inarray,
133  const Array<OneD, Array<OneD, NekDouble>> &pFwd,
134  const Array<OneD, Array<OneD, NekDouble>> &pBwd,
135  Array<OneD, Array<OneD, NekDouble>> &flux01);
136 
137  void NumericalFluxO2(
141  const Array<OneD, Array<OneD, NekDouble>> &pFwd,
142  const Array<OneD, Array<OneD, NekDouble>> &pBwd);
143 
144  void ApplyBCsO2(const Array<OneD, MultiRegions::ExpListSharedPtr> &fields,
145  const std::size_t var, const std::size_t dir,
146  const Array<OneD, const NekDouble> &qfield,
147  const Array<OneD, const NekDouble> &qFwd,
148  const Array<OneD, const NekDouble> &qBwd,
149  Array<OneD, NekDouble> &penaltyflux);
150 
152  {
153  m_homoDerivs = deriv;
154  }
155 
157  {
158  return m_viscTensor;
159  }
160 
161  virtual void v_GetPrimVar(
163  const Array<OneD, Array<OneD, NekDouble>> &inarray,
164  Array<OneD, Array<OneD, NekDouble>> &primVar);
165 };
166 
167 typedef std::shared_ptr<DiffusionLDGNS> DiffusionLDGNSSharedPtr;
168 } // namespace Nektar
169 
170 #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
NekDouble m_C11
Penalty coefficient for LDGNS.
static std::string type
TensorOfArray3D< NekDouble > m_viscTensor
virtual void v_SetHomoDerivs(Array< OneD, Array< OneD, NekDouble >> &deriv)
Array< OneD, NekDouble > m_traceOneOverH
h scaling for penalty term
static DiffusionSharedPtr create(std::string diffType)
virtual TensorOfArray3D< NekDouble > & v_GetFluxTensor()
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:552
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:1
std::shared_ptr< DiffusionLDGNS > DiffusionLDGNSSharedPtr
std::shared_ptr< EquationOfState > EquationOfStateSharedPtr
A shared pointer to an equation of state object.
double NekDouble