74 ASSERTL0(
false,
"Implicit Pulse Wave Propagation not set up.");
120 physarray[i] = inarray[i]+cnt;
138 m_vessels[omega*m_nVariables+i]->MultiplyByElmtInvMass(modarray[i],modarray[i]);
139 m_vessels[omega*m_nVariables+i]->BwdTrans(modarray[i],tmpArray = outarray[i]+cnt);
152 Vmath::Vcopy(inarray[i].num_elements(),inarray[i],1,outarray[i],1);
183 for(
int j = 0; j < 2; ++j)
185 std::string BCType =vessel[0]->GetBndConditions()[j]->GetUserDefined();
188 BCType =
"NoUserDefined";
194 if(BCType ==
"Q-inflow")
196 vessel[0]->GetBndConditions()[j]->SetIsTimeDependent(
true);
198 else if(BCType ==
"RCR-terminal")
200 vessel[0]->GetBndConditions()[j]->SetIsTimeDependent(
true);
212 for(
int n = 0; n < 2; ++n)
216 offset +=
m_vessels[2*omega]->GetTotPoints();
243 for (
int j = 0; j < nq; j++)
245 flux[0][j] = physfield[0][j]*physfield[1][j];
251 for (
int j = 0; j < nq; j++)
253 ASSERTL0(physfield[0][j]>=0,
"Negative A not allowed.");
258 p_t = (physfield[1][j]*physfield[1][j])/2 + p/
m_rho;
264 ASSERTL0(
false,
"GetFluxVector: illegal vector index");
295 GetFwdBwdTracePhys(physfield[i],Fwd[i],Bwd[i]);
302 for (i = 0; i < nTracePts; ++i)
316 ASSERTL0(
false,
"populate switch statement for upwind flux");
320 numflux[0][i] = Aflux;
321 numflux[1][i] = uflux;
360 cL = sqrt(beta*sqrt(AL)/(2*rho))*n;
361 cR = sqrt(beta*sqrt(AR)/(2*rho))*n;
363 ASSERTL1(fabs(cL+cR) > fabs(uL+uR),
"Conditions are not sub-sonic");
376 upwindedphysfield[0]= w0mw1*fac;
377 upwindedphysfield[1]= 0.5*(W[0] + W[1]);
380 Aflux = upwindedphysfield[0] * upwindedphysfield[1]*n;
381 p = pext + beta*(sqrt(upwindedphysfield[0]) - sqrt(A_0));
382 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)
static std::string className
Name of class.
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)
PulseWavePropagation(const LibUtilities::SessionReaderSharedPtr &pSession)
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.
static EquationSystemSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession)
Creates an instance of this class.
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.