Nektar++
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
NavierStokesImplicitCFE.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File NavierStokesImplicitCFE.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: NavierStokes equations in conservative variable
32 //
33 ///////////////////////////////////////////////////////////////////////////////
34 
35 #ifndef NEKTAR_SOLVERS_COMPRESSIBLEFLOWSOLVER_NAVIERSTOKESIMPLICITCFE_H
36 #define NEKTAR_SOLVERS_COMPRESSIBLEFLOWSOLVER_NAVIERSTOKESIMPLICITCFE_H
37 
42 #include <MultiRegions/ContField.h>
43 
44 namespace Nektar
45 {
46  /**
47  *
48  *
49  **/
50  class NavierStokesImplicitCFE : virtual public NavierStokesCFE,
51  virtual public CFSImplicit
52  {
53  public:
55 
56  // Creates an instance of this class
60  {
63  p->InitObject();
64  return p;
65  }
66  // Name of class
67  static std::string className;
68 
69  virtual ~NavierStokesImplicitCFE();
70 
71  typedef std::function<void (
72  const Array<OneD, NekDouble> &,
73  const NekDouble &,
74  const Array<OneD, NekDouble> &,
76 
77  protected:
79 
82 
83 
84  virtual void v_InitObject();
85 
86  virtual void v_DoDiffusionCoeff(
87  const Array<OneD, const Array<OneD, NekDouble>> &inarray,
88  Array<OneD, Array<OneD, NekDouble>> &outarray,
89  const Array<OneD, const Array<OneD, NekDouble>> &pFwd,
90  const Array<OneD, const Array<OneD, NekDouble>> &pBwd);
91 
92  virtual void v_MinusDiffusionFluxJacPoint(
93  const int nConvectiveFields,
94  const int nElmtPnt,
95  const Array<OneD, const Array<OneD, NekDouble>> &locVars,
96  const TensorOfArray3D<NekDouble> &locDerv,
97  const Array<OneD, NekDouble> &locmu,
98  const Array<OneD, NekDouble> &locDmuDT,
99  const Array<OneD, NekDouble> &normals,
100  DNekMatSharedPtr &wspMat,
101  Array<OneD, Array<OneD, NekDouble>> &PntJacArray);
102 
103  virtual void v_GetFluxDerivJacDirctn(
104  const MultiRegions::ExpListSharedPtr &explist,
105  const Array<OneD, const Array<OneD, NekDouble>> &normals,
106  const int nDervDir,
107  const Array<OneD, const Array<OneD, NekDouble>> &inarray,
108  TensorOfArray5D<NekDouble> &ElmtJacArray,
109  const int nFluxDir);
110 
111  virtual void v_GetFluxDerivJacDirctnElmt(
112  const int nConvectiveFields,
113  const int nElmtPnt,
114  const int nDervDir,
115  const Array<OneD, const Array<OneD, NekDouble>> &locVars,
116  const Array<OneD, NekDouble> &locmu,
117  const Array<OneD, const Array<OneD, NekDouble>> &locnormal,
118  DNekMatSharedPtr &wspMat,
119  Array<OneD, Array<OneD, NekDouble>> &PntJacArray);
120 
121  virtual void v_GetFluxDerivJacDirctn(
122  const MultiRegions::ExpListSharedPtr &explist,
123  const Array<OneD, const Array<OneD, NekDouble>> &normals,
124  const int nDervDir,
125  const Array<OneD, const Array<OneD, NekDouble>> &inarray,
127 
128  virtual void v_GetDiffusionFluxJacPoint(
129  const Array<OneD, NekDouble> &conservVar,
130  const Array<OneD, const Array<OneD, NekDouble>> &conseDeriv,
131  const NekDouble mu,
132  const NekDouble DmuDT,
133  const Array<OneD, NekDouble> &normals,
134  DNekMatSharedPtr &fluxJac);
135 
136  virtual void v_CalcPhysDeriv(
137  const Array<OneD, const Array<OneD, NekDouble>> &inarray,
139 
140  virtual void v_CalcMuDmuDT(
141  const Array<OneD, const Array<OneD, NekDouble>> &inarray,
143  Array<OneD, NekDouble> &DmuDT);
144 
145  /**
146  * @brief return part of viscous Jacobian:
147  * \todo flux derived with Qx=[drho_dx,drhou_dx,drhov_dx,drhoE_dx]
148  * Input:
149  * normals:Point normals
150  * U=[rho,rhou,rhov,rhoE]
151  * Output: 2D 3*4 Matrix (flux with rho is zero)
152  */
153  void GetdFlux_dQx_2D(
154  const Array<OneD, NekDouble> &normals,
155  const NekDouble &mu,
156  const Array<OneD, NekDouble> &U,
157  DNekMatSharedPtr &OutputMatrix );
158 
159  /**
160  * @brief return part of viscous Jacobian:
161  * \todo flux derived with Qx=[drho_dy,drhou_dy,drhov_dy,drhoE_dy]
162  * Input:
163  * normals:Point normals
164  * U=[rho,rhou,rhov,rhoE]
165  * Output: 2D 3*4 Matrix (flux with rho is zero)
166  */
167  void GetdFlux_dQy_2D(
168  const Array<OneD, NekDouble> &normals,
169  const NekDouble &mu,
170  const Array<OneD, NekDouble> &U,
171  DNekMatSharedPtr &OutputMatrix );
172 
173  /**
174  * @brief return part of viscous Jacobian derived with Qx=[drho_dx,drhou_dx,drhov_dx,drhow_dx,drhoE_dx]
175  * Input:
176  * normals:Point normals
177  * U=[rho,rhou,rhov,rhow,rhoE]
178  * dir: means whether derive with
179  * Qx=[drho_dx,drhou_dx,drhov_dx,drhow_dx,drhoE_dx]
180  * Output: 3D 4*5 Matrix (flux about rho is zero)
181  * OutputMatrix(dir=0)= dF_dQx;
182  */
183  void GetdFlux_dQx_3D(
184  const Array<OneD, NekDouble> &normals,
185  const NekDouble &mu,
186  const Array<OneD, NekDouble> &U,
187  DNekMatSharedPtr &OutputMatrix );
188 
189  /**
190  * @brief return part of viscous Jacobian derived with Qy=[drho_dy,drhou_dy,drhov_dy,drhow_dy,drhoE_dy]
191  * Input:
192  * normals:Point normals
193  * U=[rho,rhou,rhov,rhow,rhoE]
194  * dir: means whether derive with
195  * Qy=[drho_dy,drhou_dy,drhov_dy,drhow_dy,drhoE_dy]
196  * Output: 3D 4*5 Matrix (flux about rho is zero)
197  * OutputMatrix(dir=1)= dF_dQy;
198  */
199  void GetdFlux_dQy_3D(
200  const Array<OneD, NekDouble> &normals,
201  const NekDouble &mu,
202  const Array<OneD, NekDouble> &U,
203  DNekMatSharedPtr &OutputMatrix );
204 
205 
206  /**
207  * @brief return part of viscous Jacobian derived with Qz=[drho_dz,drhou_dz,drhov_dz,drhow_dz,drhoE_dz]
208  * Input:
209  * normals:Point normals
210  * U=[rho,rhou,rhov,rhow,rhoE]
211  * dir: means whether derive with
212  * Qz=[drho_dz,drhou_dz,drhov_dz,drhow_dz,drhoE_dz]
213  * Output: 3D 4*5 Matrix (flux about rho is zero)
214  * OutputMatrix(dir=2)= dF_dQz;
215  */
216  void GetdFlux_dQz_3D(
217  const Array<OneD, NekDouble> &normals,
218  const NekDouble &mu,
219  const Array<OneD, NekDouble> &U,
220  DNekMatSharedPtr &OutputMatrix );
221 
222 
223  /**
224  * @brief return part of viscous Jacobian
225  * Input:
226  * normals:Point normals
227  * mu: dynamicviscosity
228  * dmu_dT: mu's derivative with T using Sutherland's law
229  * U=[rho,rhou,rhov,rhoE]
230  * Output: 3*4 Matrix (the flux about rho is zero)
231  * OutputMatrix dFLux_dU, the matrix sign is consistent with SIPG
232  */
233  void GetdFlux_dU_2D(
234  const Array<OneD, NekDouble> &normals,
235  const NekDouble mu,
236  const NekDouble dmu_dT,
237  const Array<OneD, NekDouble> &U,
238  const Array<OneD, const Array<OneD, NekDouble> > &qfield,
239  DNekMatSharedPtr &OutputMatrix);
240 
241  /**
242  * @brief return part of viscous Jacobian
243  * Input:
244  * normals:Point normals
245  * mu: dynamicviscosity
246  * dmu_dT: mu's derivative with T using Sutherland's law
247  * U=[rho,rhou,rhov,rhow,rhoE]
248  * Output: 4*5 Matrix (the flux about rho is zero)
249  * OutputMatrix dFLux_dU, the matrix sign is consistent with SIPG
250  */
251  void GetdFlux_dU_3D(
252  const Array<OneD, NekDouble> &normals,
253  const NekDouble mu,
254  const NekDouble dmu_dT,
255  const Array<OneD, NekDouble> &U,
256  const Array<OneD, const Array<OneD, NekDouble>> &qfield,
257  DNekMatSharedPtr &OutputMatrix);
258 
259  };
260 }
261 #endif
262 
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
void GetdFlux_dU_2D(const Array< OneD, NekDouble > &normals, const NekDouble mu, const NekDouble dmu_dT, const Array< OneD, NekDouble > &U, const Array< OneD, const Array< OneD, NekDouble > > &qfield, DNekMatSharedPtr &OutputMatrix)
return part of viscous Jacobian Input: normals:Point normals mu: dynamicviscosity dmu_dT: mu's deriva...
virtual void v_GetDiffusionFluxJacPoint(const Array< OneD, NekDouble > &conservVar, const Array< OneD, const Array< OneD, NekDouble >> &conseDeriv, const NekDouble mu, const NekDouble DmuDT, const Array< OneD, NekDouble > &normals, DNekMatSharedPtr &fluxJac)
Array< OneD, GetdFlux_dDeriv > m_GetdFlux_dDeriv_Array
static SolverUtils::EquationSystemSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
virtual void v_GetFluxDerivJacDirctn(const MultiRegions::ExpListSharedPtr &explist, const Array< OneD, const Array< OneD, NekDouble >> &normals, const int nDervDir, const Array< OneD, const Array< OneD, NekDouble >> &inarray, TensorOfArray5D< NekDouble > &ElmtJacArray, const int nFluxDir)
void GetdFlux_dQx_3D(const Array< OneD, NekDouble > &normals, const NekDouble &mu, const Array< OneD, NekDouble > &U, DNekMatSharedPtr &OutputMatrix)
return part of viscous Jacobian derived with Qx=[drho_dx,drhou_dx,drhov_dx,drhow_dx,...
virtual void v_DoDiffusionCoeff(const Array< OneD, const Array< OneD, NekDouble >> &inarray, Array< OneD, Array< OneD, NekDouble >> &outarray, const Array< OneD, const Array< OneD, NekDouble >> &pFwd, const Array< OneD, const Array< OneD, NekDouble >> &pBwd)
virtual void v_CalcMuDmuDT(const Array< OneD, const Array< OneD, NekDouble >> &inarray, Array< OneD, NekDouble > &mu, Array< OneD, NekDouble > &DmuDT)
virtual void v_InitObject()
Initialization object for CompressibleFlowSystem class.
NavierStokesImplicitCFE(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
void GetdFlux_dQx_2D(const Array< OneD, NekDouble > &normals, const NekDouble &mu, const Array< OneD, NekDouble > &U, DNekMatSharedPtr &OutputMatrix)
return part of viscous Jacobian:
virtual void v_CalcPhysDeriv(const Array< OneD, const Array< OneD, NekDouble >> &inarray, TensorOfArray3D< NekDouble > &qfield)
void GetdFlux_dQy_3D(const Array< OneD, NekDouble > &normals, const NekDouble &mu, const Array< OneD, NekDouble > &U, DNekMatSharedPtr &OutputMatrix)
return part of viscous Jacobian derived with Qy=[drho_dy,drhou_dy,drhov_dy,drhow_dy,...
virtual void v_MinusDiffusionFluxJacPoint(const int nConvectiveFields, const int nElmtPnt, const Array< OneD, const Array< OneD, NekDouble >> &locVars, const TensorOfArray3D< NekDouble > &locDerv, const Array< OneD, NekDouble > &locmu, const Array< OneD, NekDouble > &locDmuDT, const Array< OneD, NekDouble > &normals, DNekMatSharedPtr &wspMat, Array< OneD, Array< OneD, NekDouble >> &PntJacArray)
void GetdFlux_dQz_3D(const Array< OneD, NekDouble > &normals, const NekDouble &mu, const Array< OneD, NekDouble > &U, DNekMatSharedPtr &OutputMatrix)
return part of viscous Jacobian derived with Qz=[drho_dz,drhou_dz,drhov_dz,drhow_dz,...
void GetdFlux_dQy_2D(const Array< OneD, NekDouble > &normals, const NekDouble &mu, const Array< OneD, NekDouble > &U, DNekMatSharedPtr &OutputMatrix)
return part of viscous Jacobian:
virtual void v_GetFluxDerivJacDirctnElmt(const int nConvectiveFields, const int nElmtPnt, const int nDervDir, const Array< OneD, const Array< OneD, NekDouble >> &locVars, const Array< OneD, NekDouble > &locmu, const Array< OneD, const Array< OneD, NekDouble >> &locnormal, DNekMatSharedPtr &wspMat, Array< OneD, Array< OneD, NekDouble >> &PntJacArray)
void GetdFlux_dU_3D(const Array< OneD, NekDouble > &normals, const NekDouble mu, const NekDouble dmu_dT, const Array< OneD, NekDouble > &U, const Array< OneD, const Array< OneD, NekDouble >> &qfield, DNekMatSharedPtr &OutputMatrix)
return part of viscous Jacobian Input: normals:Point normals mu: dynamicviscosity dmu_dT: mu's deriva...
std::function< void(const Array< OneD, NekDouble > &, const NekDouble &, const Array< OneD, NekDouble > &, DNekMatSharedPtr &)> GetdFlux_dDeriv
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
std::shared_ptr< EquationSystem > EquationSystemSharedPtr
A shared pointer to an EquationSystem object.
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
Definition: MeshGraph.h:174
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:1
std::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:69
double NekDouble