Nektar++
Static Public Member Functions | Static Public Attributes | Protected Member Functions | Friends | List of all members
Nektar::ROutflow Class Reference

#include <ROutflow.h>

Inheritance diagram for Nektar::ROutflow:
[legend]

Static Public Member Functions

static PulseWaveBoundarySharedPtr create (Array< OneD, MultiRegions::ExpListSharedPtr > &pVessel, const LibUtilities::SessionReaderSharedPtr &pSession, PulseWavePressureAreaSharedPtr &pressureArea)
 

Static Public Attributes

static std::string className
 

Protected Member Functions

 ROutflow (Array< OneD, MultiRegions::ExpListSharedPtr > pVessel, const LibUtilities::SessionReaderSharedPtr pSession, PulseWavePressureAreaSharedPtr pressureArea)
 
 ~ROutflow () override=default
 
void v_DoBoundary (const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &A_0, Array< OneD, Array< OneD, NekDouble > > &beta, Array< OneD, Array< OneD, NekDouble > > &alpha, const NekDouble time, int omega, int offset, int n) override
 
void R_RiemannSolver (NekDouble R, NekDouble A_l, NekDouble u_l, NekDouble A_0, NekDouble beta, NekDouble alpha, NekDouble POut, NekDouble &A_u, NekDouble &u_u)
 
virtual void v_DoBoundary (const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &A_0, Array< OneD, Array< OneD, NekDouble > > &beta, Array< OneD, Array< OneD, NekDouble > > &alpha, const NekDouble time, int omega, int offset, int n)=0
 

Friends

class MemoryManager< ROutflow >
 

Additional Inherited Members

- Public Member Functions inherited from Nektar::PulseWaveBoundary
 PulseWaveBoundary (Array< OneD, MultiRegions::ExpListSharedPtr > &pVessel, const LibUtilities::SessionReaderSharedPtr &pSession, PulseWavePressureAreaSharedPtr &pressureArea)
 
virtual ~PulseWaveBoundary ()=default
 
void DoBoundary (const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &A_0, Array< OneD, Array< OneD, NekDouble > > &beta, Array< OneD, Array< OneD, NekDouble > > &alpha, const NekDouble time, int omega, int offset, int n)
 
- Protected Attributes inherited from Nektar::PulseWaveBoundary
Array< OneD, MultiRegions::ExpListSharedPtrm_vessels
 
LibUtilities::SessionReaderSharedPtr m_session
 
PulseWavePressureAreaSharedPtr m_pressureArea
 
NekDouble m_pext
 
NekDouble m_pout
 
NekDouble m_rho
 

Detailed Description

Definition at line 52 of file ROutflow.h.

Constructor & Destructor Documentation

◆ ROutflow()

Nektar::ROutflow::ROutflow ( Array< OneD, MultiRegions::ExpListSharedPtr pVessel,
const LibUtilities::SessionReaderSharedPtr  pSession,
PulseWavePressureAreaSharedPtr  pressureArea 
)
protected

Definition at line 44 of file ROutflow.cpp.

47 : PulseWaveBoundary(pVessel, pSession, pressureArea)
48{
49}
PulseWaveBoundary(Array< OneD, MultiRegions::ExpListSharedPtr > &pVessel, const LibUtilities::SessionReaderSharedPtr &pSession, PulseWavePressureAreaSharedPtr &pressureArea)

◆ ~ROutflow()

Nektar::ROutflow::~ROutflow ( )
overrideprotecteddefault

Member Function Documentation

◆ create()

static PulseWaveBoundarySharedPtr Nektar::ROutflow::create ( Array< OneD, MultiRegions::ExpListSharedPtr > &  pVessel,
const LibUtilities::SessionReaderSharedPtr pSession,
PulseWavePressureAreaSharedPtr pressureArea 
)
inlinestatic

Definition at line 58 of file ROutflow.h.

62 {
63 return MemoryManager<ROutflow>::AllocateSharedPtr(pVessel, pSession,
64 pressureArea);
65 }
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.

References Nektar::MemoryManager< DataType >::AllocateSharedPtr().

◆ R_RiemannSolver()

void Nektar::ROutflow::R_RiemannSolver ( NekDouble  R,
NekDouble  A_l,
NekDouble  u_l,
NekDouble  A_0,
NekDouble  beta,
NekDouble  alpha,
NekDouble  POut,
NekDouble A_u,
NekDouble u_u 
)
protected

Definition at line 99 of file ROutflow.cpp.

102{
103 NekDouble W1 = 0.0;
104 NekDouble c = 0.0;
105 NekDouble cL = 0.0;
106 NekDouble I = 0.0;
107 NekDouble A_calc = 0.0;
108 NekDouble FA = 0.0;
109 NekDouble dFdA = 0.0;
110 NekDouble delta_A_calc = 0.0;
111 NekDouble P = 0.0;
112 NekDouble rho = m_rho;
113
114 int proceed = 1;
115 int iter = 0;
116 int MAX_ITER = 200;
117
118 // Tolerances for the algorithm
119 NekDouble Tol = 1.0E-10;
120
121 // Calculate the wave speed
122 m_pressureArea->GetC(cL, beta, A_l, A_0, alpha);
123
124 // Riemann invariant \f$W_1(Al,ul)\f$
125 m_pressureArea->GetW1(W1, u_l, beta, A_l, A_0, alpha);
126
127 // Newton Iteration (Area only)
128 A_calc = A_l;
129 while ((proceed) && (iter < MAX_ITER))
130 {
131 iter += 1;
132
133 m_pressureArea->GetPressure(P, beta, A_calc, A_0, 0, 0, alpha);
134 m_pressureArea->GetC(c, beta, A_calc, A_0, alpha);
135 m_pressureArea->GetCharIntegral(I, beta, A_calc, A_0, alpha);
136
137 FA = R * A_calc * (W1 - I) - P + POut;
138 dFdA = R * (W1 - I - c) - c * c * rho / A_calc;
139 delta_A_calc = FA / dFdA;
140 A_calc -= delta_A_calc;
141
142 if (sqrt(delta_A_calc * delta_A_calc) < Tol)
143 {
144 proceed = 0;
145 }
146 }
147
148 m_pressureArea->GetPressure(P, beta, A_calc, A_0, 0, 0, alpha);
149
150 // Obtain u_u and A_u
151 u_u = (P - POut) / (R * A_calc);
152 A_u = A_calc;
153}
PulseWavePressureAreaSharedPtr m_pressureArea
@ beta
Gauss Radau pinned at x=-1,.
Definition: PointsType.h:59
@ P
Monomial polynomials .
Definition: BasisType.h:62
double NekDouble
scalarT< T > sqrt(scalarT< T > in)
Definition: scalar.hpp:285

References Nektar::LibUtilities::beta, Nektar::PulseWaveBoundary::m_pressureArea, Nektar::PulseWaveBoundary::m_rho, Nektar::LibUtilities::P, and tinysimd::sqrt().

Referenced by v_DoBoundary().

◆ v_DoBoundary()

void Nektar::ROutflow::v_DoBoundary ( const Array< OneD, const Array< OneD, NekDouble > > &  inarray,
Array< OneD, Array< OneD, NekDouble > > &  A_0,
Array< OneD, Array< OneD, NekDouble > > &  beta,
Array< OneD, Array< OneD, NekDouble > > &  alpha,
const NekDouble  time,
int  omega,
int  offset,
int  n 
)
overrideprotectedvirtual

Implements Nektar::PulseWaveBoundary.

Definition at line 51 of file ROutflow.cpp.

57{
58 NekDouble A_r = 0.0;
59 NekDouble u_r = 0.0;
60 NekDouble A_u = 0.0;
61 NekDouble u_u = 0.0;
62 NekDouble A_l = 0.0;
63 NekDouble u_l = 0.0;
64 NekDouble POut = m_pout;
65
66 Array<OneD, MultiRegions::ExpListSharedPtr> vessel(2);
67
68 // Pointers to the domains
69 vessel[0] = m_vessels[2 * omega];
70 vessel[1] = m_vessels[2 * omega + 1];
71
72 /* Find the terminal R boundary condition and
73 calculates the updated velocity and area as
74 well as the updated boundary conditions */
75
76 /* Load terminal resistance
77 and number of points from the input file */
78 NekDouble RT = ((vessel[0]->GetBndCondExpansions())[n])->GetCoeffs()[0];
79 int nq = vessel[0]->GetTotPoints();
80
81 // Get the values of all variables needed for the Riemann problem
82 A_l = inarray[0][offset + nq - 1];
83 u_l = inarray[1][offset + nq - 1];
84
85 // Call the R RiemannSolver
86 R_RiemannSolver(RT, A_l, u_l, A_0[omega][nq - 1], beta[omega][nq - 1],
87 alpha[omega][nq - 1], POut, A_u, u_u);
88
89 /* Fix the boundary conditions in the virtual region to ensure
90 upwind state matches the boundary condition at the next time step */
91 A_r = A_l;
92 u_r = 2 * u_u - u_l;
93
94 // Store the updated values
95 (vessel[0]->UpdateBndCondExpansion(n))->UpdatePhys()[0] = A_r;
96 (vessel[1]->UpdateBndCondExpansion(n))->UpdatePhys()[0] = u_r;
97}
Array< OneD, MultiRegions::ExpListSharedPtr > m_vessels
void R_RiemannSolver(NekDouble R, NekDouble A_l, NekDouble u_l, NekDouble A_0, NekDouble beta, NekDouble alpha, NekDouble POut, NekDouble &A_u, NekDouble &u_u)
Definition: ROutflow.cpp:99

References Nektar::LibUtilities::beta, Nektar::PulseWaveBoundary::m_pout, Nektar::PulseWaveBoundary::m_vessels, and R_RiemannSolver().

Friends And Related Function Documentation

◆ MemoryManager< ROutflow >

friend class MemoryManager< ROutflow >
friend

Definition at line 49 of file ROutflow.h.

Member Data Documentation

◆ className

std::string Nektar::ROutflow::className
static
Initial value:
"R-terminal", ROutflow::create, "Resistive outflow boundary condition")
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
static PulseWaveBoundarySharedPtr create(Array< OneD, MultiRegions::ExpListSharedPtr > &pVessel, const LibUtilities::SessionReaderSharedPtr &pSession, PulseWavePressureAreaSharedPtr &pressureArea)
Definition: ROutflow.h:58
BoundaryFactory & GetBoundaryFactory()

Definition at line 68 of file ROutflow.h.