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 
46 using namespace Nektar::SolverUtils;
47 
48 namespace Nektar
49 {
50  class DiffusionLDGNS : public Diffusion
51  {
52  public:
53  static DiffusionSharedPtr create(std::string diffType)
54  {
55  boost::ignore_unused(diffType);
56  return DiffusionSharedPtr(new DiffusionLDGNS());
57  }
58 
59  static std::string type;
60 
61  protected:
63 
64  /// Penalty coefficient for LDGNS
66 
67  /// h scaling for penalty term
69 
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,
92  Array<OneD, Array<OneD, NekDouble> > &outarray,
93  const Array<OneD, Array<OneD, NekDouble> > &pFwd,
94  const Array<OneD, Array<OneD, NekDouble> > &pBwd);
95  virtual void v_DiffuseCoeffs(
96  const std::size_t nConvective,
98  const Array<OneD, Array<OneD, NekDouble> > &inarray,
99  Array<OneD, Array<OneD, NekDouble> > &outarray,
100  const Array<OneD, Array<OneD, NekDouble> > &pFwd,
101  const Array<OneD, Array<OneD, NekDouble> > &pBwd);
102 
103  virtual void v_DiffuseCalcDerivative(
105  const Array<OneD, Array<OneD, NekDouble> > &inarray,
107  const Array<OneD, Array<OneD, NekDouble> > &pFwd,
108  const Array<OneD, Array<OneD, NekDouble> > &pBwd);
109 
110  virtual void v_DiffuseVolumeFlux(
112  const Array<OneD, Array<OneD, NekDouble>> &inarray,
114  TensorOfArray3D<NekDouble> &VolumeFlux,
115  Array< OneD, int > &nonZeroIndex);
116  virtual void v_DiffuseTraceFlux(
118  const Array<OneD, Array<OneD, NekDouble>> &inarray,
120  TensorOfArray3D<NekDouble> &VolumeFlux,
121  Array<OneD, Array<OneD, NekDouble> > &TraceFlux,
122  const Array<OneD, Array<OneD, NekDouble>> &pFwd,
123  const Array<OneD, Array<OneD, NekDouble>> &pBwd,
124  Array< OneD, int > &nonZeroIndex);
125 
126  void NumericalFluxO1(
128  const Array<OneD, Array<OneD, NekDouble> > &inarray,
129  TensorOfArray3D<NekDouble> &numericalFluxO1,
130  const Array<OneD, Array<OneD, NekDouble> > &pFwd,
131  const Array<OneD, Array<OneD, NekDouble> > &pBwd);
132 
133  void ApplyBCsO1(
135  const Array<OneD, Array<OneD, NekDouble> > &inarray,
136  const Array<OneD, Array<OneD, NekDouble> > &pFwd,
137  const Array<OneD, Array<OneD, NekDouble> > &pBwd,
138  Array<OneD, Array<OneD, NekDouble> > &flux01);
139 
140  void NumericalFluxO2(
144  const Array<OneD, Array<OneD, NekDouble> > &pFwd,
145  const Array<OneD, Array<OneD, NekDouble> > &pBwd);
146 
147  void ApplyBCsO2(
149  const std::size_t var,
150  const std::size_t dir,
151  const Array<OneD, const NekDouble> &qfield,
152  const Array<OneD, const NekDouble> &qFwd,
153  const Array<OneD, const NekDouble> &qBwd,
154  Array<OneD, NekDouble> &penaltyflux);
155 
156  virtual void v_SetHomoDerivs(
158  {
159  m_homoDerivs = deriv;
160  }
161 
163  {
164  return m_viscTensor;
165  }
166 
167  virtual void v_GetPrimVar(
169  const Array<OneD, Array<OneD, NekDouble>> &inarray,
170  Array<OneD, Array<OneD, NekDouble>> &primVar);
171  };
172 
173  typedef std::shared_ptr<DiffusionLDGNS> DiffusionLDGNSSharedPtr;
174 }
175 
176 #endif
177 
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)
NekDouble m_C11
Penalty coefficient for LDGNS.
static std::string type
TensorOfArray3D< NekDouble > m_viscTensor
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:627
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