Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 // License for the specific language governing rights and limitations under
14 // Permission is hereby granted, free of charge, to any person obtaining a
15 // copy of this software and associated documentation files (the "Software"),
16 // to deal in the Software without restriction, including without limitation
17 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
18 // and/or sell copies of the Software, and to permit persons to whom the
19 // Software is furnished to do so, subject to the following conditions:
20 //
21 // The above copyright notice and this permission notice shall be included
22 // in all copies or substantial portions of the Software.
23 //
24 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
25 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
27 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
29 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
30 // DEALINGS IN THE SOFTWARE.
31 //
32 // Description: LFRNS diffusion class.
33 //
34 ///////////////////////////////////////////////////////////////////////////////
35 
36 #ifndef NEKTAR_SOLVERUTILS_DIFFUSIONLFRNS
37 #define NEKTAR_SOLVERUTILS_DIFFUSIONLFRNS
38 
40 
41 namespace Nektar
42 {
43  namespace SolverUtils
44  {
45  class DiffusionLFRNS : public Diffusion
46  {
47  public:
48  static DiffusionSharedPtr create(std::string diffType)
49  {
50  return DiffusionSharedPtr(new DiffusionLFRNS(diffType));
51  }
52 
53  static std::string type[];
54 
57 
62 
71 
72  protected:
73  DiffusionLFRNS(std::string diffType);
74 
81  std::string m_ViscosityType;
86 
87 
99 
102 
104 
107 
108  std::string m_diffType;
109 
110  virtual void v_InitObject(
113 
114  virtual void v_SetupMetrics(
117 
118  virtual void v_SetupCFunctions(
121 
122  virtual void v_Diffuse(
123  const int nConvective,
125  const Array<OneD, Array<OneD, NekDouble> > &inarray,
126  Array<OneD, Array<OneD, NekDouble> > &outarray,
129 
130  virtual void v_NumericalFluxO1(
132  const Array<OneD, Array<OneD, NekDouble> > &inarray,
134  &numericalFluxO1);
135 
136  virtual void v_WeakPenaltyO1(
138  const Array<OneD, Array<OneD, NekDouble> > &inarray,
139  Array<OneD, Array<OneD, NekDouble> > &penaltyfluxO1);
140 
141  virtual void v_NumericalFluxO2(
143  const Array<OneD, Array<OneD, NekDouble> > &ufield,
145  Array<OneD, Array<OneD, NekDouble> > &qflux);
146 
147  virtual void v_WeakPenaltyO2(
149  const int var,
150  const int dir,
151  const Array<OneD, const NekDouble> &qfield,
152  Array<OneD, NekDouble> &penaltyflux);
153 
154  virtual void v_DerCFlux_1D(
155  const int nConvectiveFields,
157  const Array<OneD, const NekDouble> &flux,
158  const Array<OneD, const NekDouble> &iFlux,
159  Array<OneD, NekDouble> &derCFlux);
160 
161  virtual void v_DerCFlux_2D(
162  const int nConvectiveFields,
163  const int direction,
165  const Array<OneD, const NekDouble> &flux,
166  const Array<OneD, NekDouble> &iFlux,
167  Array<OneD, NekDouble> &derCFlux);
168 
169  virtual void v_DivCFlux_2D(
170  const int nConvectiveFields,
172  const Array<OneD, const NekDouble> &fluxX1,
173  const Array<OneD, const NekDouble> &fluxX2,
174  const Array<OneD, const NekDouble> &numericalFlux,
175  Array<OneD, NekDouble> &divCFlux);
176 
177  virtual void v_DivCFlux_2D_Gauss(
178  const int nConvectiveFields,
180  const Array<OneD, const NekDouble> &fluxX1,
181  const Array<OneD, const NekDouble> &fluxX2,
182  const Array<OneD, const NekDouble> &numericalFlux,
183  Array<OneD, NekDouble> &divCFlux);
184 
185  virtual void v_FluxVec(
186  Array<OneD, Array<OneD, Array<OneD, NekDouble> > > &fluxvector)
187  {
188  fluxvector = m_viscTensor;
189  };
190 
191  virtual void v_SetHomoDerivs(
193  {
194  m_homoDerivs = deriv;
195  }
196 
198  {
199  return m_viscTensor;
200  }
201  };
202 
203  typedef boost::shared_ptr<DiffusionLFRNS> DiffusionLFRNSSharedPtr;
204  }
205 }
206 
207 #endif
208 
Array< OneD, Array< OneD, NekDouble > > m_dGR_xi1
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_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...
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–7...
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > m_DU1
boost::shared_ptr< DiffusionLFRNS > DiffusionLFRNSSharedPtr
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.
virtual void v_Diffuse(const int 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=NullNekDoubleArrayofArray, const Array< OneD, Array< OneD, NekDouble > > &pBwd=NullNekDoubleArrayofArray)
Calculate FR Diffusion for the Navier-Stokes (NS) equations using an LDG interface flux...
Array< OneD, Array< OneD, NekDouble > > m_dGR_xi2
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.
virtual Array< OneD, Array< OneD, Array< OneD, NekDouble > > > & v_GetFluxTensor()
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > m_BD1
Array< OneD, Array< OneD, NekDouble > > m_traceNormals
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.
Array< OneD, Array< OneD, NekDouble > > m_Q2D_e0
LibUtilities::SessionReaderSharedPtr m_session
DiffusionLFRNS(std::string diffType)
DiffusionLFRNS uses the Flux Reconstruction (FR) approach to compute the diffusion term...
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_dGL_xi1
virtual void v_FluxVec(Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &fluxvector)
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.
boost::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:70
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
Definition: MeshPartition.h:51
Array< OneD, Array< OneD, NekDouble > > m_homoDerivs
Array< OneD, NekDouble > m_jac
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.
Array< OneD, Array< OneD, NekDouble > > m_Q2D_e3
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > m_tmp2
virtual void v_SetHomoDerivs(Array< OneD, Array< OneD, NekDouble > > &deriv)
Array< OneD, Array< OneD, NekDouble > > m_dGL_xi3
static DiffusionSharedPtr create(std::string diffType)
boost::shared_ptr< Diffusion > DiffusionSharedPtr
A shared pointer to an EquationSystem object.
Definition: Diffusion.h:162
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > m_tmp1
Array< OneD, Array< OneD, NekDouble > > m_divFD
double NekDouble
Array< OneD, Array< OneD, NekDouble > > m_dGR_xi3
Array< OneD, Array< OneD, NekDouble > > m_dGL_xi2
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > m_IF1
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > m_DD1
Array< OneD, Array< OneD, NekDouble > > m_Q2D_e2
Array< OneD, Array< OneD, NekDouble > > m_gmat
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > m_DFC1
virtual void v_InitObject(LibUtilities::SessionReaderSharedPtr pSession, Array< OneD, MultiRegions::ExpListSharedPtr > pFields)
Initiliase DiffusionLFRNS objects and store them before starting the time-stepping.
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > m_viscTensor
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > m_D1
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > m_DFC2
static Array< OneD, Array< OneD, NekDouble > > NullNekDoubleArrayofArray
Array< OneD, Array< OneD, NekDouble > > m_traceVel
Array< OneD, Array< OneD, NekDouble > > m_viscFlux
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_divFC
Array< OneD, Array< OneD, NekDouble > > m_Q2D_e1