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)
 
 ~StandardExtrapolate () override
 
- 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)
 
void GenerateBndElmtExpansion (void)
 

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

void v_EvaluatePressureBCs (const Array< OneD, const Array< OneD, NekDouble > > &fields, const Array< OneD, const Array< OneD, NekDouble > > &N, NekDouble kinvis) override
 
void v_SubSteppingTimeIntegration (const LibUtilities::TimeIntegrationSchemeSharedPtr &IntegrationScheme) override
 
void v_SubStepSaveFields (int nstep) override
 
void v_SubStepSetPressureBCs (const Array< OneD, const Array< OneD, NekDouble > > &inarray, NekDouble Aii_DT, NekDouble kinvis) override
 
void v_SubStepAdvance (int nstep, NekDouble time) override
 
void v_MountHOPBCs (int HBCdata, NekDouble kinvis, Array< OneD, NekDouble > &Q, Array< OneD, const NekDouble > &Advection) override
 
void v_AccelerationBDF (Array< OneD, Array< OneD, NekDouble > > &array) override
 
- Protected Member Functions inherited from Nektar::Extrapolate
virtual void v_EvaluatePressureBCs (const Array< OneD, const Array< OneD, NekDouble > > &inarray, const Array< OneD, const Array< OneD, NekDouble > > &N, NekDouble kinvis)=0
 
virtual void v_SubSteppingTimeIntegration (const LibUtilities::TimeIntegrationSchemeSharedPtr &IntegrationScheme)=0
 
virtual void v_SubStepSaveFields (int nstep)=0
 
virtual void v_SubStepSetPressureBCs (const Array< OneD, const Array< OneD, NekDouble > > &inarray, NekDouble Aii_DT, NekDouble kinvis)=0
 
virtual void v_SubStepAdvance (int nstep, NekDouble time)=0
 
virtual void v_MountHOPBCs (int HBCdata, NekDouble kinvis, Array< OneD, NekDouble > &Q, Array< OneD, const NekDouble > &Advection)=0
 
virtual std::string v_GetSubStepName (void)
 
virtual void v_AccelerationBDF (Array< OneD, Array< OneD, NekDouble > > &array)
 
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] = {1.0, 1.5, 11.0 / 6.0}
 

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...
 
Array< OneD, MultiRegions::ExpListSharedPtrm_bndElmtExps
 Boundary expansions on each domain boundary. 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 51 of file StandardExtrapolate.cpp.

56 : Extrapolate(pSession, pFields, pPressure, pVel, advObject)
57{
58}
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:54

◆ ~StandardExtrapolate()

Nektar::StandardExtrapolate::~StandardExtrapolate ( )
override

Definition at line 60 of file StandardExtrapolate.cpp.

61{
62}

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 61 of file StandardExtrapolate.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:60

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

◆ v_AccelerationBDF()

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

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 155 of file StandardExtrapolate.cpp.

157{
158 int nlevels = array.size();
159 int nPts = array[0].size();
160
161 if (nPts)
162 {
163 // Update array
164 RollOver(array);
165
166 // Calculate acceleration using Backward Differentiation Formula
167 Array<OneD, NekDouble> accelerationTerm(nPts, 0.0);
168 if (m_pressureCalls > 2)
169 {
170 int acc_order = std::min(m_pressureCalls - 2, m_intSteps);
171 Vmath::Smul(nPts, DuDt_Coeffs[acc_order - 1][0], array[0], 1,
172 accelerationTerm, 1);
173
174 for (int i = 0; i < acc_order; i++)
175 {
176 Vmath::Svtvp(nPts, DuDt_Coeffs[acc_order - 1][i + 1],
177 array[i + 1], 1, accelerationTerm, 1,
178 accelerationTerm, 1);
179 }
180 }
181 array[nlevels - 1] = accelerationTerm;
182 }
183}
int m_intSteps
Maximum points used in pressure BC evaluation.
Definition: Extrapolate.h:241
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:232
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.hpp:396
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.hpp:100

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 
)
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.

Implements Nektar::Extrapolate.

Reimplemented in Nektar::WeakPressureExtrapolate.

Definition at line 72 of file StandardExtrapolate.cpp.

75{
77 if (m_HBCnumber > 0)
78 {
79 // Calculate non-linear and viscous BCs at current level
80 // and put in m_pressureHBCs[0]
81 CalcNeumannPressureBCs(fields, N, kinvis);
82
83 // Extrapolate to n+1
85
86 // Add (phi,Du/Dt) term to m_presureHBC
87 AddDuDt();
88
89 // Copy m_pressureHBCs to m_PbndExp
91 }
92
93 CalcOutflowBCs(fields, kinvis);
94}
Array< OneD, Array< OneD, NekDouble > > m_pressureHBCs
Storage for current and previous levels of high order pressure boundary conditions.
Definition: Extrapolate.h:247
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:172
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 
)
overrideprotectedvirtual

Implements Nektar::Extrapolate.

Reimplemented in Nektar::WeakPressureExtrapolate.

Definition at line 142 of file StandardExtrapolate.cpp.

145{
146 Vmath::Svtvp(HBCdata, -kinvis, Q, 1, Advection, 1, Q, 1);
147}

References Vmath::Svtvp().

◆ v_SubStepAdvance()

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

Implements Nektar::Extrapolate.

Definition at line 127 of file StandardExtrapolate.cpp.

129{
130}

◆ v_SubSteppingTimeIntegration()

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

Implements Nektar::Extrapolate.

Definition at line 99 of file StandardExtrapolate.cpp.

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

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

◆ v_SubStepSaveFields()

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

Implements Nektar::Extrapolate.

Definition at line 135 of file StandardExtrapolate.cpp.

136{
137}

◆ v_SubStepSetPressureBCs()

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

Implements Nektar::Extrapolate.

Definition at line 118 of file StandardExtrapolate.cpp.

121{
122}

Member Data Documentation

◆ className

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

Referenced by v_AccelerationBDF().