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
43
44namespace Nektar
45{
46/**
47 *
48 *
49 **/
51 virtual public CFSImplicit
52{
53public:
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 ~NavierStokesImplicitCFE() override = default;
71
72 typedef std::function<void(
73 const Array<OneD, NekDouble> &, const NekDouble &,
76
77protected:
79
83
84 void v_InitObject(bool DeclareFields = true) override;
85
87 const Array<OneD, const Array<OneD, NekDouble>> &inarray,
89 const Array<OneD, const Array<OneD, NekDouble>> &pFwd,
90 const Array<OneD, const Array<OneD, NekDouble>> &pBwd) override;
91
93 [[maybe_unused]] const Array<OneD, Array<OneD, NekDouble>> &inarray,
94 [[maybe_unused]] Array<OneD, Array<OneD, NekDouble>> &outarray,
95 [[maybe_unused]] const Array<OneD, Array<OneD, NekDouble>> &pFwd,
96 [[maybe_unused]] const Array<OneD, Array<OneD, NekDouble>> &pBwd) final
97 {
99 "v_DoDiffusion is not implemented for implicit solvers");
100 }
101
103 const int nConvectiveFields, const int nElmtPnt,
104 const Array<OneD, const Array<OneD, NekDouble>> &locVars,
105 const TensorOfArray3D<NekDouble> &locDerv,
106 const Array<OneD, NekDouble> &locmu,
107 const Array<OneD, NekDouble> &locDmuDT,
108 const Array<OneD, NekDouble> &normals, DNekMatSharedPtr &wspMat,
109 Array<OneD, Array<OneD, NekDouble>> &PntJacArray) override;
110
112 const MultiRegions::ExpListSharedPtr &explist,
113 const Array<OneD, const Array<OneD, NekDouble>> &normals,
114 const int nDervDir,
115 const Array<OneD, const Array<OneD, NekDouble>> &inarray,
116 TensorOfArray5D<NekDouble> &ElmtJacArray, const int nFluxDir) override;
117
119 const int nConvectiveFields, const int nElmtPnt, const int nDervDir,
120 const Array<OneD, const Array<OneD, NekDouble>> &locVars,
121 const Array<OneD, NekDouble> &locmu,
122 const Array<OneD, const Array<OneD, NekDouble>> &locnormal,
123 DNekMatSharedPtr &wspMat,
124 Array<OneD, Array<OneD, NekDouble>> &PntJacArray) override;
125
127 const MultiRegions::ExpListSharedPtr &explist,
128 const Array<OneD, const Array<OneD, NekDouble>> &normals,
129 const int nDervDir,
130 const Array<OneD, const Array<OneD, NekDouble>> &inarray,
131 Array<OneD, Array<OneD, DNekMatSharedPtr>> &ElmtJac) override;
132
133 virtual void v_GetDiffusionFluxJacPoint(
134 const Array<OneD, NekDouble> &conservVar,
135 const Array<OneD, const Array<OneD, NekDouble>> &conseDeriv,
136 const NekDouble mu, const NekDouble DmuDT,
137 const Array<OneD, NekDouble> &normals, DNekMatSharedPtr &fluxJac);
138
139 void v_CalcPhysDeriv(
140 const Array<OneD, const Array<OneD, NekDouble>> &inarray,
141 TensorOfArray3D<NekDouble> &qfield) override;
142
143 void v_CalcMuDmuDT(const Array<OneD, const Array<OneD, NekDouble>> &inarray,
145 Array<OneD, NekDouble> &DmuDT) override;
146
147 /**
148 * @brief return part of viscous Jacobian:
149 * \todo flux derived with Qx=[drho_dx,drhou_dx,drhov_dx,drhoE_dx]
150 * Input:
151 * normals:Point normals
152 * U=[rho,rhou,rhov,rhoE]
153 * Output: 2D 3*4 Matrix (flux with rho is zero)
154 */
155 void GetdFlux_dQx_2D(const Array<OneD, NekDouble> &normals,
156 const NekDouble &mu, 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(const Array<OneD, NekDouble> &normals,
168 const NekDouble &mu, const Array<OneD, NekDouble> &U,
169 DNekMatSharedPtr &OutputMatrix);
170
171 /**
172 * @brief return part of viscous Jacobian derived with
173 * Qx=[drho_dx,drhou_dx,drhov_dx,drhow_dx,drhoE_dx] Input: normals:Point
174 * normals U=[rho,rhou,rhov,rhow,rhoE] dir: means whether derive with
175 * Qx=[drho_dx,drhou_dx,drhov_dx,drhow_dx,drhoE_dx]
176 * Output: 3D 4*5 Matrix (flux about rho is zero)
177 * OutputMatrix(dir=0)= dF_dQx;
178 */
179 void GetdFlux_dQx_3D(const Array<OneD, NekDouble> &normals,
180 const NekDouble &mu, const Array<OneD, NekDouble> &U,
181 DNekMatSharedPtr &OutputMatrix);
182
183 /**
184 * @brief return part of viscous Jacobian derived with
185 * Qy=[drho_dy,drhou_dy,drhov_dy,drhow_dy,drhoE_dy] Input: normals:Point
186 * normals U=[rho,rhou,rhov,rhow,rhoE] dir: means whether derive with
187 * Qy=[drho_dy,drhou_dy,drhov_dy,drhow_dy,drhoE_dy]
188 * Output: 3D 4*5 Matrix (flux about rho is zero)
189 * OutputMatrix(dir=1)= dF_dQy;
190 */
191 void GetdFlux_dQy_3D(const Array<OneD, NekDouble> &normals,
192 const NekDouble &mu, const Array<OneD, NekDouble> &U,
193 DNekMatSharedPtr &OutputMatrix);
194
195 /**
196 * @brief return part of viscous Jacobian derived with
197 * Qz=[drho_dz,drhou_dz,drhov_dz,drhow_dz,drhoE_dz] Input: normals:Point
198 * normals U=[rho,rhou,rhov,rhow,rhoE] dir: means whether derive with
199 * Qz=[drho_dz,drhou_dz,drhov_dz,drhow_dz,drhoE_dz]
200 * Output: 3D 4*5 Matrix (flux about rho is zero)
201 * OutputMatrix(dir=2)= dF_dQz;
202 */
203 void GetdFlux_dQz_3D(const Array<OneD, NekDouble> &normals,
204 const NekDouble &mu, const Array<OneD, NekDouble> &U,
205 DNekMatSharedPtr &OutputMatrix);
206
207 /**
208 * @brief return part of viscous Jacobian
209 * Input:
210 * normals:Point normals
211 * mu: dynamicviscosity
212 * dmu_dT: mu's derivative with T using Sutherland's law
213 * U=[rho,rhou,rhov,rhoE]
214 * Output: 3*4 Matrix (the flux about rho is zero)
215 * OutputMatrix dFLux_dU, the matrix sign is consistent with SIPG
216 */
217 void GetdFlux_dU_2D(const Array<OneD, NekDouble> &normals,
218 const NekDouble mu, const NekDouble dmu_dT,
219 const Array<OneD, NekDouble> &U,
220 const Array<OneD, const Array<OneD, NekDouble>> &qfield,
221 DNekMatSharedPtr &OutputMatrix);
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,rhow,rhoE]
230 * Output: 4*5 Matrix (the flux about rho is zero)
231 * OutputMatrix dFLux_dU, the matrix sign is consistent with SIPG
232 */
233 void GetdFlux_dU_3D(const Array<OneD, NekDouble> &normals,
234 const NekDouble mu, const NekDouble dmu_dT,
235 const Array<OneD, NekDouble> &U,
236 const Array<OneD, const Array<OneD, NekDouble>> &qfield,
237 DNekMatSharedPtr &OutputMatrix);
238
239 bool v_SupportsShockCaptType(const std::string type) const final;
240};
241} // namespace Nektar
242#endif
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mode...
Definition: ErrorUtil.hpp:202
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...
Array< OneD, GetdFlux_dDeriv > m_GetdFlux_dDeriv_Array
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,...
bool v_SupportsShockCaptType(const std::string type) const final
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...
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)
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:
void v_DoDiffusion(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) final
~NavierStokesImplicitCFE() override=default
void v_InitObject(bool DeclareFields=true) override
Initialization object for CompressibleFlowSystem class.
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_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
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
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
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 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
void v_CalcPhysDeriv(const Array< OneD, const Array< OneD, NekDouble > > &inarray, TensorOfArray3D< NekDouble > &qfield) override
void v_CalcMuDmuDT(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, NekDouble > &mu, Array< OneD, NekDouble > &DmuDT) override
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
std::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:75
double NekDouble