48template <
typename ExecSpace,
typename TData>
50 const size_t stride,
const size_t eng,
const TData *bndPtr, TData *pOut,
51 const unsigned int streamID = 0)
55 Nektar::parallel_for<ExecSpace>(
57 NEKTAR_LAMBDA(
const size_t i) { pOut[i] = bndPtr[eng * stride + i]; });
67template <
typename ExecSpace,
typename TData,
typename EoSParamType>
69 const size_t stride,
const unsigned coordDim,
const size_t eng,
70 const EoSParamType EoS,
const TData *pOut,
const TData *norms,
71 TData *bndPtr,
const unsigned int streamID = 0)
75 Nektar::parallel_for<ExecSpace>(
80 const TData rho = bndPtr[i];
85 TData momSq = TData(0.0);
86 TData momDotN = TData(0.0);
87 for (
unsigned d = 1; d <= coordDim; ++d)
89 const TData m = bndPtr[d * stride + i];
91 momDotN += m * norms[(d - 1) * stride + i];
93 const TData Ek = TData(0.5) * momSq / rho;
95 const TData eInt = (bndPtr[eng * stride + i] - Ek) / rho;
101 const TData MachN =
abs(momDotN) / (rho * c);
103 if (MachN < TData(0.99))
109 bndPtr[eng * stride + i] = rho * eOut + Ek;
static NEK_FORCE_INLINE void ApplyPressureOutflowBlock(const size_t stride, const unsigned coordDim, const size_t eng, const EoSParamType EoS, const TData *pOut, const TData *norms, TData *bndPtr, const unsigned int streamID=0)
Impose the prescribed pressure on a block's seeded interior state where the outflow is subsonic; supe...
NEK_HOSTDEVICE_INLINE TData GetSoundSpeed(const IdealGasEoS< TScalar > &EoS, const TData &rho, const TData &e)
NEK_HOSTDEVICE_INLINE TData GetIntEnergyFromPressure(const IdealGasEoS< TScalar > &EoS, const TData &rho, const TData &p)
Specific internal energy at a prescribed pressure; the inverse of GetPressure() in its second argumen...
static NEK_FORCE_INLINE void CopyPrescribedPressureBlock(const size_t stride, const size_t eng, const TData *bndPtr, TData *pOut, const unsigned int streamID=0)
Copy the prescribed pressure out of the energy slot of a block's session-evaluated storage.
static void LoopExecutionSetStreamID(const unsigned int streamID)
scalarT< T > abs(scalarT< T > in)