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

A global linear system. More...

#include <ROutflow.h>

Inheritance diagram for Nektar::ROutflow:
[legend]

Public Member Functions

 ROutflow (Array< OneD, MultiRegions::ExpListSharedPtr > pVessel, const LibUtilities::SessionReaderSharedPtr pSession, PulseWavePressureAreaSharedPtr pressureArea)
 
virtual ~ROutflow ()
 
- Public Member Functions inherited from Nektar::PulseWaveBoundary
 PulseWaveBoundary (Array< OneD, MultiRegions::ExpListSharedPtr > &pVessel, const LibUtilities::SessionReaderSharedPtr &pSession, PulseWavePressureAreaSharedPtr &pressureArea)
 
virtual ~PulseWaveBoundary ()
 
void DoBoundary (const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &A_0, Array< OneD, Array< OneD, NekDouble > > &beta, const NekDouble time, int omega, int offset, int n)
 

Static Public Member Functions

static PulseWaveBoundarySharedPtr create (Array< OneD, MultiRegions::ExpListSharedPtr > &pVessel, const LibUtilities::SessionReaderSharedPtr &pSession, PulseWavePressureAreaSharedPtr &pressureArea)
 Creates an instance of this class. More...
 

Static Public Attributes

static std::string className
 Name of class. More...
 

Protected Member Functions

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, const NekDouble time, int omega, int offset, int n)
 
void R_RiemannSolver (NekDouble R, NekDouble A_l, NekDouble u_l, NekDouble A_0, NekDouble beta, NekDouble pout, NekDouble &A_u, NekDouble &u_u)
 

Additional Inherited Members

- 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

A global linear system.

Definition at line 50 of file ROutflow.h.

Constructor & Destructor Documentation

◆ ROutflow()

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

Definition at line 51 of file ROutflow.cpp.

54  : PulseWaveBoundary(pVessel,pSession,pressureArea)
55  {
56  }
PulseWaveBoundary(Array< OneD, MultiRegions::ExpListSharedPtr > &pVessel, const LibUtilities::SessionReaderSharedPtr &pSession, PulseWavePressureAreaSharedPtr &pressureArea)

◆ ~ROutflow()

Nektar::ROutflow::~ROutflow ( )
virtual

Definition at line 61 of file ROutflow.cpp.

62  {
63 
64  }

Member Function Documentation

◆ create()

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

Creates an instance of this class.

Definition at line 54 of file ROutflow.h.

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

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

◆ R_RiemannSolver()

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

Definition at line 108 of file ROutflow.cpp.

References Nektar::PulseWaveBoundary::m_pext, and Nektar::PulseWaveBoundary::m_rho.

Referenced by v_DoBoundary().

111  {
112  NekDouble W1 = 0.0;
113  NekDouble c_l = 0.0;
114  NekDouble pext = m_pext;
115  NekDouble A_calc = 0.0;
116  NekDouble fa = 0.0;
117  NekDouble dfa = 0.0;
118  NekDouble delta_A_calc = 0.0;
119  NekDouble rho = m_rho;
120 
121  int proceed = 1;
122  int iter = 0;
123  int MAX_ITER = 200;
124 
125  // Tolerances for the algorithm
126  NekDouble Tol = 1.0e-10;
127 
128  // Calculate the wave speed
129  c_l = sqrt(beta/(2*rho))*sqrt(sqrt(A_l));
130 
131  // Riemann invariant \f$W_1(Al,ul)\f$
132  W1 = u_l + 4*c_l;
133 
134  // Newton Iteration (Area only)
135  A_calc = A_l;
136  while ((proceed) && (iter < MAX_ITER))
137  {
138  iter =iter+1;
139 
140  fa = R*W1*A_calc-4*R*sqrt(beta/(2*rho))*A_calc*sqrt(sqrt(A_calc))-pext-beta*(sqrt(A_calc)-sqrt(A_0))+pout;
141  dfa = R*W1-5*R*sqrt(beta/(2*rho))*sqrt(sqrt(A_calc))-beta/(2*sqrt(A_calc));
142  delta_A_calc = fa/dfa;
143  A_calc = A_calc - delta_A_calc;
144 
145  if (sqrt(delta_A_calc*delta_A_calc) < Tol)
146  proceed = 0;
147  }
148 
149  // Obtain u_u and A_u
150  u_u=(pext+beta*(sqrt(A_calc)-sqrt(A_0))-pout)/(R*A_calc);
151  A_u = A_calc;
152  }
double NekDouble

◆ 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,
const NekDouble  time,
int  omega,
int  offset,
int  n 
)
protectedvirtual

Implements Nektar::PulseWaveBoundary.

Definition at line 66 of file ROutflow.cpp.

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

72  {
73  NekDouble A_r, u_r;
74  NekDouble A_u, u_u;
75  NekDouble A_l, u_l;
76 
77  Array<OneD, MultiRegions::ExpListSharedPtr> vessel(2);
78 
79  vessel[0] = m_vessels[2*omega];
80  vessel[1] = m_vessels[2*omega+1];
81 
82  /* Find the terminal R boundary condition and
83  calculates the updated velocity and area as
84  well as the updated boundary conditions */
85 
86  NekDouble RT=((vessel[0]->GetBndCondExpansions())[n])->GetCoeffs()[0];
87  NekDouble pout = m_pout;
88  int nq = vessel[0]->GetTotPoints();
89 
90  // Get the values of all variables needed for the Riemann problem
91  A_l = inarray[0][offset+nq-1];
92  u_l = inarray[1][offset+nq-1];
93 
94  // Call the R RiemannSolver
95  R_RiemannSolver(RT,A_l,u_l,A_0[omega][nq-1],
96  beta[omega][nq-1],pout,A_u,u_u);
97 
98  // Calculates the new boundary conditions
99  A_r=A_l;
100  u_r=2*u_u-u_l;
101 
102  // Store the updated values in the boundary condition
103 
104  (vessel[0]->UpdateBndCondExpansion(n))->UpdatePhys()[0] = A_r;
105  (vessel[1]->UpdateBndCondExpansion(n))->UpdatePhys()[0] = u_r;
106  }
Array< OneD, MultiRegions::ExpListSharedPtr > m_vessels
void R_RiemannSolver(NekDouble R, NekDouble A_l, NekDouble u_l, NekDouble A_0, NekDouble beta, NekDouble pout, NekDouble &A_u, NekDouble &u_u)
Definition: ROutflow.cpp:108
double NekDouble

Member Data Documentation

◆ className

std::string Nektar::ROutflow::className
static
Initial value:
"Rterminal",
"Resistive outflow boundary condition")

Name of class.

Definition at line 62 of file ROutflow.h.