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

#include <StandardExtrapolate.h>

Inheritance diagram for Nektar::StandardExtrapolate:
[legend]

Public Member Functions

 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 Attributes

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)
 
virtual void v_SubSteppingTimeIntegration (const LibUtilities::TimeIntegrationSchemeSharedPtr &IntegrationScheme)
 
virtual void v_SubStepSaveFields (int nstep)
 
virtual void v_SubStepSetPressureBCs (const Array< OneD, const Array< OneD, NekDouble > > &inarray, NekDouble Aii_DT, NekDouble kinvis)
 
virtual void v_SubStepAdvance (int nstep, NekDouble time)
 
virtual void v_MountHOPBCs (int HBCdata, NekDouble kinvis, Array< OneD, NekDouble > &Q, Array< OneD, const NekDouble > &Advection)
 
virtual void v_AccelerationBDF (Array< OneD, Array< OneD, NekDouble > > &array)
 
- 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)
 
virtual void v_AddNormVelOnOBC (const int nbcoeffs, const int nreg, Array< OneD, Array< OneD, NekDouble > > &u)
 
void CalcOutflowBCs (const Array< OneD, const Array< OneD, NekDouble > > &fields, NekDouble kinvis)
 
void RollOver (Array< OneD, Array< OneD, NekDouble > > &input)
 

Static Protected Attributes

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]
 

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
 

Detailed Description

Definition at line 57 of file StandardExtrapolate.h.

Constructor & Destructor Documentation

◆ StandardExtrapolate()

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

Definition at line 53 of file StandardExtrapolate.cpp.

59  : Extrapolate(pSession,pFields,pPressure,pVel,advObject)
60  {
61  }
Extrapolate(const LibUtilities::SessionReaderSharedPtr pSession, Array< OneD, MultiRegions::ExpListSharedPtr > pFields, MultiRegions::ExpListSharedPtr pPressure, const Array< OneD, int > pVel, const SolverUtils::AdvectionSharedPtr advObject)
Definition: Extrapolate.cpp:55

◆ ~StandardExtrapolate()

Nektar::StandardExtrapolate::~StandardExtrapolate ( )
virtual

Definition at line 63 of file StandardExtrapolate.cpp.

64  {
65  }

Member Function Documentation

◆ create()

static ExtrapolateSharedPtr Nektar::StandardExtrapolate::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 62 of file StandardExtrapolate.h.

68  {
70  ::AllocateSharedPtr(pSession,pFields,pPressure,pVel,advObject);
71  return p;
72  }
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:60

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

◆ v_AccelerationBDF()

void Nektar::StandardExtrapolate::v_AccelerationBDF ( Array< OneD, Array< OneD, NekDouble > > &  array)
protectedvirtual

At the start, the newest value is stored in array[nlevels-1] and the previous values in the first positions At the end, the acceleration from BDF is stored in array[nlevels-1] and the storage has been updated to included the new value

Reimplemented from Nektar::Extrapolate.

Definition at line 167 of file StandardExtrapolate.cpp.

169  {
170  int nlevels = array.size();
171  int nPts = array[0].size();
172 
173 
174  if(nPts)
175  {
176  // Update array
177  RollOver(array);
178 
179  // Calculate acceleration using Backward Differentiation Formula
180  Array<OneD, NekDouble> accelerationTerm (nPts, 0.0);
181  if (m_pressureCalls > 2)
182  {
183  int acc_order = min(m_pressureCalls-2,m_intSteps);
184  Vmath::Smul(nPts,
185  DuDt_Coeffs[acc_order-1][0],
186  array[0], 1,
187  accelerationTerm, 1);
188 
189  for(int i = 0; i < acc_order; i++)
190  {
191  Vmath::Svtvp(nPts,
192  DuDt_Coeffs[acc_order-1][i+1],
193  array[i+1], 1,
194  accelerationTerm, 1,
195  accelerationTerm, 1);
196  }
197  }
198  array[nlevels-1] = accelerationTerm;
199  }
200  }
int m_intSteps
Maximum points used in pressure BC evaluation.
Definition: Extrapolate.h:254
void RollOver(Array< OneD, Array< OneD, NekDouble > > &input)
int m_pressureCalls
number of times the high-order pressure BCs have been called
Definition: Extrapolate.h:245
static NekDouble DuDt_Coeffs[3][4]
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:565
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:225

References DuDt_Coeffs, Nektar::Extrapolate::m_intSteps, Nektar::Extrapolate::m_pressureCalls, Nektar::Extrapolate::RollOver(), Vmath::Smul(), and Vmath::Svtvp().

◆ v_EvaluatePressureBCs()

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

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.

Implements Nektar::Extrapolate.

Reimplemented in Nektar::WeakPressureExtrapolate.

Definition at line 76 of file StandardExtrapolate.cpp.

80  {
82  if(m_HBCnumber>0)
83  {
84  // Calculate non-linear and viscous BCs at current level
85  // and put in m_pressureHBCs[0]
86  CalcNeumannPressureBCs(fields,N,kinvis);
87 
88  // Extrapolate to n+1
90 
91  // Add (phi,Du/Dt) term to m_presureHBC
92  AddDuDt();
93 
94  // Copy m_pressureHBCs to m_PbndExp
96  }
97 
98  CalcOutflowBCs(fields, kinvis);
99  }
Array< OneD, Array< OneD, NekDouble > > m_pressureHBCs
Storage for current and previous levels of high order pressure boundary conditions.
Definition: Extrapolate.h:259
void CopyPressureHBCsToPbndExp(void)
void CalcNeumannPressureBCs(const Array< OneD, const Array< OneD, NekDouble > > &fields, const Array< OneD, const Array< OneD, NekDouble > > &N, NekDouble kinvis)
Definition: Extrapolate.h:186
void ExtrapolateArray(Array< OneD, Array< OneD, NekDouble > > &array)
void CalcOutflowBCs(const Array< OneD, const Array< OneD, NekDouble > > &fields, NekDouble kinvis)

References Nektar::Extrapolate::AddDuDt(), 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::StandardExtrapolate::v_MountHOPBCs ( int  HBCdata,
NekDouble  kinvis,
Array< OneD, NekDouble > &  Q,
Array< OneD, const NekDouble > &  Advection 
)
protectedvirtual

Implements Nektar::Extrapolate.

Reimplemented in Nektar::WeakPressureExtrapolate.

Definition at line 152 of file StandardExtrapolate.cpp.

157  {
158  Vmath::Svtvp(HBCdata,-kinvis,Q,1,Advection,1,Q,1);
159  }

References Vmath::Svtvp().

◆ v_SubStepAdvance()

void Nektar::StandardExtrapolate::v_SubStepAdvance ( int  nstep,
NekDouble  time 
)
protectedvirtual

Implements Nektar::Extrapolate.

Definition at line 134 of file StandardExtrapolate.cpp.

137  {
138  }

◆ v_SubSteppingTimeIntegration()

void Nektar::StandardExtrapolate::v_SubSteppingTimeIntegration ( const LibUtilities::TimeIntegrationSchemeSharedPtr IntegrationScheme)
protectedvirtual

Implements Nektar::Extrapolate.

Definition at line 105 of file StandardExtrapolate.cpp.

107  {
108  if ( IntegrationScheme->GetName() == "IMEX" ||
109  IntegrationScheme->GetName() == "IMEXGear" )
110  {
111  m_intSteps = IntegrationScheme->GetOrder();
112  }
113  else
114  {
115  NEKERROR(ErrorUtil::efatal, "Integration method not suitable: "
116  "Options include IMEXGear or IMEXOrder{1,2,3,4}");
117  }
118  }
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mode...
Definition: ErrorUtil.hpp:209

References Nektar::ErrorUtil::efatal, Nektar::Extrapolate::m_intSteps, and NEKERROR.

◆ v_SubStepSaveFields()

void Nektar::StandardExtrapolate::v_SubStepSaveFields ( int  nstep)
protectedvirtual

Implements Nektar::Extrapolate.

Definition at line 144 of file StandardExtrapolate.cpp.

146  {
147  }

◆ v_SubStepSetPressureBCs()

void Nektar::StandardExtrapolate::v_SubStepSetPressureBCs ( const Array< OneD, const Array< OneD, NekDouble > > &  inarray,
NekDouble  Aii_DT,
NekDouble  kinvis 
)
protectedvirtual

Implements Nektar::Extrapolate.

Definition at line 123 of file StandardExtrapolate.cpp.

127  {
128  }

Member Data Documentation

◆ className

std::string Nektar::StandardExtrapolate::className
static
Initial value:
"Standard",
"Standard")
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
Definition: NekFactory.hpp:200
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:49

Name of class.

Registers the class with the Factory.

Definition at line 75 of file StandardExtrapolate.h.

◆ DuDt_Coeffs

NekDouble Nektar::StandardExtrapolate::DuDt_Coeffs
staticprotected
Initial value:
= {
{ 1.0, -1., 0.0, 0.0},
{ 2.5, -4.0, 1.5, 0.0},
{ 13./3., -9.5, 7.0, -11.0/6.0}}

Definition at line 115 of file StandardExtrapolate.h.

Referenced by v_AccelerationBDF().