7#ifndef DGBOUNDARYCONDITIONSOLIDWALL_H_
8#define DGBOUNDARYCONDITIONSOLIDWALL_H_
16template <MInt nDim,
class SysEqn, MBool slipWall = false>
31 return slipWall ?
"solid wall (mean flow slip wall)" :
"solid wall (mean flow no-slip wall)";
42template <MInt nDim,
class SysEqn, MBool slipWall>
44 const MFloat NotUsed(time)) {
46 MFloat* stateL = &surfaces().variables(surfaceId, 0);
47 MFloat* stateR = &surfaces().variables(surfaceId, 1);
48 MFloat* innerState = (surfaces().internalSideId(surfaceId) == 0) ? stateL : stateR;
49 MFloat* nodeVarsL = &surfaces().nodeVars(surfaceId, 0);
50 MFloat* nodeVarsR = &surfaces().nodeVars(surfaceId, 1);
51 MFloat* innerNodeVars = (surfaces().nghbrElementIds(surfaceId, 0) == -1) ? nodeVarsR : nodeVarsL;
54 const MInt noNodes1D = surfaces().noNodes1D(surfaceId);
55 const MInt noNodes1D3 = (nDim == 3) ? noNodes1D : 1;
56 const MInt dirId = surfaces().orientation(surfaceId);
58 MFloatTensor variables(innerState, noNodes1D, noNodes1D3, SysEqn::noVars());
59 MFloatTensor nodeVars(innerNodeVars, noNodes1D, noNodes1D3, SysEqn::noNodeVars());
60 MFloatTensor f(flux(surfaceId), noNodes1D, noNodes1D3, SysEqn::noVars());
89 for(
MInt i = 0; i < noNodes1D; i++) {
90 for(
MInt j = 0; j < noNodes1D3; j++) {
92 variables(i, j, dirId) = 0.0;
96 std::inner_product(&variables(i, j, 0), &variables(i, j, nDim), &nodeVars(i, j, 0), variables(i, j, nDim));
102 for(
MInt i = 0; i < noNodes1D; i++) {
103 for(
MInt j = 0; j < noNodes1D3; j++) {
105 f(i, j, dirId) = variables(i, j, nDim);
Solid (slip) wall boundary condition.
void apply(const MFloat time) override
Apply method to apply boundary condition.
void applyAtSurface(const MInt surfaceId, const MFloat NotUsed(time))
MString name() const override
Returns name of boundary condition.
DgBcAcousticPerturbSolidWall(SolverType &solver_, MInt bcId)
SurfaceCollector & surfaces()
Return reference to surfaces.
DgCartesianSolver< nDim, SysEqn > SolverType
SysEqn & sysEqn()
Return reference to SysEqn object.
MInt begin() const
Return index of first surface.
MInt end() const
Return index of one-past-last surface.
MFloat * flux(const MInt i)
Return pointer to surface flux.
void set(const T &value)
Initializes tensor to constant value.
std::basic_string< char > MString
void loop(Functor &&fun, Class *object, const IdType begin, const IdType end, Args... args)