76 ASSERTL0(
false,
"Implicit Pulse Wave Propagation not set up.");
122 physarray[i] = inarray[i]+cnt;
140 m_vessels[omega*m_nVariables+i]->MultiplyByElmtInvMass(modarray[i],modarray[i]);
141 m_vessels[omega*m_nVariables+i]->BwdTrans(modarray[i],tmpArray = outarray[i]+cnt);
154 Vmath::Vcopy(inarray[i].num_elements(),inarray[i],1,outarray[i],1);
185 for(
int j = 0; j < 2; ++j)
187 std::string BCType =vessel[0]->GetBndConditions()[j]->GetUserDefined();
190 BCType =
"NoUserDefined";
196 if(BCType ==
"Q-inflow")
198 vessel[0]->GetBndConditions()[j]->SetIsTimeDependent(
true);
200 else if(BCType ==
"RCR-terminal")
202 vessel[0]->GetBndConditions()[j]->SetIsTimeDependent(
true);
214 for(
int n = 0; n < 2; ++n)
218 offset +=
m_vessels[2*omega]->GetTotPoints();
245 for (
int j = 0; j < nq; j++)
247 flux[0][j] = physfield[0][j]*physfield[1][j];
253 for (
int j = 0; j < nq; j++)
255 ASSERTL0(physfield[0][j]>=0,
"Negative A not allowed.");
260 p_t = (physfield[1][j]*physfield[1][j])/2 + p/
m_rho;
266 ASSERTL0(
false,
"GetFluxVector: illegal vector index");
297 GetFwdBwdTracePhys(physfield[i],Fwd[i],Bwd[i]);
304 for (i = 0; i < nTracePts; ++i)
318 ASSERTL0(
false,
"populate switch statement for upwind flux");
322 numflux[0][i] = Aflux;
323 numflux[1][i] = uflux;
362 cL = sqrt(beta*sqrt(AL)/(2*rho))*n;
363 cR = sqrt(beta*sqrt(AR)/(2*rho))*n;
365 ASSERTL1(fabs(cL+cR) > fabs(uL+uR),
"Conditions are not sub-sonic");
378 upwindedphysfield[0]= w0mw1*fac;
379 upwindedphysfield[1]= 0.5*(W[0] + W[1]);
382 Aflux = upwindedphysfield[0] * upwindedphysfield[1]*n;
383 p = pext + beta*(sqrt(upwindedphysfield[0]) - sqrt(A_0));
384 p_t = 0.5*(upwindedphysfield[1]*upwindedphysfield[1]) + p/rho;
Array< OneD, Array< OneD, NekDouble > > m_beta_trace
#define ASSERTL0(condition, msg)
UpwindTypePulse m_upwindTypePulse
virtual ~PulseWavePropagation()
tBaseSharedPtr CreateInstance(tKey idKey BOOST_PP_COMMA_IF(MAX_PARAM) BOOST_PP_ENUM_BINARY_PARAMS(MAX_PARAM, tParam, x))
Create an instance of the class referred to by idKey.
void SetPulseWaveBoundaryConditions(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
LibUtilities::TimeIntegrationSchemeOperators m_ode
The time integration scheme operators to use.
std::vector< std::pair< std::string, std::string > > SummaryList
Array< OneD, Array< OneD, NekDouble > > m_trace_fwd_normal
virtual void v_InitObject()
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
void EnforceInterfaceConditions(const Array< OneD, const Array< OneD, NekDouble > > &fields)
virtual void v_GenerateSummary(SolverUtils::SummaryList &s)
BoundaryFactory & GetBoundaryFactory()
Array< OneD, Array< OneD, NekDouble > > m_A_0_trace
void DoOdeRhs(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
virtual void v_InitObject()
Base class for unsteady solvers.
void DefineProjection(FuncPointerT func, ObjectPointerT obj)
virtual SOLVER_UTILS_EXPORT void v_GenerateSummary(SummaryList &s)
Print a summary of time stepping parameters.
void DoOdeProjection(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
bool m_explicitAdvection
Indicates if explicit or implicit treatment of advection is used.
void DefineOdeRhs(FuncPointerT func, ObjectPointerT obj)
virtual void v_NumericalFlux(Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, NekDouble > > &numflux)
DG Pulse Wave Propagation routines: Numerical Flux at interelemental boundaries.
virtual void v_GetFluxVector(const int i, Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, NekDouble > > &flux)
Array< OneD, Array< OneD, NekDouble > > m_A_0
void Neg(int n, T *x, const int incx)
Negate x = -x.
EquationSystemFactory & GetEquationSystemFactory()
SOLVER_UTILS_EXPORT void SetBoundaryConditions(NekDouble time)
Evaluates the boundary conditions at the given time.
SOLVER_UTILS_EXPORT int GetTraceTotPoints()
Array< OneD, Array< OneD, NekDouble > > m_beta
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
LibUtilities::SessionReaderSharedPtr m_session
The session reader.
PressureAreaFactory & GetPressureAreaFactory()
Array< OneD, PulseWaveBoundarySharedPtr > m_Boundary
SOLVER_UTILS_EXPORT void WeakDGAdvection(const Array< OneD, Array< OneD, NekDouble > > &InField, Array< OneD, Array< OneD, NekDouble > > &OutField, bool NumericalFluxIncludesNormal=true, bool InFieldIsInPhysSpace=false, int nvariables=0)
Calculate the weak discontinuous Galerkin advection.
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Array< OneD, MultiRegions::ExpListSharedPtr > m_vessels
PulseWavePressureAreaSharedPtr m_pressureArea
void RiemannSolverUpwind(NekDouble AL, NekDouble uL, NekDouble AR, NekDouble uR, NekDouble &Aflux, NekDouble &uflux, NekDouble A_0, NekDouble beta, NekDouble n)
Upwinding Riemann solver for interelemental boundaries.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, tDescription pDesc="")
Register a class with the factory.