42 string NavierStokesCFE::className =
44 "NavierStokesCFE", NavierStokesCFE::create,
45 "NavierStokes equations in conservative variables.");
47 NavierStokesCFE::NavierStokesCFE(
66 m_session->LoadSolverInfo(
"DiffusionType", diffName,
"LDGNS");
94 int nvariables = inarray.num_elements();
104 for (i = 0; i < nvariables; ++i)
109 for (i = 0; i < nvariables-1; ++i)
118 m_varConv->GetPressure(inarray, inarrayDiff[0]);
121 m_varConv->GetTemperature(inarray, inarrayDiff[0],
122 inarrayDiff[nvariables-2]);
125 m_varConv->GetVelocityVector(inarray, inarrayDiff);
139 m_varConv->GetTemperature(pFwd, inFwd[0],
140 inFwd[nvariables-2]);
141 m_varConv->GetTemperature(pBwd, inBwd[0],
142 inBwd[nvariables-2]);
144 m_varConv->GetVelocityVector(pFwd, inFwd);
145 m_varConv->GetVelocityVector(pBwd, inBwd);
152 for (i = 0; i < nvariables; ++i)
171 int nVariables =
m_fields.num_elements();
172 int nPts = physfield[0].num_elements();
185 m_varConv->GetDynamicViscosity(physfield[nVariables-2], mu);
187 Vmath::Smul(nPts, tRa, mu, 1, thermalConductivity, 1);
193 thermalConductivity, 1);
199 Vmath::Vadd(nPts, divVel, 1, derivativesO1[j][j], 1,
219 derivativesO1[j][i], 1,
220 viscousTensor[i][j+1], 1);
223 viscousTensor[i][j+1], 1,
224 viscousTensor[i][j+1], 1);
231 viscousTensor[i][j+1], 1);
237 viscousTensor[j][i+1], 1);
245 Vmath::Zero(nPts, viscousTensor[i][m_spacedim+1], 1);
250 viscousTensor[i][j+1], 1,
251 viscousTensor[i][m_spacedim+1], 1,
252 viscousTensor[i][m_spacedim+1], 1);
256 derivativesO1[i][m_spacedim], 1,
257 viscousTensor[i][m_spacedim+1], 1,
258 viscousTensor[i][m_spacedim+1], 1);
272 int nVariables =
m_fields.num_elements();
276 int nPts =
m_fields[0]->Get1DScaledTotPoints(OneDptscale);
277 int nPts_orig = physfield[0].num_elements();
290 m_varConv->GetDynamicViscosity(physfield[nVariables-2], mu);
292 Vmath::Smul(nPts, tRa, mu, 1, thermalConductivity, 1);
298 thermalConductivity, 1);
312 OneDptscale, physfield[i], vel_interp[i]);
316 for (j = 0; j < m_spacedim+1; ++j)
320 OneDptscale, derivativesO1[i][j], deriv_interp[i][j]);
325 for (j = 1; j < m_spacedim+2; ++j)
334 Vmath::Vadd(nPts, divVel, 1, deriv_interp[j][j], 1,
354 deriv_interp[j][i], 1,
355 out_interp[i][j+1], 1);
358 out_interp[i][j+1], 1,
359 out_interp[i][j+1], 1);
366 out_interp[i][j+1], 1);
371 out_interp[j][i+1] = out_interp[i][j+1];
384 out_interp[i][j+1], 1,
385 out_interp[i][m_spacedim+1], 1,
386 out_interp[i][m_spacedim+1], 1);
390 deriv_interp[i][m_spacedim], 1,
391 out_interp[i][m_spacedim+1], 1,
392 out_interp[i][m_spacedim+1], 1);
398 for (j = 1; j < m_spacedim+2; ++j)
400 m_fields[0]->PhysGalerkinProjection1DScaled(
403 viscousTensor[i][j]);
virtual void v_InitObject()
Initialization object for CompressibleFlowSystem class.
virtual void v_InitObject()
Initialization object for CompressibleFlowSystem class.
tBaseSharedPtr CreateInstance(tKey idKey BOOST_PP_COMMA_IF(MAX_PARAM) BOOST_PP_ENUM_BINARY_PARAMS(MAX_PARAM, tParam, x))
Create an instance of the class referred to by idKey.
VariableConverterSharedPtr m_varConv
void Fill(int n, const T alpha, T *x, const int incx)
Fill a vector with a constant value.
DiffusionFactory & GetDiffusionFactory()
void Vvtvp(int n, const T *w, const int incw, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
vvtvp (vector times vector plus vector): z = w*x + y
std::string m_ViscosityType
bool m_specHP_dealiasing
Flag to determine if dealisising is usde for the Spectral/hp element discretisation.
void GetViscousFluxVector(const Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &derivatives, Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &viscousTensor)
Return the flux vector for the LDG diffusion problem.
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*y.
int m_spacedim
Spatial dimension (>= expansion dim).
void GetViscousFluxVectorDeAlias(const Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &derivatives, Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &viscousTensor)
Return the flux vector for the LDG diffusion problem.
EquationSystemFactory & GetEquationSystemFactory()
SolverUtils::DiffusionSharedPtr m_diffusion
SOLVER_UTILS_EXPORT int GetTraceTotPoints()
NekDouble m_thermalConductivity
SOLVER_UTILS_EXPORT int GetNpoints()
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
LibUtilities::SessionReaderSharedPtr m_session
The session reader.
virtual void v_DoDiffusion(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const Array< OneD, Array< OneD, NekDouble > > &pFwd, const Array< OneD, Array< OneD, NekDouble > > &pBwd)
virtual ~NavierStokesCFE()
static Array< OneD, Array< OneD, NekDouble > > NullNekDoubleArrayofArray
void Zero(int n, T *x, const int incx)
Zero vector.
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
void Vadd(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = x+y.
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, tDescription pDesc="")
Register a class with the factory.