Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
Nektar::TerminalOutflow Class Reference

A global linear system. More...

#include <TerminalOutflow.h>

Inheritance diagram for Nektar::TerminalOutflow:
Inheritance graph
[legend]
Collaboration diagram for Nektar::TerminalOutflow:
Collaboration graph
[legend]

Public Member Functions

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

Additional Inherited Members

- Protected Attributes inherited from Nektar::PulseWaveBoundary
Array< OneD,
MultiRegions::ExpListSharedPtr
m_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 51 of file TerminalOutflow.h.

Constructor & Destructor Documentation

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

Definition at line 52 of file TerminalOutflow.cpp.

55  : PulseWaveBoundary(pVessel,pSession,pressureArea)
56  {
57  }
PulseWaveBoundary(Array< OneD, MultiRegions::ExpListSharedPtr > &pVessel, const LibUtilities::SessionReaderSharedPtr &pSession, PulseWavePressureAreaSharedPtr &pressureArea)
Nektar::TerminalOutflow::~TerminalOutflow ( )
virtual

Definition at line 62 of file TerminalOutflow.cpp.

63  {
64 
65  }

Member Function Documentation

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

Creates an instance of this class.

Definition at line 55 of file TerminalOutflow.h.

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

58  {
59  return MemoryManager<TerminalOutflow>::AllocateSharedPtr(pVessel,pSession,pressureArea);
60  }
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
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,
const NekDouble  time,
int  omega,
int  offset,
int  n 
)
protectedvirtual

Implements Nektar::PulseWaveBoundary.

Definition at line 67 of file TerminalOutflow.cpp.

References ASSERTL0, Nektar::PulseWaveBoundary::m_rho, and Nektar::PulseWaveBoundary::m_vessels.

73  {
74  NekDouble A_r, u_r;
75  NekDouble RT, A_l, u_l, u_0, c_0, c_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 resistance boundary condition and
83  * calculate the reflection. We assume A_r = A_l and
84  * apply the reflection in u_r after paper
85  * "Computational Modelling of 1D blood flow"*/
86 
87  // Note: The R_t value is contained in A in the inputfile
88  RT = (vessel[0]->UpdateBndCondExpansion(n))->GetCoeffs()[0];
89 
90  ASSERTL0((-1<=RT && RT<=1),
91  "RT must be comprised between -1 and 1");
92  int nq = vessel[0]->GetTotPoints();
93 
94  // Get the left values A_l and u_l needed for Eq. 37
95  A_l = inarray[0][offset+nq-1];
96  u_l = inarray[1][offset+nq-1];
97 
98  // Get the values at initial state u_0, c_0
99  u_0 = 0.0; //for all vessels start from initial condition 0
100  c_0 = sqrt(beta[omega][nq-1]/(2*m_rho))*sqrt(sqrt(A_0[omega][nq-1]));
101 
102  // Calculate the boundary values
103  A_r = A_l;
104  c_l = sqrt(beta[omega][nq-1]/(2*m_rho))*sqrt(sqrt(A_l));
105  u_r = (1-RT)*((u_l-u_0) + 4*(c_l-c_0)) - u_l;
106 
107  // Store the new values in the boundary condition
108  (vessel[0]->UpdateBndCondExpansion(n))->UpdatePhys()[0] = A_r;
109  (vessel[1]->UpdateBndCondExpansion(n))->UpdatePhys()[0] = u_r;
110  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:161
Array< OneD, MultiRegions::ExpListSharedPtr > m_vessels
double NekDouble

Member Data Documentation

std::string Nektar::TerminalOutflow::className
static
Initial value:
"Terminal",
"Terminal outflow boundary condition")

Name of class.

Definition at line 63 of file TerminalOutflow.h.