35 #include <boost/core/ignore_unused.hpp> 45 RegisterCreatorFunction(
"IsentropicVortex",
46 IsentropicVortexBC::create,
47 "Isentropic vortex boundary condition.");
55 :
CFSBndCond(pSession, pFields, pTraceNormals, pSpaceDim, bcRegion, cnt)
64 int nvariables = physarray.num_elements();
68 int npoints, id1, id2, e_max;
72 for(
int e = 0; e < e_max; ++e)
75 GetBndCondExpansions()[
m_bcRegion]->GetExp(e)->GetTotPoints();
77 GetBndCondExpansions()[
m_bcRegion]->GetPhys_Offset(e);
85 GetExp(e)->GetCoords(x, y, z);
89 for (
int i = 0; i < nvariables; ++i)
93 UpdatePhys())[id1], 1);
106 boost::ignore_unused(z);
108 int nq = x.num_elements();
118 NekDouble fac = 1.0/(16.0*gamma*M_PI*M_PI);
127 for (
int i = 0; i < nq; ++i)
129 xbar = x[i] - u0*time - x0;
130 ybar = y[i] - v0*time - y0;
131 r = sqrt(xbar*xbar + ybar*ybar);
132 tmp = beta*exp(1-r*r);
133 u[0][i+o] = pow(1.0 - (gamma-1.0)*tmp*tmp*fac, 1.0/(gamma-1.0));
134 u[1][i+o] = u[0][i+o]*(u0 - tmp*ybar/(2*M_PI));
135 u[2][i+o] = u[0][i+o]*(v0 + tmp*xbar/(2*M_PI));
136 u[
m_spacedim+1][i+o] = pow(u[0][i+o], gamma)/(gamma-1.0) +
137 0.5*(u[1][i+o]*u[1][i+o] + u[2][i+o]*u[2][i+o]) / u[0][i+o];
int m_spacedim
Space dimension.
void EvaluateIsentropicVortex(const Array< OneD, NekDouble > &x, const Array< OneD, NekDouble > &y, const Array< OneD, NekDouble > &z, Array< OneD, Array< OneD, NekDouble > > &u, NekDouble time, const int o=0)
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array of fields.
CFSBndCondFactory & GetCFSBndCondFactory()
Declaration of the boundary condition factory singleton.
virtual void v_Apply(Array< OneD, Array< OneD, NekDouble > > &Fwd, Array< OneD, Array< OneD, NekDouble > > &physarray, const NekDouble &time)
Encapsulates the user-defined boundary conditions for compressible flow solver.
NekDouble m_gamma
Parameters of the flow.
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)
std::shared_ptr< SessionReader > SessionReaderSharedPtr
int m_bcRegion
Id of the boundary region.