64 m_session->LoadParameter (
"thermalConductivity",
71 int nDim = pFields[0]->GetCoordim(0);
72 int nTracePts = pFields[0]->GetTrace()->GetTotPoints();
75 if (pSession->DefinesSolverInfo(
"HOMOGENEOUS"))
89 pFields[0]->GetTrace()->GetNormals(m_traceNormals);
106 const int nConvectiveFields,
112 int nDim = fields[0]->GetCoordim(0);
113 int nScalars = inarray.num_elements();
114 int nPts = fields[0]->GetTotPoints();
115 int nCoeffs = fields[0]->GetNcoeffs();
116 int nTracePts = fields[0]->GetTrace()->GetTotPoints();
135 for (i = 0; i < nScalars; ++i)
146 for (j = 0; j < nDim; ++j)
148 for (i = 0; i < nScalars; ++i)
150 fields[i]->IProductWRTDerivBase (j, inarray[i], tmp1);
152 fields[i]->AddTraceIntegral (numericalFluxO1[j][i],
154 fields[i]->SetPhysState (
false);
155 fields[i]->MultiplyByElmtInvMass(tmp1, tmp1);
156 fields[i]->BwdTrans (tmp1, derivativesO1[j][i]);
163 for (i = 0; i < nScalars; ++i)
178 for (i = 0; i < nScalars+1; ++i)
184 for (i = 0; i < nConvectiveFields; ++i)
195 for (i = 0; i < nConvectiveFields; ++i)
199 for (j = 0; j < nDim; ++j)
201 fields[i]->IProductWRTDerivBase(j,
m_viscTensor[j][i], tmp1);
202 Vmath::Vadd(nCoeffs, tmp1, 1, tmp2[i], 1, tmp2[i], 1);
207 fields[i]->AddTraceIntegral (viscousFlux[i], tmp2[i]);
208 fields[i]->SetPhysState (
false);
209 fields[i]->MultiplyByElmtInvMass(tmp2[i], tmp2[i]);
210 fields[i]->BwdTrans (tmp2[i], outarray[i]);
225 int nTracePts = fields[0]->GetTrace()->GetTotPoints();
226 int nScalars = inarray.num_elements();
227 int nDim = fields[0]->GetCoordim(0);
233 for(i = 0; i < nDim; ++i)
244 for (i = 0; i < nScalars; ++i)
249 fields[i]->GetFwdBwdTracePhys(inarray[i], Fwd[i], Bwd[i]);
250 fields[0]->GetTrace()->Upwind(Vn, Fwd[i], Bwd[i], numflux[i]);
256 for (i = 0; i < nScalars; ++i)
259 fields[i]->ExtractTracePhys(inarray[i], uplus[i]);
263 if (fields[0]->GetBndCondExpansions().num_elements())
271 for (i = 0; i < nScalars; ++i)
274 numflux[i], 1, numericalFluxO1[j][i], 1);
293 int nBndEdgePts, nBndEdges, nBndRegions;
295 int nTracePts = fields[0]->GetTrace()->GetTotPoints();
296 int nScalars = inarray.num_elements();
305 for (i = 0; i < nScalars; ++i)
311 for (i = 0; i < nScalars-1; ++i)
316 nBndRegions = fields[i+1]->
317 GetBndCondExpansions().num_elements();
318 for (j = 0; j < nBndRegions; ++j)
320 nBndEdges = fields[i+1]->
321 GetBndCondExpansions()[j]->GetExpSize();
322 for (e = 0; e < nBndEdges; ++e)
324 nBndEdgePts = fields[i+1]->
325 GetBndCondExpansions()[j]->GetExp(e)->GetTotPoints();
328 GetBndCondExpansions()[j]->GetPhys_Offset(e);
330 id2 = fields[0]->GetTrace()->
331 GetPhys_Offset(fields[0]->GetTraceMap()->
332 GetBndCondTraceToGlobalTraceMap(cnt++));
335 if (boost::iequals(fields[i]->GetBndConditions()[j]->
336 GetUserDefined(),
"WallViscous") ||
337 boost::iequals(fields[i]->GetBndConditions()[j]->
338 GetUserDefined(),
"WallAdiabatic"))
341 &scalarVariables[i][id2], 1);
346 else if (fields[i]->GetBndConditions()[j]->
347 GetBoundaryConditionType() ==
351 &(fields[i+1]->GetBndCondExpansions()[j]->
352 UpdatePhys())[id1], 1,
353 &(fields[0]->GetBndCondExpansions()[j]->
354 UpdatePhys())[id1], 1,
355 &scalarVariables[i][id2], 1);
359 if (fields[i]->GetBndConditions()[j]->
360 GetBoundaryConditionType() ==
364 &scalarVariables[i][id2], 1,
365 &penaltyfluxO1[i][id2], 1);
369 else if ((fields[i]->GetBndConditions()[j])->
370 GetBoundaryConditionType() ==
375 &penaltyfluxO1[i][id2], 1);
380 &scalarVariables[i][id2], 1,
381 &scalarVariables[i][id2], 1,
398 nBndRegions = fields[nScalars]->
399 GetBndCondExpansions().num_elements();
400 for (j = 0; j < nBndRegions; ++j)
402 nBndEdges = fields[nScalars]->
403 GetBndCondExpansions()[j]->GetExpSize();
404 for (e = 0; e < nBndEdges; ++e)
406 nBndEdgePts = fields[nScalars]->
407 GetBndCondExpansions()[j]->GetExp(e)->GetTotPoints();
409 id1 = fields[nScalars]->
410 GetBndCondExpansions()[j]->GetPhys_Offset(e);
412 id2 = fields[0]->GetTrace()->
413 GetPhys_Offset(fields[0]->GetTraceMap()->
414 GetBndCondTraceToGlobalTraceMap(cnt++));
417 if (boost::iequals(fields[i]->GetBndConditions()[j]->
418 GetUserDefined(),
"WallViscous"))
422 &scalarVariables[nScalars-1][id2], 1);
426 else if (fields[i]->GetBndConditions()[j]->
427 GetBoundaryConditionType() ==
433 GetBndCondExpansions()[j]->
436 GetBndCondExpansions()[j]->
438 &scalarVariables[nScalars-1][id2], 1);
442 &scalarVariables[nScalars-1][id2], 1,
444 &scalarVariables[nScalars-1][id2], 1);
448 &scalarVariables[nScalars-1][id2], 1,
449 &scalarVariables[nScalars-1][id2], 1);
453 if (fields[nScalars]->GetBndConditions()[j]->
454 GetBoundaryConditionType() ==
457 fields[nScalars]->GetBndConditions()[j]
458 ->GetUserDefined(),
"WallAdiabatic"))
461 &scalarVariables[nScalars-1][id2], 1,
462 &penaltyfluxO1[nScalars-1][id2], 1);
467 else if (((fields[nScalars]->GetBndConditions()[j])->
468 GetBoundaryConditionType() ==
470 boost::iequals(fields[nScalars]->GetBndConditions()[j]->
471 GetUserDefined(),
"WallAdiabatic"))
474 &uplus[nScalars-1][id2], 1,
475 &penaltyfluxO1[nScalars-1][id2], 1);
493 int nTracePts = fields[0]->GetTrace()->GetTotPoints();
494 int nVariables = fields.num_elements();
495 int nDim = fields[0]->GetCoordim(0);
506 for(i = 0; i < nDim; ++i)
517 for (i = 1; i < nVariables; ++i)
520 for (j = 0; j < nDim; ++j)
523 fields[i]->GetFwdBwdTracePhys(qfield[j][i], qFwd, qBwd);
526 fields[i]->GetTrace()->Upwind(Vn, qBwd, qFwd, qfluxtemp);
533 fields[i]->ExtractTracePhys(qfield[j][i], qtemp);
536 if (fields[0]->GetBndCondExpansions().num_elements())
562 int nBndEdges, nBndEdgePts;
566 int nTracePts = fields[0]->GetTrace()->GetTotPoints();
567 int nBndRegions = fields[var]->GetBndCondExpansions().num_elements();
572 for (i = 0; i < nBndRegions; ++i)
575 nBndEdges = fields[var]->
576 GetBndCondExpansions()[i]->GetExpSize();
579 for (e = 0; e < nBndEdges; ++e)
581 nBndEdgePts = fields[var]->
582 GetBndCondExpansions()[i]->GetExp(e)->GetTotPoints();
584 id2 = fields[0]->GetTrace()->
585 GetPhys_Offset(fields[0]->GetTraceMap()->
586 GetBndCondTraceToGlobalTraceMap(cnt++));
590 if(fields[var]->GetBndConditions()[i]->
592 && !boost::iequals(fields[var]->GetBndConditions()[i]->
593 GetUserDefined(),
"WallAdiabatic"))
598 &penaltyflux[id2], 1);
602 else if((fields[var]->GetBndConditions()[i])->
606 "Neumann bcs not implemented for LDGNS");
617 else if(boost::iequals(fields[var]->GetBndConditions()[i]->
618 GetUserDefined(),
"WallAdiabatic"))
630 &penaltyflux[id2], 1);
Array< OneD, Array< OneD, NekDouble > > m_traceNormals
Array< OneD, Array< OneD, NekDouble > > m_homoDerivs
#define ASSERTL0(condition, msg)
static DiffusionSharedPtr create(std::string diffType)
DiffusionFactory & GetDiffusionFactory()
void Svtvp(int n, const T alpha, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
svtvp (scalar times vector plus vector): z = alpha*x + y
virtual void v_WeakPenaltyO2(const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const int var, const int dir, const Array< OneD, const NekDouble > &qfield, const Array< OneD, const NekDouble > &qtemp, Array< OneD, NekDouble > &penaltyflux)
Imposes appropriate bcs for the 2nd order derivatives.
virtual void v_InitObject(LibUtilities::SessionReaderSharedPtr pSession, Array< OneD, MultiRegions::ExpListSharedPtr > pFields)
void Vdiv(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x/y.
DiffusionFluxVecCBNS m_fluxVectorNS
LibUtilities::SessionReaderSharedPtr m_session
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > m_viscTensor
Array< OneD, Array< OneD, NekDouble > > m_traceVel
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*y.
virtual void v_WeakPenaltyO1(const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, Array< OneD, NekDouble > > &inarray, const Array< OneD, Array< OneD, NekDouble > > &uplus, Array< OneD, Array< OneD, NekDouble > > &penaltyfluxO1)
Imposes appropriate bcs for the 1st order derivatives.
NekDouble m_thermalConductivity
void Neg(int n, T *x, const int incx)
Negate x = -x.
virtual void v_NumericalFluxO2(const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, Array< OneD, NekDouble > > &ufield, Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &qfield, Array< OneD, Array< OneD, NekDouble > > &qflux)
Build the numerical flux for the 2nd order derivatives.
virtual void v_NumericalFluxO1(const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &numericalFluxO1)
Builds the numerical flux for the 1st order derivatives.
void Vsub(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Subtract vector z = x-y.
std::string m_ViscosityType
virtual void v_Diffuse(const int nConvective, const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
Calculate weak DG Diffusion in the LDG form for the Navier-Stokes (NS) equations: ...
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.