35 #include <boost/core/ignore_unused.hpp> 45 RegisterCreatorFunction(
"PressureOutflowNonReflective",
46 PressureOutflowNonReflectiveBC::create,
47 "Pressure outflow non-reflective boundary condition.");
49 PressureOutflowNonReflectiveBC::PressureOutflowNonReflectiveBC(
56 :
CFSBndCond(pSession, pFields, pTraceNormals, pSpaceDim, bcRegion, cnt)
59 GetBndCondExpansions()[
m_bcRegion]->GetNpoints();
73 boost::ignore_unused(time);
76 int nTracePts =
m_fields[0]->GetTrace()->GetNpoints();
77 int nVariables = physarray.num_elements();
86 for (i = 0; i < nDimensions; ++i)
88 Vmath::Vdiv(nTracePts, Fwd[i+1], 1, Fwd[0], 1, Vel, 1);
95 m_varConv->GetAbsoluteVelocity(Fwd, absVel);
99 m_varConv->GetSoundSpeed(Fwd, soundSpeed);
103 Vmath::Vdiv(nTracePts, Vn, 1, soundSpeed, 1, Mach, 1);
107 int e, id1, id2, npts, pnt;
115 GetExp(e)->GetTotPoints();
124 m_varConv->GetEFromRhoP(rho, pressure, Ei);
127 for (i = 0; i < npts; i++)
132 if (Mach[pnt] < 0.99)
136 for (j = 1; j < nVariables-1; ++j)
138 Ek += 0.5 * (Fwd[j][pnt] * Fwd[j][pnt]) / Fwd[0][pnt];
141 rhoeb = Fwd[0][pnt] * Ei[i] + Ek;
144 for (j = 0; j < nVariables-1; ++j)
147 UpdatePhys())[id1+i] = Fwd[j][pnt];
151 UpdatePhys())[id1+i] = 2.0 * rhoeb - Fwd[nVariables-1][pnt];
156 for (j = 0; j < nVariables; ++j)
160 UpdatePhys())[id1+i] = Fwd[j][pnt];
int m_spacedim
Space dimension.
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
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.
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array of fields.
void Vabs(int n, const T *x, const int incx, T *y, const int incy)
vabs: y = |x|
Array< OneD, NekDouble > m_pressureStorage
virtual void v_Apply(Array< OneD, Array< OneD, NekDouble > > &Fwd, Array< OneD, Array< OneD, NekDouble > > &physarray, const NekDouble &time)
CFSBndCondFactory & GetCFSBndCondFactory()
Declaration of the boundary condition factory singleton.
Encapsulates the user-defined boundary conditions for compressible flow solver.
VariableConverterSharedPtr m_varConv
Auxiliary object to convert variables.
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Array< OneD, Array< OneD, NekDouble > > m_traceNormals
Trace normals.
std::shared_ptr< SessionReader > SessionReaderSharedPtr
int m_bcRegion
Id of the boundary region.