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

#include <WeakPressureExtrapolate.h>

Inheritance diagram for Nektar::WeakPressureExtrapolate:
[legend]

Public Member Functions

 WeakPressureExtrapolate (const LibUtilities::SessionReaderSharedPtr pSession, Array< OneD, MultiRegions::ExpListSharedPtr > pFields, MultiRegions::ExpListSharedPtr pPressure, const Array< OneD, int > pVel, const SolverUtils::AdvectionSharedPtr advObject)
 
virtual ~WeakPressureExtrapolate ()
 
- Public Member Functions inherited from Nektar::StandardExtrapolate
 StandardExtrapolate (const LibUtilities::SessionReaderSharedPtr pSession, Array< OneD, MultiRegions::ExpListSharedPtr > pFields, MultiRegions::ExpListSharedPtr pPressure, const Array< OneD, int > pVel, const SolverUtils::AdvectionSharedPtr advObject)
 
virtual ~StandardExtrapolate ()
 
- Public Member Functions inherited from Nektar::Extrapolate
 Extrapolate (const LibUtilities::SessionReaderSharedPtr pSession, Array< OneD, MultiRegions::ExpListSharedPtr > pFields, MultiRegions::ExpListSharedPtr pPressure, const Array< OneD, int > pVel, const SolverUtils::AdvectionSharedPtr advObject)
 
virtual ~Extrapolate ()
 
void GenerateHOPBCMap (const LibUtilities::SessionReaderSharedPtr &pSsession)
 
void UpdateRobinPrimCoeff (void)
 
void SubSteppingTimeIntegration (const LibUtilities::TimeIntegrationSchemeSharedPtr &IntegrationScheme)
 
void SubStepSaveFields (const int nstep)
 
void SubStepSetPressureBCs (const Array< OneD, const Array< OneD, NekDouble >> &inarray, const NekDouble Aii_DT, NekDouble kinvis)
 
void SubStepAdvance (const int nstep, NekDouble time)
 
void MountHOPBCs (int HBCdata, NekDouble kinvis, Array< OneD, NekDouble > &Q, Array< OneD, const NekDouble > &Advection)
 
void EvaluatePressureBCs (const Array< OneD, const Array< OneD, NekDouble >> &fields, const Array< OneD, const Array< OneD, NekDouble >> &N, NekDouble kinvis)
 
void SetForcing (const std::vector< SolverUtils::ForcingSharedPtr > &forcing)
 
void AddDuDt (void)
 
void AddVelBC (void)
 
void ExtrapolatePressureHBCs (void)
 
void CopyPressureHBCsToPbndExp (void)
 
Array< OneD, NekDoubleGetMaxStdVelocity (const Array< OneD, Array< OneD, NekDouble >> inarray)
 
void CorrectPressureBCs (const Array< OneD, NekDouble > &pressure)
 
void IProductNormVelocityOnHBC (const Array< OneD, const Array< OneD, NekDouble >> &Vel, Array< OneD, NekDouble > &IprodVn)
 
void IProductNormVelocityBCOnHBC (Array< OneD, NekDouble > &IprodVn)
 
std::string GetSubStepName (void)
 
void ExtrapolateArray (Array< OneD, Array< OneD, NekDouble >> &array)
 
void EvaluateBDFArray (Array< OneD, Array< OneD, NekDouble >> &array)
 
void ExtrapolateArray (Array< OneD, Array< OneD, NekDouble >> &oldarrays, Array< OneD, NekDouble > &newarray, Array< OneD, NekDouble > &outarray)
 
void AddNormVelOnOBC (const int nbcoeffs, const int nreg, Array< OneD, Array< OneD, NekDouble >> &u)
 
void AddPressureToOutflowBCs (NekDouble kinvis)
 

Static Public Member Functions

static ExtrapolateSharedPtr create (const LibUtilities::SessionReaderSharedPtr &pSession, Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, MultiRegions::ExpListSharedPtr &pPressure, const Array< OneD, int > &pVel, const SolverUtils::AdvectionSharedPtr &advObject)
 Creates an instance of this class. More...
 
- Static Public Member Functions inherited from Nektar::StandardExtrapolate
static ExtrapolateSharedPtr create (const LibUtilities::SessionReaderSharedPtr &pSession, Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, MultiRegions::ExpListSharedPtr &pPressure, const Array< OneD, int > &pVel, const SolverUtils::AdvectionSharedPtr &advObject)
 Creates an instance of this class. More...
 

Static Public Attributes

static std::string className
 Name of class. More...
 
- Static Public Attributes inherited from Nektar::StandardExtrapolate
static std::string className
 Name of class. More...
 

Protected Member Functions

virtual void v_EvaluatePressureBCs (const Array< OneD, const Array< OneD, NekDouble >> &fields, const Array< OneD, const Array< OneD, NekDouble >> &N, NekDouble kinvis) override
 
virtual void v_MountHOPBCs (int HBCdata, NekDouble kinvis, Array< OneD, NekDouble > &Q, Array< OneD, const NekDouble > &Advection) override
 
virtual void v_AddNormVelOnOBC (const int nbcoeffs, const int nreg, Array< OneD, Array< OneD, NekDouble >> &u) override
 
- Protected Member Functions inherited from Nektar::StandardExtrapolate
virtual void v_SubSteppingTimeIntegration (const LibUtilities::TimeIntegrationSchemeSharedPtr &IntegrationScheme) override
 
virtual void v_SubStepSaveFields (int nstep) override
 
virtual void v_SubStepSetPressureBCs (const Array< OneD, const Array< OneD, NekDouble >> &inarray, NekDouble Aii_DT, NekDouble kinvis) override
 
virtual void v_SubStepAdvance (int nstep, NekDouble time) override
 
virtual void v_AccelerationBDF (Array< OneD, Array< OneD, NekDouble >> &array) override
 
- Protected Member Functions inherited from Nektar::Extrapolate
virtual std::string v_GetSubStepName (void)
 
void CalcNeumannPressureBCs (const Array< OneD, const Array< OneD, NekDouble >> &fields, const Array< OneD, const Array< OneD, NekDouble >> &N, NekDouble kinvis)
 
virtual void v_CalcNeumannPressureBCs (const Array< OneD, const Array< OneD, NekDouble >> &fields, const Array< OneD, const Array< OneD, NekDouble >> &N, NekDouble kinvis)
 
virtual void v_CorrectPressureBCs (const Array< OneD, NekDouble > &pressure)
 
void CalcOutflowBCs (const Array< OneD, const Array< OneD, NekDouble >> &fields, NekDouble kinvis)
 
void RollOver (Array< OneD, Array< OneD, NekDouble >> &input)
 

Additional Inherited Members

- Protected Attributes inherited from Nektar::Extrapolate
LibUtilities::SessionReaderSharedPtr m_session
 
LibUtilities::CommSharedPtr m_comm
 
Array< OneD, HBCTypem_hbcType
 Array of type of high order BCs for splitting shemes. More...
 
Array< OneD, MultiRegions::ExpListSharedPtrm_fields
 Velocity fields. More...
 
MultiRegions::ExpListSharedPtr m_pressure
 Pointer to field holding pressure field. More...
 
Array< OneD, int > m_velocity
 int which identifies which components of m_fields contains the velocity (u,v,w); More...
 
SolverUtils::AdvectionSharedPtr m_advObject
 
std::vector< SolverUtils::ForcingSharedPtrm_forcing
 
Array< OneD, Array< OneD, NekDouble > > m_previousVelFields
 
int m_curl_dim
 Curl-curl dimensionality. More...
 
int m_bnd_dim
 bounday dimensionality More...
 
Array< OneD, const SpatialDomains::BoundaryConditionShPtrm_PBndConds
 pressure boundary conditions container More...
 
Array< OneD, MultiRegions::ExpListSharedPtrm_PBndExp
 pressure boundary conditions expansion container More...
 
int m_pressureCalls
 number of times the high-order pressure BCs have been called More...
 
int m_numHBCDof
 
int m_HBCnumber
 
int m_intSteps
 Maximum points used in pressure BC evaluation. More...
 
NekDouble m_timestep
 
Array< OneD, Array< OneD, NekDouble > > m_pressureHBCs
 Storage for current and previous levels of high order pressure boundary conditions. More...
 
Array< OneD, Array< OneD, NekDouble > > m_iprodnormvel
 Storage for current and previous levels of the inner product of normal velocity. More...
 
Array< OneD, Array< OneD, NekDouble > > m_traceNormals
 
HighOrderOutflowSharedPtr m_houtflow
 
- Static Protected Attributes inherited from Nektar::StandardExtrapolate
static NekDouble DuDt_Coeffs [3][4]
 
- Static Protected Attributes inherited from Nektar::Extrapolate
static NekDouble StifflyStable_Betaq_Coeffs [3][3]
 
static NekDouble StifflyStable_Alpha_Coeffs [3][3]
 
static NekDouble StifflyStable_Gamma0_Coeffs [3] = {1.0, 1.5, 11.0 / 6.0}
 

Detailed Description

Definition at line 57 of file WeakPressureExtrapolate.h.

Constructor & Destructor Documentation

◆ WeakPressureExtrapolate()

Nektar::WeakPressureExtrapolate::WeakPressureExtrapolate ( const LibUtilities::SessionReaderSharedPtr  pSession,
Array< OneD, MultiRegions::ExpListSharedPtr pFields,
MultiRegions::ExpListSharedPtr  pPressure,
const Array< OneD, int >  pVel,
const SolverUtils::AdvectionSharedPtr  advObject 
)

Definition at line 47 of file WeakPressureExtrapolate.cpp.

52  : StandardExtrapolate(pSession, pFields, pPressure, pVel, advObject)
53 {
54 }
StandardExtrapolate(const LibUtilities::SessionReaderSharedPtr pSession, Array< OneD, MultiRegions::ExpListSharedPtr > pFields, MultiRegions::ExpListSharedPtr pPressure, const Array< OneD, int > pVel, const SolverUtils::AdvectionSharedPtr advObject)

◆ ~WeakPressureExtrapolate()

Nektar::WeakPressureExtrapolate::~WeakPressureExtrapolate ( )
virtual

Definition at line 56 of file WeakPressureExtrapolate.cpp.

57 {
58 }

Member Function Documentation

◆ create()

static ExtrapolateSharedPtr Nektar::WeakPressureExtrapolate::create ( const LibUtilities::SessionReaderSharedPtr pSession,
Array< OneD, MultiRegions::ExpListSharedPtr > &  pFields,
MultiRegions::ExpListSharedPtr pPressure,
const Array< OneD, int > &  pVel,
const SolverUtils::AdvectionSharedPtr advObject 
)
inlinestatic

Creates an instance of this class.

Definition at line 61 of file WeakPressureExtrapolate.h.

66  {
69  pSession, pFields, pPressure, pVel, advObject);
70  return p;
71  }
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
std::shared_ptr< Extrapolate > ExtrapolateSharedPtr
Definition: Extrapolate.h:59

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), and CellMLToNektar.cellml_metadata::p.

◆ v_AddNormVelOnOBC()

void Nektar::WeakPressureExtrapolate::v_AddNormVelOnOBC ( const int  nbcoeffs,
const int  nreg,
Array< OneD, Array< OneD, NekDouble >> &  u 
)
overrideprotectedvirtual

Reimplemented from Nektar::Extrapolate.

Definition at line 97 of file WeakPressureExtrapolate.cpp.

99 {
100  boost::ignore_unused(noutflow);
101 
102  if (!m_houtflow.get()) // no outflow on partition so just return
103  {
104  return;
105  }
106 
107  int nbcoeffs = m_PBndExp[nreg]->GetNcoeffs();
108  // int nqb = m_PBndExp[nreg]->GetTotPoints();
109 
110  Array<OneD, NekDouble> IProdVnTmp(nbcoeffs);
111 
112 #if 0
113  Array<OneD, Array<OneD, NekDouble> > ubnd(m_curl_dim);
114 
115  for(int i = 0; i < m_curl_dim; ++i)
116  {
117  EvaluateBDFArray(m_houtflow->m_outflowVelBnd[noutflow][i]);
118 
119  ubnd[i] = m_houtflow->m_outflowVelBnd[noutflow][i][m_intSteps-1];
120 
121  // point input u to the first part of the array for later uee.
122  // u[i] = m_houtflow->m_outflowVelBnd[noutflow][i][0];
123  u[i] = ubnd[i];
124  }
125 
126  m_PBndExp[nreg]->NormVectorIProductWRTBase(ubnd,IProdVnTmp);
127 #endif
128  m_PBndExp[nreg]->NormVectorIProductWRTBase(u, IProdVnTmp);
129 
130  Vmath::Svtvp(nbcoeffs, -1.0 / m_timestep, IProdVnTmp, 1,
131  m_PBndExp[nreg]->UpdateCoeffs(), 1,
132  m_PBndExp[nreg]->UpdateCoeffs(), 1);
133 }
int m_curl_dim
Curl-curl dimensionality.
Definition: Extrapolate.h:214
void EvaluateBDFArray(Array< OneD, Array< OneD, NekDouble >> &array)
int m_intSteps
Maximum points used in pressure BC evaluation.
Definition: Extrapolate.h:235
HighOrderOutflowSharedPtr m_houtflow
Definition: Extrapolate.h:255
NekDouble m_timestep
Definition: Extrapolate.h:237
Array< OneD, MultiRegions::ExpListSharedPtr > m_PBndExp
pressure boundary conditions expansion container
Definition: Extrapolate.h:223
void Svtvp(int n, const T alpha, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
svtvp (scalar times vector plus vector): z = alpha*x + y
Definition: Vmath.cpp:622

References Nektar::Extrapolate::EvaluateBDFArray(), Nektar::Extrapolate::m_curl_dim, Nektar::Extrapolate::m_houtflow, Nektar::Extrapolate::m_intSteps, Nektar::Extrapolate::m_PBndExp, Nektar::Extrapolate::m_timestep, and Vmath::Svtvp().

◆ v_EvaluatePressureBCs()

void Nektar::WeakPressureExtrapolate::v_EvaluatePressureBCs ( const Array< OneD, const Array< OneD, NekDouble >> &  fields,
const Array< OneD, const Array< OneD, NekDouble >> &  N,
NekDouble  kinvis 
)
overrideprotectedvirtual

Function to extrapolate the new pressure boundary condition. Based on the velocity field and on the advection term. Acceleration term is also computed. This routine is a general one for 2d and 3D application and it can be called directly from velocity correction scheme. Specialisation on dimensionality is redirected to the CalcNeumannPressureBCs method.

Reimplemented from Nektar::StandardExtrapolate.

Definition at line 69 of file WeakPressureExtrapolate.cpp.

72 {
74  if (m_HBCnumber > 0)
75  {
76  // Calculate just viscous BCs at current level and put in
77  // m_pressureHBCs[nlevels-1]
78  CalcNeumannPressureBCs(fields, N, kinvis);
79 
80  // Extrapolate to m_pressureHBCs to n+1
82 
83  // \int_bnd q n.u^{n} ds update current normal of field
84  // add m_pressureHBCs to gamma_0/Dt * m_acceleration[0]
85  AddVelBC();
86 
87  // Copy m_pressureHBCs to m_PbndExp
89  }
90 
91  // Evaluate High order outflow conditions if required.
92  CalcOutflowBCs(fields, kinvis);
93 }
Array< OneD, Array< OneD, NekDouble > > m_pressureHBCs
Storage for current and previous levels of high order pressure boundary conditions.
Definition: Extrapolate.h:241
void CalcNeumannPressureBCs(const Array< OneD, const Array< OneD, NekDouble >> &fields, const Array< OneD, const Array< OneD, NekDouble >> &N, NekDouble kinvis)
Definition: Extrapolate.h:170
void CopyPressureHBCsToPbndExp(void)
void ExtrapolateArray(Array< OneD, Array< OneD, NekDouble >> &array)
void CalcOutflowBCs(const Array< OneD, const Array< OneD, NekDouble >> &fields, NekDouble kinvis)
int m_pressureCalls
number of times the high-order pressure BCs have been called
Definition: Extrapolate.h:226

References Nektar::Extrapolate::AddVelBC(), Nektar::Extrapolate::CalcNeumannPressureBCs(), Nektar::Extrapolate::CalcOutflowBCs(), Nektar::Extrapolate::CopyPressureHBCsToPbndExp(), Nektar::Extrapolate::ExtrapolateArray(), Nektar::Extrapolate::m_HBCnumber, Nektar::Extrapolate::m_pressureCalls, and Nektar::Extrapolate::m_pressureHBCs.

◆ v_MountHOPBCs()

void Nektar::WeakPressureExtrapolate::v_MountHOPBCs ( int  HBCdata,
NekDouble  kinvis,
Array< OneD, NekDouble > &  Q,
Array< OneD, const NekDouble > &  Advection 
)
overrideprotectedvirtual

vritual function which only puts in the curl operator into the bcs

Reimplemented from Nektar::StandardExtrapolate.

Definition at line 138 of file WeakPressureExtrapolate.cpp.

141 {
142  boost::ignore_unused(Advection);
143 
144  Vmath::Smul(HBCdata, -kinvis, Q, 1, Q, 1);
145 }
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*x.
Definition: Vmath.cpp:248

References Vmath::Smul().

Member Data Documentation

◆ className

std::string Nektar::WeakPressureExtrapolate::className
static
Initial value:
=
"WeakPressure", WeakPressureExtrapolate::create, "WeakPressure")
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
Definition: NekFactory.hpp:198
static ExtrapolateSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, MultiRegions::ExpListSharedPtr &pPressure, const Array< OneD, int > &pVel, const SolverUtils::AdvectionSharedPtr &advObject)
Creates an instance of this class.
ExtrapolateFactory & GetExtrapolateFactory()
Definition: Extrapolate.cpp:48

Name of class.

Registers the class with the Factory.

Definition at line 74 of file WeakPressureExtrapolate.h.