Nektar++
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  **/
51  virtual public CFSImplicit
52 {
53 public:
55 
56  // Creates an instance of this class
60  {
63  pGraph);
64  p->InitObject();
65  return p;
66  }
67  // Name of class
68  static std::string className;
69 
70  virtual ~NavierStokesImplicitCFE();
71 
72  typedef std::function<void(
73  const Array<OneD, NekDouble> &, const NekDouble &,
76 
77 protected:
79 
83 
84  virtual void v_InitObject(bool DeclareFields = true) override;
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) override;
91 
92  virtual void v_MinusDiffusionFluxJacPoint(
93  const int nConvectiveFields, const int nElmtPnt,
94  const Array<OneD, const Array<OneD, NekDouble>> &locVars,
95  const TensorOfArray3D<NekDouble> &locDerv,
96  const Array<OneD, NekDouble> &locmu,
97  const Array<OneD, NekDouble> &locDmuDT,
98  const Array<OneD, NekDouble> &normals, DNekMatSharedPtr &wspMat,
99  Array<OneD, Array<OneD, NekDouble>> &PntJacArray) override;
100 
101  virtual void v_GetFluxDerivJacDirctn(
102  const MultiRegions::ExpListSharedPtr &explist,
103  const Array<OneD, const Array<OneD, NekDouble>> &normals,
104  const int nDervDir,
105  const Array<OneD, const Array<OneD, NekDouble>> &inarray,
106  TensorOfArray5D<NekDouble> &ElmtJacArray, const int nFluxDir) override;
107 
108  virtual void v_GetFluxDerivJacDirctnElmt(
109  const int nConvectiveFields, const int nElmtPnt, const int nDervDir,
110  const Array<OneD, const Array<OneD, NekDouble>> &locVars,
111  const Array<OneD, NekDouble> &locmu,
112  const Array<OneD, const Array<OneD, NekDouble>> &locnormal,
113  DNekMatSharedPtr &wspMat,
114  Array<OneD, Array<OneD, NekDouble>> &PntJacArray) override;
115 
116  virtual void v_GetFluxDerivJacDirctn(
117  const MultiRegions::ExpListSharedPtr &explist,
118  const Array<OneD, const Array<OneD, NekDouble>> &normals,
119  const int nDervDir,
120  const Array<OneD, const Array<OneD, NekDouble>> &inarray,
121  Array<OneD, Array<OneD, DNekMatSharedPtr>> &ElmtJac) override;
122 
123  virtual void v_GetDiffusionFluxJacPoint(
124  const Array<OneD, NekDouble> &conservVar,
125  const Array<OneD, const Array<OneD, NekDouble>> &conseDeriv,
126  const NekDouble mu, const NekDouble DmuDT,
127  const Array<OneD, NekDouble> &normals, DNekMatSharedPtr &fluxJac);
128 
129  virtual void v_CalcPhysDeriv(
130  const Array<OneD, const Array<OneD, NekDouble>> &inarray,
131  TensorOfArray3D<NekDouble> &qfield) override;
132 
133  virtual void v_CalcMuDmuDT(
134  const Array<OneD, const Array<OneD, NekDouble>> &inarray,
135  Array<OneD, NekDouble> &mu, Array<OneD, NekDouble> &DmuDT) override;
136 
137  /**
138  * @brief return part of viscous Jacobian:
139  * \todo flux derived with Qx=[drho_dx,drhou_dx,drhov_dx,drhoE_dx]
140  * Input:
141  * normals:Point normals
142  * U=[rho,rhou,rhov,rhoE]
143  * Output: 2D 3*4 Matrix (flux with rho is zero)
144  */
145  void GetdFlux_dQx_2D(const Array<OneD, NekDouble> &normals,
146  const NekDouble &mu, const Array<OneD, NekDouble> &U,
147  DNekMatSharedPtr &OutputMatrix);
148 
149  /**
150  * @brief return part of viscous Jacobian:
151  * \todo flux derived with Qx=[drho_dy,drhou_dy,drhov_dy,drhoE_dy]
152  * Input:
153  * normals:Point normals
154  * U=[rho,rhou,rhov,rhoE]
155  * Output: 2D 3*4 Matrix (flux with rho is zero)
156  */
157  void GetdFlux_dQy_2D(const Array<OneD, NekDouble> &normals,
158  const NekDouble &mu, const Array<OneD, NekDouble> &U,
159  DNekMatSharedPtr &OutputMatrix);
160 
161  /**
162  * @brief return part of viscous Jacobian derived with
163  * Qx=[drho_dx,drhou_dx,drhov_dx,drhow_dx,drhoE_dx] Input: normals:Point
164  * normals U=[rho,rhou,rhov,rhow,rhoE] dir: means whether derive with
165  * Qx=[drho_dx,drhou_dx,drhov_dx,drhow_dx,drhoE_dx]
166  * Output: 3D 4*5 Matrix (flux about rho is zero)
167  * OutputMatrix(dir=0)= dF_dQx;
168  */
169  void GetdFlux_dQx_3D(const Array<OneD, NekDouble> &normals,
170  const NekDouble &mu, const Array<OneD, NekDouble> &U,
171  DNekMatSharedPtr &OutputMatrix);
172 
173  /**
174  * @brief return part of viscous Jacobian derived with
175  * Qy=[drho_dy,drhou_dy,drhov_dy,drhow_dy,drhoE_dy] Input: normals:Point
176  * normals U=[rho,rhou,rhov,rhow,rhoE] dir: means whether derive with
177  * Qy=[drho_dy,drhou_dy,drhov_dy,drhow_dy,drhoE_dy]
178  * Output: 3D 4*5 Matrix (flux about rho is zero)
179  * OutputMatrix(dir=1)= dF_dQy;
180  */
181  void GetdFlux_dQy_3D(const Array<OneD, NekDouble> &normals,
182  const NekDouble &mu, const Array<OneD, NekDouble> &U,
183  DNekMatSharedPtr &OutputMatrix);
184 
185  /**
186  * @brief return part of viscous Jacobian derived with
187  * Qz=[drho_dz,drhou_dz,drhov_dz,drhow_dz,drhoE_dz] Input: normals:Point
188  * normals U=[rho,rhou,rhov,rhow,rhoE] dir: means whether derive with
189  * Qz=[drho_dz,drhou_dz,drhov_dz,drhow_dz,drhoE_dz]
190  * Output: 3D 4*5 Matrix (flux about rho is zero)
191  * OutputMatrix(dir=2)= dF_dQz;
192  */
193  void GetdFlux_dQz_3D(const Array<OneD, NekDouble> &normals,
194  const NekDouble &mu, const Array<OneD, NekDouble> &U,
195  DNekMatSharedPtr &OutputMatrix);
196 
197  /**
198  * @brief return part of viscous Jacobian
199  * Input:
200  * normals:Point normals
201  * mu: dynamicviscosity
202  * dmu_dT: mu's derivative with T using Sutherland's law
203  * U=[rho,rhou,rhov,rhoE]
204  * Output: 3*4 Matrix (the flux about rho is zero)
205  * OutputMatrix dFLux_dU, the matrix sign is consistent with SIPG
206  */
207  void GetdFlux_dU_2D(const Array<OneD, NekDouble> &normals,
208  const NekDouble mu, const NekDouble dmu_dT,
209  const Array<OneD, NekDouble> &U,
210  const Array<OneD, const Array<OneD, NekDouble>> &qfield,
211  DNekMatSharedPtr &OutputMatrix);
212 
213  /**
214  * @brief return part of viscous Jacobian
215  * Input:
216  * normals:Point normals
217  * mu: dynamicviscosity
218  * dmu_dT: mu's derivative with T using Sutherland's law
219  * U=[rho,rhou,rhov,rhow,rhoE]
220  * Output: 4*5 Matrix (the flux about rho is zero)
221  * OutputMatrix dFLux_dU, the matrix sign is consistent with SIPG
222  */
223  void GetdFlux_dU_3D(const Array<OneD, NekDouble> &normals,
224  const NekDouble mu, const NekDouble dmu_dT,
225  const Array<OneD, NekDouble> &U,
226  const Array<OneD, const Array<OneD, NekDouble>> &qfield,
227  DNekMatSharedPtr &OutputMatrix);
228 };
229 } // namespace Nektar
230 #endif
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.
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
virtual void v_CalcMuDmuDT(const Array< OneD, const Array< OneD, NekDouble >> &inarray, Array< OneD, NekDouble > &mu, Array< OneD, NekDouble > &DmuDT) override
static SolverUtils::EquationSystemSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
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) override
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_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) override
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_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) override
virtual void v_InitObject(bool DeclareFields=true) override
Initialization object for CompressibleFlowSystem class.
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,...
std::function< void(const Array< OneD, NekDouble > &, const NekDouble &, const Array< OneD, NekDouble > &, DNekMatSharedPtr &)> GetdFlux_dDeriv
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) override
virtual void v_CalcPhysDeriv(const Array< OneD, const Array< OneD, NekDouble >> &inarray, TensorOfArray3D< NekDouble > &qfield) override
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:
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::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:172
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