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

A global linear system. More...

#include <TerminalOutflow.h>

Inheritance diagram for Nektar::TerminalOutflow:
[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

 TerminalOutflow (Array< OneD, MultiRegions::ExpListSharedPtr > pVessel, const LibUtilities::SessionReaderSharedPtr pSession, PulseWavePressureAreaSharedPtr pressureArea)
 
 ~TerminalOutflow () 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
 
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< TerminalOutflow >
 

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

A global linear system.

Definition at line 52 of file TerminalOutflow.h.

Constructor & Destructor Documentation

◆ TerminalOutflow()

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

Definition at line 46 of file TerminalOutflow.cpp.

50 : PulseWaveBoundary(pVessel, pSession, pressureArea)
51{
52}
PulseWaveBoundary(Array< OneD, MultiRegions::ExpListSharedPtr > &pVessel, const LibUtilities::SessionReaderSharedPtr &pSession, PulseWavePressureAreaSharedPtr &pressureArea)

◆ ~TerminalOutflow()

Nektar::TerminalOutflow::~TerminalOutflow ( )
overrideprotecteddefault

Member Function Documentation

◆ create()

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

Definition at line 58 of file TerminalOutflow.h.

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

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

◆ v_DoBoundary()

void Nektar::TerminalOutflow::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 54 of file TerminalOutflow.cpp.

60{
61 NekDouble A_r;
62 NekDouble A_l;
63 NekDouble u_r;
64 NekDouble u_l;
65 NekDouble RT;
66 NekDouble W1;
67
68 Array<OneD, MultiRegions::ExpListSharedPtr> vessel(2);
69
70 // Pointers to the domains
71 vessel[0] = m_vessels[2 * omega];
72 vessel[1] = m_vessels[2 * omega + 1];
73
74 /* Find the terminal resistance boundary condition and
75 * calculate the reflection. We assume A_r = A_l and
76 * apply the reflection in u_r after Jordi Alastruey's
77 * PhD thesis. Stems from R = -W2 / W1.
78 */
79
80 // Note: The R_t value is contained in A in the inputfile
81 RT = (vessel[0]->UpdateBndCondExpansion(n))->GetCoeffs()[0];
82
83 ASSERTL0((-1 <= RT && RT <= 1), "RT must be between -1 and 1");
84 int nq = vessel[0]->GetTotPoints();
85
86 // Get the left values A and u, and the forward characteristic
87 A_l = inarray[0][offset + nq - 1];
88 u_l = inarray[1][offset + nq - 1];
89
90 m_pressureArea->GetW1(W1, u_l, beta[omega][nq - 1], A_l, A_0[omega][nq - 1],
91 alpha[omega][nq - 1]);
92
93 // Calculate the boundary values
94 A_r = A_l;
95 u_r = (1 - RT) * W1 - u_l;
96
97 // Store the new values in the boundary condition
98 (vessel[0]->UpdateBndCondExpansion(n))->UpdatePhys()[0] = A_r;
99 (vessel[1]->UpdateBndCondExpansion(n))->UpdatePhys()[0] = u_r;
100}
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:208
Array< OneD, MultiRegions::ExpListSharedPtr > m_vessels
PulseWavePressureAreaSharedPtr m_pressureArea
@ beta
Gauss Radau pinned at x=-1,.
Definition: PointsType.h:59
double NekDouble

References ASSERTL0, Nektar::LibUtilities::beta, Nektar::PulseWaveBoundary::m_pressureArea, and Nektar::PulseWaveBoundary::m_vessels.

Friends And Related Function Documentation

◆ MemoryManager< TerminalOutflow >

friend class MemoryManager< TerminalOutflow >
friend

Definition at line 49 of file TerminalOutflow.h.

Member Data Documentation

◆ className

std::string Nektar::TerminalOutflow::className
static
Initial value:
=
"Terminal 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)
BoundaryFactory & GetBoundaryFactory()

Definition at line 68 of file TerminalOutflow.h.