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