48 "Riemann invariant boundary condition, \
56 const int pSpaceDim,
const int bcRegion,
const int cnt)
57 :
CFSBndCond(pSession, pFields, pTraceNormals, pGridVelocity, pSpaceDim,
65 m_npts = bndexp->GetTotPoints();
74 for (
int e = 0; e < bndexp->GetNumElmts(); ++e)
76 int nTracePts = bndexp->GetExp(e)->GetTotPoints();
82 for (
int i = 0; i < nTracePts; i++)
92 for (
int i = 0; i <
m_fields.size(); ++i)
121 for (
int j = 0; j <
m_npts; ++j)
140 for (i = 0; i < Fwd.size(); ++i)
143 for (j = 0; j <
m_npts; ++j)
153 for (i = 0; i < nDimensions; ++i)
155 for (j = 0; j <
m_npts; ++j)
168 m_varConv->GetSoundSpeed(FwdBnd, soundSpeed);
181 NekDouble EBC, rR, cstar, pstar, rhostar, ustar, Sstar, vn;
184 NekDouble twoOverGamMinOne = 2.0 / gamMinOne;
189 for (
int pnt = 0; pnt <
m_npts; ++pnt)
195 if (Mach[pnt] < 1.00)
205 tmp1 = twoOverGamMinOne * rR;
207 tmp2 = rR * rR - vn * vn -
210 (twoOverGamMinOne * twoOverGamMinOne + twoOverGamMinOne) *
212 cstar = -twoOverGamMinOne * rR +
sqrt(tmp1 - tmp2);
213 cstar = cstar / (twoOverGamMinOne * twoOverGamMinOne +
215 ustar = rR + twoOverGamMinOne * cstar;
217 rhostar = pow(cstar * cstar / (
m_gamma * Sstar),
218 0.5 * twoOverGamMinOne);
219 pstar = rhostar * cstar * cstar * gamInv;
240 EBC = pL * twoOverGamMinOne * 0.5;
252 for (j = 0; j < nDimensions; ++j)
261 EBC += 0.5 * rhoL * velBC[j] * velBC[j];
267 for (j = 0; j < nDimensions; ++j)
279 if (Mach[pnt] < 1.00)
287 rhostar = FwdBnd[0][pnt] * pow((pstar /
pressure[pnt]), gamInv);
289 ustar = rR + cstar * twoOverGamMinOne;
305 EBC = pL * twoOverGamMinOne * 0.5;
310 for (j = 0; j < nDimensions; ++j)
313 EBC += 0.5 * rhoL * velBC[j] * velBC[j];
318 for (j = 0; j < nDimensions; ++j)
Encapsulates the user-defined boundary conditions for compressible flow solver.
int m_spacedim
Space dimension.
Array< OneD, Array< OneD, NekDouble > > m_traceNormals
Trace normals.
NekDouble m_gamma
Parameters of the flow.
int m_bcRegion
Id of the boundary region.
VariableConverterSharedPtr m_varConv
Auxiliary object to convert variables.
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array of fields.
EnforceEntropyTotalEnthalpy(const LibUtilities::SessionReaderSharedPtr &pSession, const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const Array< OneD, Array< OneD, NekDouble > > &pTraceNormals, const Array< OneD, Array< OneD, NekDouble > > &pGridVelocity, const int pSpaceDim, const int bcRegion, const int cnt)
static CFSBndCondSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const Array< OneD, Array< OneD, NekDouble > > &pTraceNormals, const Array< OneD, Array< OneD, NekDouble > > &pGridVelocity, const int pSpaceDim, const int bcRegion, const int cnt)
Creates an instance of this class.
Array< OneD, int > m_bndToTraceMap
Array< OneD, Array< OneD, NekDouble > > m_bndPhys
Array< OneD, NekDouble > m_VnInf
Reference normal velocity.
Array< OneD, NekDouble > m_rhoBC
void v_Apply(Array< OneD, Array< OneD, NekDouble > > &Fwd, Array< OneD, Array< OneD, NekDouble > > &physarray, const NekDouble &time) override
Array< OneD, NekDouble > m_pBC
Array< OneD, Array< OneD, NekDouble > > m_velBC
static std::string className
Name of the class.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
CFSBndCondFactory & GetCFSBndCondFactory()
Declaration of the boundary condition factory singleton.
void Vabs(int n, const T *x, const int incx, T *y, const int incy)
vabs: y = |x|
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.
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
scalarT< T > sqrt(scalarT< T > in)