Nektar++
DiffusionLFRNS.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File: DiffusionLFRNS.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: LFRNS diffusion class.
32 //
33 ///////////////////////////////////////////////////////////////////////////////
34 
35 #ifndef NEKTAR_SOLVERUTILS_DIFFUSIONLFRNS
36 #define NEKTAR_SOLVERUTILS_DIFFUSIONLFRNS
37 
39 
40 namespace Nektar
41 {
42 namespace SolverUtils
43 {
44 class DiffusionLFRNS : public Diffusion
45 {
46 public:
47  static DiffusionSharedPtr create(std::string diffType)
48  {
49  return DiffusionSharedPtr(new DiffusionLFRNS(diffType));
50  }
51 
52  static std::string type[];
53 
56 
61 
70 
71 protected:
72  DiffusionLFRNS(std::string diffType);
73 
80  std::string m_ViscosityType;
85 
97 
100 
102 
105 
106  std::string m_diffType;
107 
108  virtual void v_InitObject(
111 
112  virtual void v_SetupMetrics(
115 
116  virtual void v_SetupCFunctions(
119 
120  virtual void v_Diffuse(
121  const std::size_t nConvective,
123  const Array<OneD, Array<OneD, NekDouble>> &inarray,
124  Array<OneD, Array<OneD, NekDouble>> &outarray,
125  const Array<OneD, Array<OneD, NekDouble>> &pFwd,
126  const Array<OneD, Array<OneD, NekDouble>> &pBwd);
127 
128  virtual void v_NumericalFluxO1(
130  const Array<OneD, Array<OneD, NekDouble>> &inarray,
131  Array<OneD, Array<OneD, Array<OneD, NekDouble>>> &numericalFluxO1);
132 
133  virtual void v_WeakPenaltyO1(
135  const Array<OneD, Array<OneD, NekDouble>> &inarray,
136  Array<OneD, Array<OneD, NekDouble>> &penaltyfluxO1);
137 
138  virtual void v_NumericalFluxO2(
140  const Array<OneD, Array<OneD, NekDouble>> &ufield,
143 
144  virtual void v_WeakPenaltyO2(
146  const int var, const int dir,
147  const Array<OneD, const NekDouble> &qfield,
148  Array<OneD, NekDouble> &penaltyflux);
149 
150  virtual void v_DerCFlux_1D(
151  const int nConvectiveFields,
153  const Array<OneD, const NekDouble> &flux,
154  const Array<OneD, const NekDouble> &iFlux,
155  Array<OneD, NekDouble> &derCFlux);
156 
157  virtual void v_DerCFlux_2D(
158  const int nConvectiveFields, const int direction,
160  const Array<OneD, const NekDouble> &flux,
161  const Array<OneD, NekDouble> &iFlux, Array<OneD, NekDouble> &derCFlux);
162 
163  virtual void v_DivCFlux_2D(
164  const int nConvectiveFields,
166  const Array<OneD, const NekDouble> &fluxX1,
167  const Array<OneD, const NekDouble> &fluxX2,
168  const Array<OneD, const NekDouble> &numericalFlux,
169  Array<OneD, NekDouble> &divCFlux);
170 
171  virtual void v_DivCFlux_2D_Gauss(
172  const int nConvectiveFields,
174  const Array<OneD, const NekDouble> &fluxX1,
175  const Array<OneD, const NekDouble> &fluxX2,
176  const Array<OneD, const NekDouble> &numericalFlux,
177  Array<OneD, NekDouble> &divCFlux);
178 
179  virtual void v_FluxVec(
180  Array<OneD, Array<OneD, Array<OneD, NekDouble>>> &fluxvector)
181  {
182  fluxvector = m_viscTensor;
183  };
184 
186  {
187  m_homoDerivs = deriv;
188  }
189 
191  {
192  return m_viscTensor;
193  }
194 };
195 
196 typedef std::shared_ptr<DiffusionLFRNS> DiffusionLFRNSSharedPtr;
197 } // namespace SolverUtils
198 } // namespace Nektar
199 
200 #endif
virtual void v_InitObject(LibUtilities::SessionReaderSharedPtr pSession, Array< OneD, MultiRegions::ExpListSharedPtr > pFields)
Initiliase DiffusionLFRNS objects and store them before starting the time-stepping.
virtual void v_WeakPenaltyO1(const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, Array< OneD, NekDouble >> &inarray, Array< OneD, Array< OneD, NekDouble >> &penaltyfluxO1)
Imposes appropriate bcs for the 1st order derivatives.
virtual void v_NumericalFluxO2(const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, Array< OneD, NekDouble >> &ufield, Array< OneD, Array< OneD, Array< OneD, NekDouble >>> &qfield, Array< OneD, Array< OneD, NekDouble >> &qflux)
Build the numerical flux for the 2nd order derivatives.
Array< OneD, Array< OneD, NekDouble > > m_traceVel
virtual void v_DivCFlux_2D_Gauss(const int nConvectiveFields, const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, const NekDouble > &fluxX1, const Array< OneD, const NekDouble > &fluxX2, const Array< OneD, const NekDouble > &numericalFlux, Array< OneD, NekDouble > &divCFlux)
Compute the divergence of the corrective flux for 2D problems where POINTSTYPE="GaussGaussLegendre".
Array< OneD, Array< OneD, NekDouble > > m_divFD
Array< OneD, NekDouble > m_jac
virtual void v_DerCFlux_2D(const int nConvectiveFields, const int direction, const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, const NekDouble > &flux, const Array< OneD, NekDouble > &iFlux, Array< OneD, NekDouble > &derCFlux)
Compute the derivative of the corrective flux wrt a given coordinate for 2D problems.
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)
Calculate FR Diffusion for the Navier-Stokes (NS) equations using an LDG interface flux.
Array< OneD, Array< OneD, NekDouble > > m_viscFlux
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > m_tmp2
Array< OneD, Array< OneD, NekDouble > > m_Q2D_e1
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > m_DFC2
virtual void v_NumericalFluxO1(const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, Array< OneD, NekDouble >> &inarray, Array< OneD, Array< OneD, Array< OneD, NekDouble >>> &numericalFluxO1)
Builds the numerical flux for the 1st order derivatives.
Array< OneD, Array< OneD, NekDouble > > m_dGR_xi2
Array< OneD, Array< OneD, NekDouble > > m_divFC
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > m_DFC1
Array< OneD, Array< OneD, NekDouble > > m_dGR_xi3
Array< OneD, Array< OneD, NekDouble > > m_gmat
Array< OneD, Array< OneD, NekDouble > > m_Q2D_e3
Array< OneD, Array< OneD, NekDouble > > m_traceNormals
Array< OneD, Array< OneD, NekDouble > > m_Q2D_e2
Array< OneD, Array< OneD, NekDouble > > m_dGL_xi2
virtual void v_DivCFlux_2D(const int nConvectiveFields, const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, const NekDouble > &fluxX1, const Array< OneD, const NekDouble > &fluxX2, const Array< OneD, const NekDouble > &numericalFlux, Array< OneD, NekDouble > &divCFlux)
Compute the divergence of the corrective flux for 2D problems.
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > m_viscTensor
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > m_tmp1
virtual void v_FluxVec(Array< OneD, Array< OneD, Array< OneD, NekDouble >>> &fluxvector)
Array< OneD, Array< OneD, NekDouble > > m_dGL_xi3
Array< OneD, Array< OneD, NekDouble > > m_Q2D_e0
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > m_IF1
virtual Array< OneD, Array< OneD, Array< OneD, NekDouble > > > & v_GetFluxTensor()
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > m_D1
DiffusionLFRNS(std::string diffType)
DiffusionLFRNS uses the Flux Reconstruction (FR) approach to compute the diffusion term....
LibUtilities::SessionReaderSharedPtr m_session
virtual void v_SetupMetrics(LibUtilities::SessionReaderSharedPtr pSession, Array< OneD, MultiRegions::ExpListSharedPtr > pFields)
Setup the metric terms to compute the contravariant fluxes. (i.e. this special metric terms transform...
Array< OneD, Array< OneD, NekDouble > > m_homoDerivs
virtual void v_SetupCFunctions(LibUtilities::SessionReaderSharedPtr pSession, Array< OneD, MultiRegions::ExpListSharedPtr > pFields)
Setup the derivatives of the correction functions. For more details see J Sci Comput (2011) 47: 50–72...
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > m_BD1
virtual void v_DerCFlux_1D(const int nConvectiveFields, const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, const NekDouble > &flux, const Array< OneD, const NekDouble > &iFlux, Array< OneD, NekDouble > &derCFlux)
Compute the derivative of the corrective flux for 1D problems.
Array< OneD, Array< OneD, NekDouble > > m_dGR_xi1
virtual void v_WeakPenaltyO2(const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const int var, const int dir, const Array< OneD, const NekDouble > &qfield, Array< OneD, NekDouble > &penaltyflux)
Imposes appropriate bcs for the 2nd order derivatives.
static DiffusionSharedPtr create(std::string diffType)
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > m_DU1
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > m_DD1
virtual void v_SetHomoDerivs(Array< OneD, Array< OneD, NekDouble >> &deriv)
Array< OneD, Array< OneD, NekDouble > > m_dGL_xi1
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::shared_ptr< SolverUtils::Diffusion > DiffusionSharedPtr
A shared pointer to an EquationSystem object.
Definition: Diffusion.h:552
std::shared_ptr< DiffusionLFRNS > DiffusionLFRNSSharedPtr
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:1
std::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:75
double NekDouble