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

#include <AInflow.h>

Inheritance diagram for Nektar::AInflow:
[legend]

Public Member Functions

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

Static Public Attributes

static std::string className
 

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, Array< OneD, Array< OneD, NekDouble >> &alpha, const NekDouble time, int omega, int offset, int n) override
 

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

Definition at line 51 of file AInflow.h.

Constructor & Destructor Documentation

◆ AInflow()

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

Definition at line 44 of file AInflow.cpp.

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

◆ ~AInflow()

Nektar::AInflow::~AInflow ( )
virtual

Definition at line 51 of file AInflow.cpp.

52 {
53 }

Member Function Documentation

◆ create()

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

Definition at line 55 of file AInflow.h.

59  {
60  return MemoryManager<AInflow>::AllocateSharedPtr(pVessel, pSession,
61  pressureArea);
62  }
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::AInflow::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 55 of file AInflow.cpp.

61 {
62  boost::ignore_unused(A_0, beta, alpha);
63 
64  NekDouble A;
65  NekDouble A_r;
66  NekDouble u_r;
67  NekDouble A_l;
68  NekDouble u_l;
69  Array<OneD, MultiRegions::ExpListSharedPtr> vessel(2);
70 
71  // Pointers to the domains
72  vessel[0] = m_vessels[2 * omega];
73  vessel[1] = m_vessels[2 * omega + 1];
74 
75  // Evaluates the time-dependent A
76  vessel[0]->EvaluateBoundaryConditions(time);
77 
78  // Read the BC values from the input file
79  A = (vessel[0]->UpdateBndCondExpansion(n))->GetCoeffs()[0];
80 
81  // Initial conditions in the inlet vessel
82  A_r = inarray[0][offset];
83  u_r = inarray[1][offset];
84 
85  /* Fix the boundary conditions in the virtual vessel to ensure
86  upwind state matches the boundary condition at the next time step */
87  u_l = u_r;
88  // Needs to be updated to work with other tube laws
89  A_l = pow(2 * sqrt(sqrt(A)) - sqrt(sqrt(A_r)), 4);
90 
91  // Store the updated values in the boundary condition
92  (vessel[0]->UpdateBndCondExpansion(n))->UpdatePhys()[0] = A_l;
93  (vessel[1]->UpdateBndCondExpansion(n))->UpdatePhys()[0] = u_l;
94 }
Array< OneD, MultiRegions::ExpListSharedPtr > m_vessels
@ beta
Gauss Radau pinned at x=-1,.
Definition: PointsType.h:61
double NekDouble
scalarT< T > sqrt(scalarT< T > in)
Definition: scalar.hpp:294

References Nektar::LibUtilities::beta, Nektar::PulseWaveBoundary::m_vessels, and tinysimd::sqrt().

Member Data Documentation

◆ className

std::string Nektar::AInflow::className
static
Initial value:
"A-inflow", AInflow::create, "Area inflow boundary condition")
static PulseWaveBoundarySharedPtr create(Array< OneD, MultiRegions::ExpListSharedPtr > &pVessel, const LibUtilities::SessionReaderSharedPtr &pSession, PulseWavePressureAreaSharedPtr &pressureArea)
Definition: AInflow.h:55
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
Definition: NekFactory.hpp:198
BoundaryFactory & GetBoundaryFactory()

Definition at line 65 of file AInflow.h.