Nektar++
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Static Private Attributes | List of all members
Nektar::Extrapolate Class Referenceabstract

#include <Extrapolate.h>

Inheritance diagram for Nektar::Extrapolate:
[legend]

Public Member Functions

 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 int intMethod, const LibUtilities::TimeIntegrationWrapperSharedPtr &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 LibUtilities::TimeIntegrationSolutionSharedPtr &integrationSoln, 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 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)
 
LibUtilities::TimeIntegrationMethod GetSubStepIntegrationMethod (void)
 
void ExtrapolateArray (Array< OneD, Array< OneD, NekDouble > > &array)
 
void EvaluateBDFArray (Array< OneD, Array< OneD, NekDouble > > &array)
 
void AccelerationBDF (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)
 

Protected Member Functions

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 (int intMethod, const LibUtilities::TimeIntegrationWrapperSharedPtr &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 (const LibUtilities::TimeIntegrationSolutionSharedPtr &integrationSoln, int nstep, NekDouble time)=0
 
virtual void v_MountHOPBCs (int HBCdata, NekDouble kinvis, Array< OneD, NekDouble > &Q, Array< OneD, const NekDouble > &Advection)=0
 
virtual LibUtilities::TimeIntegrationMethod v_GetSubStepIntegrationMethod (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)
 

Protected Attributes

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

static NekDouble StifflyStable_Betaq_Coeffs [3][3]
 
static NekDouble StifflyStable_Alpha_Coeffs [3][3]
 
static NekDouble StifflyStable_Gamma0_Coeffs [3]
 

Static Private Attributes

static std::string def
 

Detailed Description

Definition at line 74 of file Extrapolate.h.

Constructor & Destructor Documentation

◆ Extrapolate()

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

Definition at line 55 of file Extrapolate.cpp.

References m_comm, m_session, and m_timestep.

61  : m_session(pSession),
62  m_fields(pFields),
63  m_pressure(pPressure),
64  m_velocity(pVel),
65  m_advObject(advObject)
66  {
67  m_session->LoadParameter("TimeStep", m_timestep, 0.01);
68  m_comm = m_session->GetComm();
69  }
MultiRegions::ExpListSharedPtr m_pressure
Pointer to field holding pressure field.
Definition: Extrapolate.h:221
LibUtilities::SessionReaderSharedPtr m_session
Definition: Extrapolate.h:210
Array< OneD, int > m_velocity
int which identifies which components of m_fields contains the velocity (u,v,w);
Definition: Extrapolate.h:225
LibUtilities::CommSharedPtr m_comm
Definition: Extrapolate.h:212
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Velocity fields.
Definition: Extrapolate.h:218
SolverUtils::AdvectionSharedPtr m_advObject
Definition: Extrapolate.h:227
NekDouble m_timestep
Definition: Extrapolate.h:255

◆ ~Extrapolate()

Nektar::Extrapolate::~Extrapolate ( )
virtual

Definition at line 71 of file Extrapolate.cpp.

References def, and Nektar::LibUtilities::SessionReader::RegisterDefaultSolverInfo().

72  {
73  }

Member Function Documentation

◆ AccelerationBDF()

void Nektar::Extrapolate::AccelerationBDF ( Array< OneD, Array< OneD, NekDouble > > &  array)

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

Definition at line 1040 of file Extrapolate.cpp.

References m_intSteps, m_pressureCalls, RollOver(), Vmath::Smul(), StifflyStable_Alpha_Coeffs, StifflyStable_Gamma0_Coeffs, and Vmath::Svtvp().

Referenced by AddDuDt().

1042  {
1043  int nlevels = array.num_elements();
1044  int nPts = array[0].num_elements();
1045 
1046 
1047  if(nPts)
1048  {
1049  // Update array
1050  RollOver(array);
1051 
1052  // Calculate acceleration using Backward Differentiation Formula
1053  Array<OneD, NekDouble> accelerationTerm (nPts, 0.0);
1054  if (m_pressureCalls > 2)
1055  {
1056  int acc_order = min(m_pressureCalls-2,m_intSteps);
1057  Vmath::Smul(nPts,
1058  StifflyStable_Gamma0_Coeffs[acc_order-1],
1059  array[0], 1,
1060  accelerationTerm, 1);
1061 
1062  for(int i = 0; i < acc_order; i++)
1063  {
1064  Vmath::Svtvp(nPts,
1065  -1*StifflyStable_Alpha_Coeffs[acc_order-1][i],
1066  array[i+1], 1,
1067  accelerationTerm, 1,
1068  accelerationTerm, 1);
1069  }
1070  }
1071  array[nlevels-1] = accelerationTerm;
1072  }
1073  }
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:488
void RollOver(Array< OneD, Array< OneD, NekDouble > > &input)
static NekDouble StifflyStable_Gamma0_Coeffs[3]
Definition: Extrapolate.h:268
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*y.
Definition: Vmath.cpp:216
int m_intSteps
Maximum points used in pressure BC evaluation.
Definition: Extrapolate.h:253
int m_pressureCalls
number of times the high-order pressure BCs have been called
Definition: Extrapolate.h:244
static NekDouble StifflyStable_Alpha_Coeffs[3][3]
Definition: Extrapolate.h:267

◆ AddDuDt()

void Nektar::Extrapolate::AddDuDt ( void  )

Definition at line 82 of file Extrapolate.cpp.

References AccelerationBDF(), IProductNormVelocityBCOnHBC(), m_intSteps, m_iprodnormvel, m_numHBCDof, m_pressureHBCs, m_timestep, and Vmath::Svtvp().

Referenced by Nektar::StandardExtrapolate::v_EvaluatePressureBCs(), and Nektar::SubSteppingExtrapolate::v_SubStepSetPressureBCs().

83  {
84  if(m_numHBCDof)
85  {
86  // Update velocity BF at n+1 (actually only needs doing if
87  // velocity is time dependent on HBCs)
89 
90  //Calculate acceleration term at level n based on previous steps
92 
93  // Subtract acceleration term off m_pressureHBCs[nlevels-1]
96  m_pressureHBCs[m_intSteps-1], 1,
97  m_pressureHBCs[m_intSteps-1], 1);
98  }
99  }
void AccelerationBDF(Array< OneD, Array< OneD, NekDouble > > &array)
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:488
int m_intSteps
Maximum points used in pressure BC evaluation.
Definition: Extrapolate.h:253
void IProductNormVelocityBCOnHBC(Array< OneD, NekDouble > &IprodVn)
Array< OneD, Array< OneD, NekDouble > > m_pressureHBCs
Storage for current and previous levels of high order pressure boundary conditions.
Definition: Extrapolate.h:258
Array< OneD, Array< OneD, NekDouble > > m_iprodnormvel
Storage for current and previous levels of the inner product of normal velocity.
Definition: Extrapolate.h:261
NekDouble m_timestep
Definition: Extrapolate.h:255

◆ AddNormVelOnOBC()

void Nektar::Extrapolate::AddNormVelOnOBC ( const int  nbcoeffs,
const int  nreg,
Array< OneD, Array< OneD, NekDouble > > &  u 
)
inline

Definition at line 422 of file Extrapolate.h.

References v_AddNormVelOnOBC().

Referenced by CalcOutflowBCs().

424  {
425  v_AddNormVelOnOBC(nbcoeffs,nreg,u);
426  }
virtual void v_AddNormVelOnOBC(const int nbcoeffs, const int nreg, Array< OneD, Array< OneD, NekDouble > > &u)

◆ AddPressureToOutflowBCs()

void Nektar::Extrapolate::AddPressureToOutflowBCs ( NekDouble  kinvis)

Definition at line 480 of file Extrapolate.cpp.

References Nektar::eConvectiveOBC, m_curl_dim, m_fields, m_hbcType, m_houtflow, m_PBndConds, m_PBndExp, m_pressure, Vmath::Smul(), Vmath::Vadd(), and Vmath::Vmul().

481  {
482  if(!m_houtflow.get())
483  {
484  return;
485  }
486 
487 
488  for(int n = 0; n < m_PBndConds.num_elements(); ++n)
489  {
490  if(m_hbcType[n] == eConvectiveOBC)
491  {
492  int nqb = m_PBndExp[n]->GetTotPoints();
493  int ncb = m_PBndExp[n]->GetNcoeffs();
494 
495  m_pressure->FillBndCondFromField(n);
496  Array<OneD, NekDouble> pbc(nqb);
497 
498  m_PBndExp[n]->BwdTrans(m_PBndExp[n]->GetCoeffs(), pbc);
499 
500  if (m_PBndExp[n]->GetWaveSpace())
501  {
502  m_PBndExp[n]->HomogeneousBwdTrans(pbc, pbc);
503  }
504 
505  Array<OneD, NekDouble> wk(nqb);
506  Array<OneD, NekDouble> wk1(ncb);
507 
508  // Get normal vector
509  Array<OneD, Array<OneD, NekDouble> > normals;
510  m_fields[0]->GetBoundaryNormals(n, normals);
511 
512  // Add 1/kinvis * (pbc n )
513  for(int i = 0; i < m_curl_dim; ++i)
514  {
515  Vmath::Vmul(nqb, normals[i], 1, pbc, 1, wk, 1);
516 
517  Vmath::Smul(nqb, 1.0/kinvis, wk, 1, wk, 1);
518 
519  if (m_houtflow->m_UBndExp[i][n]->GetWaveSpace())
520  {
521  m_houtflow->m_UBndExp[i][n]->
522  HomogeneousFwdTrans(wk, wk);
523  }
524  m_houtflow->m_UBndExp[i][n]->IProductWRTBase(wk,wk1);
525 
526  Vmath::Vadd(ncb, wk1,1,
527  m_houtflow->m_UBndExp[i][n]->GetCoeffs(), 1,
528  m_houtflow->m_UBndExp[i][n]->UpdateCoeffs(),1);
529 
530  }
531  }
532  }
533  }
MultiRegions::ExpListSharedPtr m_pressure
Pointer to field holding pressure field.
Definition: Extrapolate.h:221
Array< OneD, MultiRegions::ExpListSharedPtr > m_PBndExp
pressure boundary conditions expansion container
Definition: Extrapolate.h:241
HighOrderOutflowSharedPtr m_houtflow
Definition: Extrapolate.h:271
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Velocity fields.
Definition: Extrapolate.h:218
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*y.
Definition: Vmath.cpp:216
Array< OneD, HBCType > m_hbcType
Array of type of high order BCs for splitting shemes.
Definition: Extrapolate.h:215
int m_curl_dim
Curl-curl dimensionality.
Definition: Extrapolate.h:232
Array< OneD, const SpatialDomains::BoundaryConditionShPtr > m_PBndConds
pressure boundary conditions container
Definition: Extrapolate.h:238
void Vadd(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = x+y.
Definition: Vmath.cpp:302
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y.
Definition: Vmath.cpp:186

◆ AddVelBC()

void Nektar::Extrapolate::AddVelBC ( void  )

Definition at line 104 of file Extrapolate.cpp.

References IProductNormVelocityBCOnHBC(), m_intSteps, m_iprodnormvel, m_numHBCDof, m_pressureCalls, m_pressureHBCs, m_timestep, StifflyStable_Gamma0_Coeffs, and Vmath::Svtvp().

Referenced by Nektar::WeakPressureExtrapolate::v_EvaluatePressureBCs(), and Nektar::SubSteppingExtrapolateWeakPressure::v_SubStepSetPressureBCs().

105  {
106  if(m_numHBCDof)
107  {
108  int order = std::min(m_pressureCalls,m_intSteps);
109 
110  // Update velocity BF at n+1 (actually only needs doing if
111  // velocity is time dependent on HBCs)
113 
114  // Subtract acceleration term off m_pressureHBCs[nlevels-1]
117  m_iprodnormvel[0], 1,
119  m_pressureHBCs[m_intSteps-1], 1);
120  }
121  }
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:488
static NekDouble StifflyStable_Gamma0_Coeffs[3]
Definition: Extrapolate.h:268
int m_intSteps
Maximum points used in pressure BC evaluation.
Definition: Extrapolate.h:253
int m_pressureCalls
number of times the high-order pressure BCs have been called
Definition: Extrapolate.h:244
void IProductNormVelocityBCOnHBC(Array< OneD, NekDouble > &IprodVn)
Array< OneD, Array< OneD, NekDouble > > m_pressureHBCs
Storage for current and previous levels of high order pressure boundary conditions.
Definition: Extrapolate.h:258
Array< OneD, Array< OneD, NekDouble > > m_iprodnormvel
Storage for current and previous levels of the inner product of normal velocity.
Definition: Extrapolate.h:261
NekDouble m_timestep
Definition: Extrapolate.h:255

◆ CalcNeumannPressureBCs()

void Nektar::Extrapolate::CalcNeumannPressureBCs ( const Array< OneD, const Array< OneD, NekDouble > > &  fields,
const Array< OneD, const Array< OneD, NekDouble > > &  N,
NekDouble  kinvis 
)
inlineprotected

Definition at line 187 of file Extrapolate.h.

References CalcOutflowBCs(), RollOver(), v_AddNormVelOnOBC(), v_CalcNeumannPressureBCs(), and v_CorrectPressureBCs().

Referenced by Nektar::StandardExtrapolate::v_EvaluatePressureBCs(), Nektar::WeakPressureExtrapolate::v_EvaluatePressureBCs(), Nektar::SubSteppingExtrapolateWeakPressure::v_SubStepSetPressureBCs(), and Nektar::SubSteppingExtrapolate::v_SubStepSetPressureBCs().

191  {
192  v_CalcNeumannPressureBCs( fields, N, kinvis);
193  }
virtual void v_CalcNeumannPressureBCs(const Array< OneD, const Array< OneD, NekDouble > > &fields, const Array< OneD, const Array< OneD, NekDouble > > &N, NekDouble kinvis)

◆ CalcOutflowBCs()

void Nektar::Extrapolate::CalcOutflowBCs ( const Array< OneD, const Array< OneD, NekDouble > > &  fields,
NekDouble  kinvis 
)
protected

Definition at line 212 of file Extrapolate.cpp.

References AddNormVelOnOBC(), Nektar::eConvectiveOBC, Nektar::eOBC, EvaluateBDFArray(), ExtrapolateArray(), m_bnd_dim, m_curl_dim, m_fields, m_hbcType, m_houtflow, m_intSteps, m_PBndConds, m_PBndExp, Vmath::Smul(), Vmath::Svtvm(), Vmath::Svtvp(), UpdateRobinPrimCoeff(), Vmath::Vadd(), Vmath::Vmul(), Vmath::Vsub(), and Vmath::Vvtvp().

Referenced by CalcNeumannPressureBCs(), Nektar::WeakPressureExtrapolate::v_EvaluatePressureBCs(), Nektar::StandardExtrapolate::v_EvaluatePressureBCs(), Nektar::SubSteppingExtrapolateWeakPressure::v_SubStepSetPressureBCs(), and Nektar::SubSteppingExtrapolate::v_SubStepSetPressureBCs().

215  {
216  if(!m_houtflow.get())
217  {
218  return;
219  }
220 
221  Array<OneD, Array<OneD, NekDouble> > Velocity(m_curl_dim);
222 
224  int cnt = 0;
225 
226  // Evaluate robin primitive coefficient here so they can be
227  // updated whem m_int > 1 Currently not using this update
228  // since we only using u^n at outflow instead of BDF rule.
230 
231  for(int n = 0; n < m_PBndConds.num_elements(); ++n)
232  {
233  if((m_hbcType[n] == eOBC)||(m_hbcType[n] == eConvectiveOBC))
234  {
235  // Get expansion with element on this boundary
236  m_fields[0]->GetBndElmtExpansion(n, BndElmtExp, false);
237  int nqb = m_PBndExp[n]->GetTotPoints();
238  int nq = BndElmtExp->GetTotPoints();
239 
240  // Get velocity and extrapolate
241  for(int i = 0; i < m_curl_dim; i++)
242  {
243  m_fields[0]->ExtractPhysToBndElmt(n, fields[i],
244  m_houtflow->m_outflowVel[cnt][i][m_intSteps-1]);
245  ExtrapolateArray(m_houtflow->m_outflowVel[cnt][i]);
246  Velocity[i] = m_houtflow->m_outflowVel[cnt][i][m_intSteps-1];
247 
248  }
249 
250  // Homogeneous case needs conversion to physical space
251  if ( m_fields[0]->GetWaveSpace())
252  {
253  for(int i = 0; i < m_curl_dim; i++)
254  {
255  BndElmtExp->HomogeneousBwdTrans(Velocity[i],
256  Velocity[i]);
257  }
258  BndElmtExp->SetWaveSpace(false);
259  }
260 
261  // Get normal vector
262  Array<OneD, Array<OneD, NekDouble> > normals;
263  m_fields[0]->GetBoundaryNormals(n, normals);
264 
265  // Calculate n.gradU.n, div(U)
266  Array<OneD, NekDouble> nGradUn (nqb, 0.0);
267  Array<OneD, NekDouble> divU (nqb, 0.0);
268  Array<OneD, Array<OneD, NekDouble> > grad(m_curl_dim);
269  Array<OneD, NekDouble> bndVal (nqb, 0.0);
270  for( int i = 0; i < m_curl_dim; i++)
271  {
272  grad[i] = Array<OneD, NekDouble> (nq, 0.0);
273  }
274  for( int i = 0; i < m_curl_dim; i++)
275  {
276  if( m_curl_dim == 2)
277  {
278  BndElmtExp->PhysDeriv(Velocity[i], grad[0], grad[1]);
279  }
280  else
281  {
282  BndElmtExp->PhysDeriv(Velocity[i], grad[0], grad[1],
283  grad[2]);
284  }
285 
286  for( int j = 0; j < m_curl_dim; j++)
287  {
288  m_fields[0]->ExtractElmtToBndPhys(n, grad[j],bndVal);
289  // div(U) = gradU_ii
290  if ( i == j)
291  {
292  Vmath::Vadd(nqb , divU, 1, bndVal, 1, divU, 1);
293  }
294  // n.gradU.n = gradU_ij n_i n_j
295  Vmath::Vmul(nqb , normals[i], 1, bndVal, 1,
296  bndVal, 1);
297  Vmath::Vvtvp(nqb , normals[j], 1, bndVal, 1,
298  nGradUn, 1, nGradUn, 1);
299  }
300  }
301 
302  // Obtain u at the boundary
303  Array<OneD, Array<OneD, NekDouble> > u (m_curl_dim);
304  for( int i = 0; i < m_curl_dim; i++)
305  {
306  u[i] = Array<OneD, NekDouble> (nqb, 0.0);
307  m_fields[0]->ExtractElmtToBndPhys(n, Velocity[i],u[i]);
308  }
309 
310  // Calculate u.n and u^2
311  Array<OneD, NekDouble> un (nqb, 0.0);
312  Array<OneD, NekDouble> u2 (nqb, 0.0);
313  for( int i = 0; i < m_curl_dim; i++)
314  {
315  Vmath::Vvtvp(nqb, normals[i], 1, u[i], 1,
316  un, 1, un, 1);
317  Vmath::Vvtvp(nqb, u[i], 1, u[i], 1,
318  u2, 1, u2, 1);
319  }
320 
321  // Calculate S_0(u.n) = 0.5*(1-tanh(u.n/*U0*delta))
322  Array<OneD, NekDouble> S0 (nqb, 0.0);
323  for( int i = 0; i < nqb; i++)
324  {
325  S0[i] = 0.5*(1.0-tanh(un[i]/(m_houtflow->m_U0*m_houtflow->m_delta)));
326  }
327 
328  // Calculate E(n,u) = ((theta+alpha2)*0.5*(u^2)n +
329  // (1-theta+alpha1)*0.5*(n.u)u ) * S_0(u.n)
330  NekDouble k1 = 0.5*(m_houtflow->m_obcTheta +
331  m_houtflow->m_obcAlpha2);
332  NekDouble k2 = 0.5*(1-m_houtflow->m_obcTheta +
333  m_houtflow->m_obcAlpha1);
334 
335  Array<OneD, Array<OneD, NekDouble> > E (m_curl_dim);
336  for( int i = 0; i < m_curl_dim; i++)
337  {
338  E[i] = Array<OneD, NekDouble> (nqb, 0.0);
339 
340  Vmath::Smul(nqb, k1, u2, 1, E[i], 1);
341  Vmath::Vmul(nqb, E[i], 1, normals[i], 1, E[i], 1);
342  // Use bndVal as a temporary storage
343  Vmath::Smul(nqb, k2, un, 1, bndVal, 1);
344  Vmath::Vvtvp(nqb, u[i], 1, bndVal, 1, E[i], 1, E[i], 1);
345  Vmath::Vmul(nqb, E[i], 1, S0, 1, E[i], 1);
346  }
347 
348  // if non-zero forcing is provided we want to subtract
349  // value if we want to interpret values as being the
350  // desired pressure value. This is now precribed from
351  // the velocity forcing to be consistent with the
352  // paper except f_b = -f_b
353 
354  // Calculate (E(n,u) + f_b).n
355  Array<OneD, NekDouble> En (nqb, 0.0);
356  for( int i = 0; i < m_bnd_dim; i++)
357  {
358  // Use bndVal as temporary
359  Vmath::Vsub(nqb,E[i],1,m_houtflow->
360  m_UBndExp[i][n]->GetPhys(),
361  1, bndVal, 1);
362 
363  Vmath::Vvtvp(nqb, normals[i], 1, bndVal, 1,
364  En, 1, En, 1);
365 
366  }
367 
368  // Calculate pressure bc = kinvis*n.gradU.n - E.n + f_b.n
369  Array<OneD, NekDouble> pbc (nqb, 0.0);
370  Vmath::Svtvm( nqb, kinvis, nGradUn, 1, En, 1, pbc, 1);
371 
372  if(m_hbcType[n] == eOBC)
373  {
374 
375  if ( m_PBndExp[n]->GetWaveSpace())
376  {
377  m_PBndExp[n]->HomogeneousFwdTrans(pbc, bndVal);
378  m_PBndExp[n]->FwdTrans(bndVal,
379  m_PBndExp[n]->UpdateCoeffs());
380  }
381  else
382  {
383  m_PBndExp[n]->FwdTrans(pbc,
384  m_PBndExp[n]->UpdateCoeffs());
385  }
386  }
387  else if(m_hbcType[n] == eConvectiveOBC) // add outflow values to calculation from HBC
388  {
389  int nbcoeffs = m_PBndExp[n]->GetNcoeffs();
390  Array<OneD, NekDouble> bndCoeffs (nbcoeffs, 0.0);
391  if ( m_PBndExp[n]->GetWaveSpace())
392  {
393  m_PBndExp[n]->HomogeneousFwdTrans(pbc, bndVal);
394  m_PBndExp[n]->IProductWRTBase(bndVal,bndCoeffs);
395  }
396  else
397  {
398  m_PBndExp[n]->IProductWRTBase(pbc,bndCoeffs);
399  }
400  // Note we have the negative of what is in the Dong paper in bndVal
401  Vmath::Svtvp(nbcoeffs,m_houtflow->m_pressurePrimCoeff[n],
402  bndCoeffs, 1,m_PBndExp[n]->UpdateCoeffs(),1,
403  m_PBndExp[n]->UpdateCoeffs(),1);
404 
405  // evaluate u^n at outflow boundary for velocity BC
406  for( int i = 0; i < m_curl_dim; i++)
407  {
408  m_fields[0]->ExtractElmtToBndPhys(n,
409  m_houtflow->
410  m_outflowVel[cnt][i][0],
411  m_houtflow->
412  m_outflowVelBnd[cnt][i][m_intSteps-1]);
413 
414  EvaluateBDFArray(m_houtflow->m_outflowVelBnd[cnt][i]);
415 
416  // point u[i] to BDF evalauted value \hat{u}
417  u[i] = m_houtflow->m_outflowVelBnd[cnt][i]
418  [m_intSteps-1];
419  }
420 
421  // Add normal velocity if weak pressure
422  // formulation. In this case there is an
423  // additional \int \hat{u}.n ds on the outflow
424  // boundary since we use the inner product wrt
425  // deriv of basis in pressure solve.
426  AddNormVelOnOBC(cnt, n, u);
427  }
428 
429  // Calculate velocity boundary conditions
430  if(m_hbcType[n] == eOBC)
431  {
432  // = (pbc n - kinvis divU n)
433  Vmath::Smul(nqb, kinvis, divU, 1, divU, 1);
434  Vmath::Vsub(nqb, pbc, 1, divU, 1, bndVal, 1);
435  }
436  else if (m_hbcType[n] == eConvectiveOBC)
437  {
438  // = (-kinvis divU n)
439  Vmath::Smul(nqb, -1.0*kinvis, divU, 1, bndVal, 1);
440 
441  // pbc needs to be added after pressure solve
442  }
443 
444  for(int i = 0; i < m_curl_dim; ++i)
445  {
446  // Reuse divU -> En
447  Vmath::Vvtvp( nqb, normals[i], 1, bndVal, 1, E[i], 1,
448  divU, 1);
449  // - f_b
450  Vmath::Vsub( nqb, divU, 1,
451  m_houtflow->m_UBndExp[i][n]->GetPhys(),
452  1, divU, 1);
453  // * 1/kinvis
454  Vmath::Smul(nqb, 1.0/kinvis, divU, 1, divU, 1);
455 
456  if(m_hbcType[n] == eConvectiveOBC)
457  {
458  Vmath::Svtvp(nqb,m_houtflow->m_velocityPrimCoeff[i][n],
459  u[i], 1,divU,1,divU,1);
460  }
461 
462  if ( m_houtflow->m_UBndExp[i][n]->GetWaveSpace())
463  {
464  m_houtflow->m_UBndExp[i][n]->HomogeneousFwdTrans(divU,
465  divU);
466  }
467 
468  m_houtflow->m_UBndExp[i][n]->IProductWRTBase(divU,
469  m_houtflow->m_UBndExp[i][n]->UpdateCoeffs());
470 
471  }
472 
473  // Get offset for next terms
474  cnt++;
475  }
476  }
477  }
void UpdateRobinPrimCoeff(void)
void ExtrapolateArray(Array< OneD, Array< OneD, NekDouble > > &array)
Array< OneD, MultiRegions::ExpListSharedPtr > m_PBndExp
pressure boundary conditions expansion container
Definition: Extrapolate.h:241
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
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:488
void Vvtvp(int n, const T *w, const int incw, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
vvtvp (vector times vector plus vector): z = w*x + y
Definition: Vmath.cpp:445
HighOrderOutflowSharedPtr m_houtflow
Definition: Extrapolate.h:271
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Velocity fields.
Definition: Extrapolate.h:218
void EvaluateBDFArray(Array< OneD, Array< OneD, NekDouble > > &array)
int m_bnd_dim
bounday dimensionality
Definition: Extrapolate.h:235
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*y.
Definition: Vmath.cpp:216
Array< OneD, HBCType > m_hbcType
Array of type of high order BCs for splitting shemes.
Definition: Extrapolate.h:215
int m_intSteps
Maximum points used in pressure BC evaluation.
Definition: Extrapolate.h:253
void Svtvm(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:521
double NekDouble
void Vsub(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Subtract vector z = x-y.
Definition: Vmath.cpp:346
int m_curl_dim
Curl-curl dimensionality.
Definition: Extrapolate.h:232
Array< OneD, const SpatialDomains::BoundaryConditionShPtr > m_PBndConds
pressure boundary conditions container
Definition: Extrapolate.h:238
void Vadd(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = x+y.
Definition: Vmath.cpp:302
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y.
Definition: Vmath.cpp:186
void AddNormVelOnOBC(const int nbcoeffs, const int nreg, Array< OneD, Array< OneD, NekDouble > > &u)
Definition: Extrapolate.h:422

◆ CopyPressureHBCsToPbndExp()

void Nektar::Extrapolate::CopyPressureHBCsToPbndExp ( void  )

Definition at line 1075 of file Extrapolate.cpp.

References Nektar::eConvectiveOBC, Nektar::eHBCNeumann, m_hbcType, m_intSteps, m_PBndConds, m_PBndExp, m_pressureHBCs, and Vmath::Vcopy().

Referenced by Nektar::StandardExtrapolate::v_EvaluatePressureBCs(), Nektar::WeakPressureExtrapolate::v_EvaluatePressureBCs(), Nektar::SubSteppingExtrapolateWeakPressure::v_SubStepSetPressureBCs(), and Nektar::SubSteppingExtrapolate::v_SubStepSetPressureBCs().

1076  {
1077  int n, cnt;
1078  for(cnt = n = 0; n < m_PBndConds.num_elements(); ++n)
1079  {
1080  if((m_hbcType[n] == eHBCNeumann)||(m_hbcType[n] == eConvectiveOBC))
1081  {
1082  int nq = m_PBndExp[n]->GetNcoeffs();
1083  Vmath::Vcopy(nq, &(m_pressureHBCs[m_intSteps-1])[cnt], 1,
1084  &(m_PBndExp[n]->UpdateCoeffs()[0]), 1);
1085  cnt += nq;
1086  }
1087  }
1088  }
Array< OneD, MultiRegions::ExpListSharedPtr > m_PBndExp
pressure boundary conditions expansion container
Definition: Extrapolate.h:241
Array< OneD, HBCType > m_hbcType
Array of type of high order BCs for splitting shemes.
Definition: Extrapolate.h:215
int m_intSteps
Maximum points used in pressure BC evaluation.
Definition: Extrapolate.h:253
Array< OneD, Array< OneD, NekDouble > > m_pressureHBCs
Storage for current and previous levels of high order pressure boundary conditions.
Definition: Extrapolate.h:258
Array< OneD, const SpatialDomains::BoundaryConditionShPtr > m_PBndConds
pressure boundary conditions container
Definition: Extrapolate.h:238
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1064

◆ CorrectPressureBCs()

void Nektar::Extrapolate::CorrectPressureBCs ( const Array< OneD, NekDouble > &  pressure)
inline

Definition at line 412 of file Extrapolate.h.

References v_CorrectPressureBCs().

414  {
415  v_CorrectPressureBCs(pressure);
416  }
virtual void v_CorrectPressureBCs(const Array< OneD, NekDouble > &pressure)

◆ EvaluateBDFArray()

void Nektar::Extrapolate::EvaluateBDFArray ( Array< OneD, Array< OneD, NekDouble > > &  array)

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

Definition at line 1011 of file Extrapolate.cpp.

References m_intSteps, m_pressureCalls, RollOver(), Vmath::Smul(), StifflyStable_Alpha_Coeffs, and Vmath::Svtvp().

Referenced by CalcOutflowBCs(), Nektar::SubSteppingExtrapolateWeakPressure::v_AddNormVelOnOBC(), and Nektar::WeakPressureExtrapolate::v_AddNormVelOnOBC().

1013  {
1014  int nint = min(m_pressureCalls,m_intSteps);
1015  int nlevels = array.num_elements();
1016  int nPts = array[0].num_elements();
1017 
1018  // Update array
1019  RollOver(array);
1020 
1021  // Extrapolate to outarray
1022  Vmath::Smul(nPts, StifflyStable_Alpha_Coeffs[nint-1][nint-1],
1023  array[nint-1], 1,
1024  array[nlevels-1], 1);
1025 
1026  for(int n = 0; n < nint-1; ++n)
1027  {
1028  Vmath::Svtvp(nPts, StifflyStable_Alpha_Coeffs[nint-1][n],
1029  array[n],1, array[nlevels-1],1,
1030  array[nlevels-1],1);
1031  }
1032  }
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:488
void RollOver(Array< OneD, Array< OneD, NekDouble > > &input)
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*y.
Definition: Vmath.cpp:216
int m_intSteps
Maximum points used in pressure BC evaluation.
Definition: Extrapolate.h:253
int m_pressureCalls
number of times the high-order pressure BCs have been called
Definition: Extrapolate.h:244
static NekDouble StifflyStable_Alpha_Coeffs[3][3]
Definition: Extrapolate.h:267

◆ EvaluatePressureBCs()

void Nektar::Extrapolate::EvaluatePressureBCs ( const Array< OneD, const Array< OneD, NekDouble > > &  inarray,
const Array< OneD, const Array< OneD, NekDouble > > &  N,
NekDouble  kinvis 
)
inline

Evaluate Pressure Boundary Conditions for Standard Extrapolation

Definition at line 339 of file Extrapolate.h.

References v_EvaluatePressureBCs().

343  {
344  v_EvaluatePressureBCs(inarray,N,kinvis);
345  }
virtual void v_EvaluatePressureBCs(const Array< OneD, const Array< OneD, NekDouble > > &inarray, const Array< OneD, const Array< OneD, NekDouble > > &N, NekDouble kinvis)=0

◆ ExtrapolateArray() [1/2]

void Nektar::Extrapolate::ExtrapolateArray ( Array< OneD, Array< OneD, NekDouble > > &  array)

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

Definition at line 981 of file Extrapolate.cpp.

References m_intSteps, m_pressureCalls, RollOver(), Vmath::Smul(), StifflyStable_Betaq_Coeffs, and Vmath::Svtvp().

Referenced by CalcOutflowBCs(), Nektar::WeakPressureExtrapolate::v_EvaluatePressureBCs(), Nektar::StandardExtrapolate::v_EvaluatePressureBCs(), Nektar::SubSteppingExtrapolateWeakPressure::v_SubStepSetPressureBCs(), and Nektar::SubSteppingExtrapolate::v_SubStepSetPressureBCs().

983  {
984  int nint = min(m_pressureCalls,m_intSteps);
985  int nlevels = array.num_elements();
986  int nPts = array[0].num_elements();
987 
988  // Update array
989  RollOver(array);
990 
991  // Extrapolate to outarray
992  Vmath::Smul(nPts, StifflyStable_Betaq_Coeffs[nint-1][nint-1],
993  array[nint-1], 1,
994  array[nlevels-1], 1);
995 
996  for(int n = 0; n < nint-1; ++n)
997  {
998  Vmath::Svtvp(nPts, StifflyStable_Betaq_Coeffs[nint-1][n],
999  array[n],1, array[nlevels-1],1,
1000  array[nlevels-1],1);
1001  }
1002  }
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:488
void RollOver(Array< OneD, Array< OneD, NekDouble > > &input)
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*y.
Definition: Vmath.cpp:216
int m_intSteps
Maximum points used in pressure BC evaluation.
Definition: Extrapolate.h:253
int m_pressureCalls
number of times the high-order pressure BCs have been called
Definition: Extrapolate.h:244
static NekDouble StifflyStable_Betaq_Coeffs[3][3]
Definition: Extrapolate.h:266

◆ ExtrapolateArray() [2/2]

void Nektar::Extrapolate::ExtrapolateArray ( Array< OneD, Array< OneD, NekDouble > > &  oldarrays,
Array< OneD, NekDouble > &  newarray,
Array< OneD, NekDouble > &  outarray 
)

◆ ExtrapolatePressureHBCs()

void Nektar::Extrapolate::ExtrapolatePressureHBCs ( void  )

◆ GenerateHOPBCMap()

void Nektar::Extrapolate::GenerateHOPBCMap ( const LibUtilities::SessionReaderSharedPtr pSession)

Initialize HOBCs

Definition at line 632 of file Extrapolate.cpp.

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), ASSERTL0, ASSERTL1, Nektar::MultiRegions::e2D, Nektar::MultiRegions::e3D, Nektar::MultiRegions::e3DH1D, Nektar::MultiRegions::e3DH2D, Nektar::eConvectiveOBC, Nektar::eHBCNeumann, Nektar::eNOHBC, Nektar::eOBC, Nektar::SpatialDomains::eRobin, Nektar::LibUtilities::Equation::Evaluate(), Nektar::LibUtilities::Equation::GetExpression(), m_bnd_dim, m_curl_dim, m_fields, m_HBCnumber, m_hbcType, m_houtflow, m_intSteps, m_iprodnormvel, m_numHBCDof, m_PBndConds, m_PBndExp, m_pressure, m_pressureCalls, m_pressureHBCs, and m_velocity.

633  {
634  m_PBndConds = m_pressure->GetBndConditions();
635  m_PBndExp = m_pressure->GetBndCondExpansions();
636 
637  int cnt, n;
638 
639  // Storage array for high order pressure BCs
640  m_pressureHBCs = Array<OneD, Array<OneD, NekDouble> > (m_intSteps);
641  m_iprodnormvel = Array<OneD, Array<OneD, NekDouble> > (m_intSteps + 1);
642 
643  // Get useful values for HOBCs
644  m_HBCnumber = 0;
645  m_numHBCDof = 0;
646 
647  int outHBCnumber = 0;
648  int numOutHBCPts = 0;
649 
650  m_hbcType = Array<OneD, HBCType> (m_PBndConds.num_elements(),eNOHBC);
651  for( n = 0; n < m_PBndConds.num_elements(); ++n)
652  {
653  // High order boundary Neumann Condiiton
654  if(boost::iequals(m_PBndConds[n]->GetUserDefined(),"H"))
655  {
656  m_hbcType[n] = eHBCNeumann;
657  m_numHBCDof += m_PBndExp[n]->GetNcoeffs();
658  m_HBCnumber += m_PBndExp[n]->GetExpSize();
659  }
660 
661  // High order outflow convective condition
662  if(m_PBndConds[n]->GetBoundaryConditionType() ==
664  boost::iequals(m_PBndConds[n]->GetUserDefined(),
665  "HOutflow"))
666  {
668  m_numHBCDof += m_PBndExp[n]->GetNcoeffs();
669  m_HBCnumber += m_PBndExp[n]->GetExpSize();
670  numOutHBCPts += m_PBndExp[n]->GetTotPoints();
671  outHBCnumber++;
672  }
673  // High order outflow boundary condition;
674  else if(boost::iequals(m_PBndConds[n]->GetUserDefined(),
675  "HOutflow"))
676  {
677  m_hbcType[n] = eOBC;
678  numOutHBCPts += m_PBndExp[n]->GetTotPoints();
679  outHBCnumber++;
680  }
681  }
682 
683  m_iprodnormvel[0] = Array<OneD, NekDouble>(m_numHBCDof, 0.0);
684  for(n = 0; n < m_intSteps; ++n)
685  {
686  m_pressureHBCs[n] = Array<OneD, NekDouble>(m_numHBCDof, 0.0);
687  m_iprodnormvel[n+1] = Array<OneD, NekDouble>(m_numHBCDof, 0.0);
688  }
689 
690  m_pressureCalls = 0;
691 
692  switch(m_pressure->GetExpType())
693  {
694  case MultiRegions::e2D:
695  {
696  m_curl_dim = 2;
697  m_bnd_dim = 2;
698  }
699  break;
701  {
702  m_curl_dim = 3;
703  m_bnd_dim = 2;
704  }
705  break;
707  {
708  m_curl_dim = 3;
709  m_bnd_dim = 1;
710  }
711  break;
712  case MultiRegions::e3D:
713  {
714  m_curl_dim = 3;
715  m_bnd_dim = 3;
716  }
717  break;
718  default:
719  ASSERTL0(0,"Dimension not supported");
720  break;
721  }
722 
723  // Initialise storage for outflow HOBCs
724  if(numOutHBCPts > 0)
725  {
726  m_houtflow = MemoryManager<HighOrderOutflow>::AllocateSharedPtr(numOutHBCPts, outHBCnumber, m_curl_dim, pSession);
727 
729 
730  // set up boundary expansions link
731  for (int i = 0; i < m_curl_dim; ++i)
732  {
733  m_houtflow->m_UBndExp[i] =
734  m_fields[m_velocity[i]]->GetBndCondExpansions();
735  }
736 
737  for(n = 0, cnt = 0; n < m_PBndConds.num_elements(); ++n)
738  {
739  if(boost::iequals(m_PBndConds[n]->GetUserDefined(),"HOutflow"))
740  {
741  m_houtflow->m_outflowVel[cnt] =
742  Array<OneD, Array<OneD,
743  Array<OneD, NekDouble> > > (m_curl_dim);
744 
745  m_houtflow->m_outflowVelBnd[cnt] =
746  Array<OneD, Array<OneD,
747  Array<OneD, NekDouble> > > (m_curl_dim);
748 
749  m_fields[0]->GetBndElmtExpansion(n, BndElmtExp, false);
750  int nqb = m_PBndExp[n]->GetTotPoints();
751  int nq = BndElmtExp->GetTotPoints();
752  for(int j = 0; j < m_curl_dim; ++j)
753  {
754  m_houtflow->m_outflowVel[cnt][j] =
755  Array<OneD, Array<OneD, NekDouble> > (m_intSteps);
756 
757  m_houtflow->m_outflowVelBnd[cnt][j] =
758  Array<OneD, Array<OneD, NekDouble> > (m_intSteps);
759 
760  for(int k = 0; k < m_intSteps; ++k)
761  {
762  m_houtflow->m_outflowVel[cnt][j][k] =
763  Array<OneD, NekDouble>(nq,0.0);
764  m_houtflow->m_outflowVelBnd[cnt][j][k] =
765  Array<OneD, NekDouble>(nqb,0.0);
766  }
767  }
768  cnt++;
769  }
770 
771  // evaluate convective primitive coefficient if
772  // convective OBCs are used
773  if(m_hbcType[n] == eConvectiveOBC)
774  {
775  // initialise convective members of
776  // HighOrderOutflow struct
777  if(m_houtflow->m_pressurePrimCoeff.num_elements() == 0)
778  {
779  m_houtflow->m_pressurePrimCoeff =
780  Array<OneD, NekDouble>
781  (m_PBndConds.num_elements(),0.0);
782  m_houtflow->m_velocityPrimCoeff =
783  Array<OneD, Array< OneD, NekDouble> >(m_curl_dim);
784 
785 
786  for(int i = 0; i < m_curl_dim; ++i)
787  {
788  m_houtflow->m_velocityPrimCoeff[i] =
789  Array<OneD, NekDouble> (m_PBndConds.
790  num_elements(),0.0);
791  }
792  }
793 
794  LibUtilities::Equation coeff =
795  std::static_pointer_cast<
796  SpatialDomains::RobinBoundaryCondition
797  >(m_PBndConds[n])->m_robinPrimitiveCoeff;
798 
799  // checkout equation evaluation options!!
800  m_houtflow->m_pressurePrimCoeff[n] = coeff.Evaluate();
801 
802  for (int i = 0; i < m_curl_dim; ++i)
803  {
804  Array<OneD, const SpatialDomains::BoundaryConditionShPtr>
805  UBndConds = m_fields[m_velocity[i]]->GetBndConditions();
806 
807  LibUtilities::Equation coeff1 =
808  std::static_pointer_cast<
809  SpatialDomains::RobinBoundaryCondition
810  >(UBndConds[n])->m_robinPrimitiveCoeff;
811 
812 
813  m_houtflow->m_defVelPrimCoeff[i] = coeff1.GetExpression();
814 
815  ASSERTL1(UBndConds[n]->GetBoundaryConditionType()
816  == SpatialDomains::eRobin,"Require Velocity "
817  "conditions to be of Robin type when pressure"
818  "outflow is specticied as Robin Boundary type");
819 
820 
821  // checkout equation evaluation options!!
822  m_houtflow->m_velocityPrimCoeff[i][n] = coeff1.Evaluate();
823  }
824  }
825  }
826 
827  }
828  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:216
MultiRegions::ExpListSharedPtr m_pressure
Pointer to field holding pressure field.
Definition: Extrapolate.h:221
Array< OneD, int > m_velocity
int which identifies which components of m_fields contains the velocity (u,v,w);
Definition: Extrapolate.h:225
Array< OneD, MultiRegions::ExpListSharedPtr > m_PBndExp
pressure boundary conditions expansion container
Definition: Extrapolate.h:241
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
HighOrderOutflowSharedPtr m_houtflow
Definition: Extrapolate.h:271
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Velocity fields.
Definition: Extrapolate.h:218
int m_bnd_dim
bounday dimensionality
Definition: Extrapolate.h:235
Array< OneD, HBCType > m_hbcType
Array of type of high order BCs for splitting shemes.
Definition: Extrapolate.h:215
int m_intSteps
Maximum points used in pressure BC evaluation.
Definition: Extrapolate.h:253
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
int m_pressureCalls
number of times the high-order pressure BCs have been called
Definition: Extrapolate.h:244
Array< OneD, Array< OneD, NekDouble > > m_pressureHBCs
Storage for current and previous levels of high order pressure boundary conditions.
Definition: Extrapolate.h:258
int m_curl_dim
Curl-curl dimensionality.
Definition: Extrapolate.h:232
Array< OneD, Array< OneD, NekDouble > > m_iprodnormvel
Storage for current and previous levels of the inner product of normal velocity.
Definition: Extrapolate.h:261
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:250
Array< OneD, const SpatialDomains::BoundaryConditionShPtr > m_PBndConds
pressure boundary conditions container
Definition: Extrapolate.h:238

◆ GetMaxStdVelocity()

Array< OneD, NekDouble > Nektar::Extrapolate::GetMaxStdVelocity ( const Array< OneD, Array< OneD, NekDouble > >  inarray)

Definition at line 873 of file Extrapolate.cpp.

References ASSERTL0, Nektar::SpatialDomains::eDeformed, m_curl_dim, m_fields, Vmath::Svtvp(), Vmath::Vmax(), Vmath::Vmul(), Vmath::Vvtvp(), and Vmath::Zero().

Referenced by Nektar::SubSteppingExtrapolate::GetSubstepTimeStep().

875  {
876  // Checking if the problem is 2D
877  ASSERTL0(m_curl_dim >= 2, "Method not implemented for 1D");
878 
879  int n_points_0 = m_fields[0]->GetExp(0)->GetTotPoints();
880  int n_element = m_fields[0]->GetExpSize();
881  int nvel = inarray.num_elements();
882  int cnt;
883 
884  NekDouble pntVelocity;
885 
886  // Getting the standard velocity vector
887  Array<OneD, Array<OneD, NekDouble> > stdVelocity(nvel);
888  Array<OneD, NekDouble> tmp;
889  Array<OneD, NekDouble> maxV(n_element, 0.0);
891 
892  for (int i = 0; i < nvel; ++i)
893  {
894  stdVelocity[i] = Array<OneD, NekDouble>(n_points_0);
895  }
896 
897  cnt = 0.0;
898  for (int el = 0; el < n_element; ++el)
899  {
900  int n_points = m_fields[0]->GetExp(el)->GetTotPoints();
901  ptsKeys = m_fields[0]->GetExp(el)->GetPointsKeys();
902 
903  // reset local space
904  if(n_points != n_points_0)
905  {
906  for (int j = 0; j < nvel; ++j)
907  {
908  stdVelocity[j] = Array<OneD, NekDouble>(n_points, 0.0);
909  }
910  n_points_0 = n_points;
911  }
912  else
913  {
914  for (int j = 0; j < nvel; ++j)
915  {
916  Vmath::Zero( n_points, stdVelocity[j], 1);
917  }
918  }
919 
920  Array<TwoD, const NekDouble> gmat =
921  m_fields[0]->GetExp(el)->GetGeom()->GetMetricInfo()->GetDerivFactors(ptsKeys);
922 
923  if (m_fields[0]->GetExp(el)->GetGeom()->GetMetricInfo()->GetGtype()
925  {
926  for(int j = 0; j < nvel; ++j)
927  {
928  for(int k = 0; k < nvel; ++k)
929  {
930  Vmath::Vvtvp( n_points, gmat[k*nvel + j], 1,
931  tmp = inarray[k] + cnt, 1,
932  stdVelocity[j], 1,
933  stdVelocity[j], 1);
934  }
935  }
936  }
937  else
938  {
939  for(int j = 0; j < nvel; ++j)
940  {
941  for(int k = 0; k < nvel; ++k)
942  {
943  Vmath::Svtvp( n_points, gmat[k*nvel + j][0],
944  tmp = inarray[k] + cnt, 1,
945  stdVelocity[j], 1,
946  stdVelocity[j], 1);
947  }
948  }
949  }
950  cnt += n_points;
951 
952  // Calculate total velocity in stdVelocity[0]
953  Vmath::Vmul( n_points, stdVelocity[0], 1, stdVelocity[0], 1,
954  stdVelocity[0], 1);
955  for(int k = 1; k < nvel; ++k)
956  {
957  Vmath::Vvtvp( n_points, stdVelocity[k], 1,
958  stdVelocity[k], 1,
959  stdVelocity[0], 1,
960  stdVelocity[0], 1);
961  }
962  pntVelocity = Vmath::Vmax( n_points, stdVelocity[0], 1);
963  maxV[el] = sqrt(pntVelocity);
964  }
965 
966  return maxV;
967  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:216
std::vector< PointsKey > PointsKeyVector
Definition: Points.h:246
T Vmax(int n, const T *x, const int incx)
Return the maximum element in x – called vmax to avoid conflict with max.
Definition: Vmath.cpp:782
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:488
void Vvtvp(int n, const T *w, const int incw, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
vvtvp (vector times vector plus vector): z = w*x + y
Definition: Vmath.cpp:445
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Velocity fields.
Definition: Extrapolate.h:218
double NekDouble
int m_curl_dim
Curl-curl dimensionality.
Definition: Extrapolate.h:232
void Zero(int n, T *x, const int incx)
Zero vector.
Definition: Vmath.cpp:376
Geometry is curved or has non-constant factors.
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y.
Definition: Vmath.cpp:186

◆ GetSubStepIntegrationMethod()

LibUtilities::TimeIntegrationMethod Nektar::Extrapolate::GetSubStepIntegrationMethod ( void  )
inline

Definition at line 404 of file Extrapolate.h.

References v_GetSubStepIntegrationMethod().

405  {
407  }
virtual LibUtilities::TimeIntegrationMethod v_GetSubStepIntegrationMethod(void)

◆ IProductNormVelocityBCOnHBC()

void Nektar::Extrapolate::IProductNormVelocityBCOnHBC ( Array< OneD, NekDouble > &  IprodVn)

Definition at line 564 of file Extrapolate.cpp.

References Nektar::eConvectiveOBC, Nektar::eHBCNeumann, m_bnd_dim, m_fields, m_HBCnumber, m_hbcType, m_PBndConds, m_PBndExp, and m_velocity.

Referenced by AddDuDt(), and AddVelBC().

565  {
566 
567  if(!m_HBCnumber)
568  {
569  return;
570  }
571  int i,n,cnt;
572  Array<OneD, NekDouble> IProdVnTmp;
573  Array<OneD, Array<OneD, NekDouble> > velbc(m_bnd_dim);
574  Array<OneD, Array<OneD, MultiRegions::ExpListSharedPtr> > VelBndExp(m_bnd_dim);
575  for(i = 0; i < m_bnd_dim; ++i)
576  {
577  VelBndExp[i] = m_fields[m_velocity[i]]->GetBndCondExpansions();
578  }
579 
580  for(n = cnt = 0; n < m_PBndConds.num_elements(); ++n)
581  {
582  // High order boundary condition;
583  if(m_hbcType[n] == eHBCNeumann)
584  {
585  for(i = 0; i < m_bnd_dim; ++i)
586  {
587  velbc[i] = Array<OneD, NekDouble>
588  (VelBndExp[i][n]->GetTotPoints(), 0.0);
589  VelBndExp[i][n]->SetWaveSpace(
590  m_fields[m_velocity[i]]->GetWaveSpace());
591  VelBndExp[i][n]->BwdTrans(VelBndExp[i][n]->GetCoeffs(),
592  velbc[i]);
593  }
594  IProdVnTmp = IProdVn + cnt;
595  m_PBndExp[n]->NormVectorIProductWRTBase(velbc, IProdVnTmp);
596  cnt += m_PBndExp[n]->GetNcoeffs();
597  }
598  else if(m_hbcType[n] == eConvectiveOBC)
599  {
600  // skip over convective OBC
601  cnt += m_PBndExp[n]->GetNcoeffs();
602  }
603  }
604  }
Array< OneD, int > m_velocity
int which identifies which components of m_fields contains the velocity (u,v,w);
Definition: Extrapolate.h:225
Array< OneD, MultiRegions::ExpListSharedPtr > m_PBndExp
pressure boundary conditions expansion container
Definition: Extrapolate.h:241
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Velocity fields.
Definition: Extrapolate.h:218
int m_bnd_dim
bounday dimensionality
Definition: Extrapolate.h:235
Array< OneD, HBCType > m_hbcType
Array of type of high order BCs for splitting shemes.
Definition: Extrapolate.h:215
Array< OneD, const SpatialDomains::BoundaryConditionShPtr > m_PBndConds
pressure boundary conditions container
Definition: Extrapolate.h:238

◆ IProductNormVelocityOnHBC()

void Nektar::Extrapolate::IProductNormVelocityOnHBC ( const Array< OneD, const Array< OneD, NekDouble > > &  Vel,
Array< OneD, NekDouble > &  IprodVn 
)

Definition at line 536 of file Extrapolate.cpp.

References Nektar::eConvectiveOBC, Nektar::eHBCNeumann, m_bnd_dim, m_fields, m_hbcType, m_PBndConds, and m_PBndExp.

Referenced by Nektar::SubSteppingExtrapolate::v_SubStepAdvance().

539  {
540  int i,n,cnt;
541  Array<OneD, NekDouble> IProdVnTmp;
542  Array<OneD, Array<OneD, NekDouble> > velbc(m_bnd_dim);
543 
544  for(n = cnt = 0; n < m_PBndConds.num_elements(); ++n)
545  {
546  // High order boundary condition;
547  if(m_hbcType[n] == eHBCNeumann)
548  {
549  for(i = 0; i < m_bnd_dim; ++i)
550  {
551  m_fields[0]->ExtractPhysToBnd(n, Vel[i], velbc[i]);
552  }
553  IProdVnTmp = IProdVn + cnt;
554  m_PBndExp[n]->NormVectorIProductWRTBase(velbc, IProdVnTmp);
555  cnt += m_PBndExp[n]->GetNcoeffs();
556  }
557  else if(m_hbcType[n] == eConvectiveOBC) // skip over conective OBC
558  {
559  cnt += m_PBndExp[n]->GetNcoeffs();
560  }
561  }
562  }
Array< OneD, MultiRegions::ExpListSharedPtr > m_PBndExp
pressure boundary conditions expansion container
Definition: Extrapolate.h:241
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Velocity fields.
Definition: Extrapolate.h:218
int m_bnd_dim
bounday dimensionality
Definition: Extrapolate.h:235
Array< OneD, HBCType > m_hbcType
Array of type of high order BCs for splitting shemes.
Definition: Extrapolate.h:215
Array< OneD, const SpatialDomains::BoundaryConditionShPtr > m_PBndConds
pressure boundary conditions container
Definition: Extrapolate.h:238

◆ MountHOPBCs()

void Nektar::Extrapolate::MountHOPBCs ( int  HBCdata,
NekDouble  kinvis,
Array< OneD, NekDouble > &  Q,
Array< OneD, const NekDouble > &  Advection 
)
inline

Definition at line 391 of file Extrapolate.h.

References v_MountHOPBCs().

Referenced by Nektar::MappingExtrapolate::v_CalcNeumannPressureBCs(), and v_CalcNeumannPressureBCs().

396  {
397  v_MountHOPBCs(HBCdata,kinvis,Q,Advection);
398  }
virtual void v_MountHOPBCs(int HBCdata, NekDouble kinvis, Array< OneD, NekDouble > &Q, Array< OneD, const NekDouble > &Advection)=0

◆ RollOver()

void Nektar::Extrapolate::RollOver ( Array< OneD, Array< OneD, NekDouble > > &  input)
protected

Function to roll time-level storages to the next step layout. The stored data associated with the oldest time-level (not required anymore) are moved to the top, where they will be overwritten as the solution process progresses.

Definition at line 612 of file Extrapolate.cpp.

Referenced by AccelerationBDF(), CalcNeumannPressureBCs(), EvaluateBDFArray(), and ExtrapolateArray().

613  {
614  int nlevels = input.num_elements();
615 
616  Array<OneD, NekDouble> tmp;
617 
618  tmp = input[nlevels-1];
619 
620  for(int n = nlevels-1; n > 0; --n)
621  {
622  input[n] = input[n-1];
623  }
624 
625  input[0] = tmp;
626  }

◆ SubStepAdvance()

void Nektar::Extrapolate::SubStepAdvance ( const LibUtilities::TimeIntegrationSolutionSharedPtr integrationSoln,
const int  nstep,
NekDouble  time 
)
inline

Definition at line 380 of file Extrapolate.h.

References v_SubStepAdvance().

384  {
385  v_SubStepAdvance(integrationSoln,nstep, time);
386  }
virtual void v_SubStepAdvance(const LibUtilities::TimeIntegrationSolutionSharedPtr &integrationSoln, int nstep, NekDouble time)=0

◆ SubSteppingTimeIntegration()

void Nektar::Extrapolate::SubSteppingTimeIntegration ( const int  intMethod,
const LibUtilities::TimeIntegrationWrapperSharedPtr IntegrationScheme 
)
inline

Definition at line 350 of file Extrapolate.h.

References v_SubSteppingTimeIntegration().

353  {
354  v_SubSteppingTimeIntegration(intMethod, IntegrationScheme);
355  }
virtual void v_SubSteppingTimeIntegration(int intMethod, const LibUtilities::TimeIntegrationWrapperSharedPtr &IntegrationScheme)=0

◆ SubStepSaveFields()

void Nektar::Extrapolate::SubStepSaveFields ( const int  nstep)
inline

Definition at line 360 of file Extrapolate.h.

References v_SubStepSaveFields().

362  {
363  v_SubStepSaveFields(nstep);
364  }
virtual void v_SubStepSaveFields(int nstep)=0

◆ SubStepSetPressureBCs()

void Nektar::Extrapolate::SubStepSetPressureBCs ( const Array< OneD, const Array< OneD, NekDouble > > &  inarray,
const NekDouble  Aii_DT,
NekDouble  kinvis 
)
inline

Definition at line 369 of file Extrapolate.h.

References v_SubStepSetPressureBCs().

373  {
374  v_SubStepSetPressureBCs(inarray,Aii_DT,kinvis);
375  }
virtual void v_SubStepSetPressureBCs(const Array< OneD, const Array< OneD, NekDouble > > &inarray, NekDouble Aii_DT, NekDouble kinvis)=0

◆ UpdateRobinPrimCoeff()

void Nektar::Extrapolate::UpdateRobinPrimCoeff ( void  )

Definition at line 830 of file Extrapolate.cpp.

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::eConvectiveOBC, m_curl_dim, m_fields, m_hbcType, m_houtflow, m_intSteps, m_PBndConds, m_pressureCalls, m_session, m_velocity, and StifflyStable_Gamma0_Coeffs.

Referenced by CalcOutflowBCs().

831  {
832 
833  if((m_pressureCalls == 1) || (m_pressureCalls > m_intSteps))
834  {
835  return;
836  }
837 
838  for(int n = 0; n < m_PBndConds.num_elements(); ++n)
839  {
840  // Get expansion with element on this boundary
841  if(m_hbcType[n] == eConvectiveOBC)
842  {
843  for (int i = 0; i < m_curl_dim; ++i)
844  {
845  Array<OneD, SpatialDomains::BoundaryConditionShPtr>
846  UBndConds = m_fields[m_velocity[i]]->UpdateBndConditions();
847 
848  std::string primcoeff = m_houtflow->m_defVelPrimCoeff[i] + "*" +
849  boost::lexical_cast<std::string>(StifflyStable_Gamma0_Coeffs
850  [m_pressureCalls-1]);
851 
853  std::dynamic_pointer_cast<
854  SpatialDomains::RobinBoundaryCondition >(UBndConds[n]);
855 
858  m_session,rcond->m_robinFunction.GetExpression(),
859  primcoeff,
860  rcond->GetUserDefined(),
861  rcond->m_filename);
862 
863  UBndConds[n] = bcond;
864  }
865 
866  }
867  }
868  }
LibUtilities::SessionReaderSharedPtr m_session
Definition: Extrapolate.h:210
Array< OneD, int > m_velocity
int which identifies which components of m_fields contains the velocity (u,v,w);
Definition: Extrapolate.h:225
HighOrderOutflowSharedPtr m_houtflow
Definition: Extrapolate.h:271
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Velocity fields.
Definition: Extrapolate.h:218
static NekDouble StifflyStable_Gamma0_Coeffs[3]
Definition: Extrapolate.h:268
std::shared_ptr< RobinBoundaryCondition > RobinBCShPtr
Definition: Conditions.h:222
Array< OneD, HBCType > m_hbcType
Array of type of high order BCs for splitting shemes.
Definition: Extrapolate.h:215
int m_intSteps
Maximum points used in pressure BC evaluation.
Definition: Extrapolate.h:253
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
int m_pressureCalls
number of times the high-order pressure BCs have been called
Definition: Extrapolate.h:244
std::shared_ptr< BoundaryConditionBase > BoundaryConditionShPtr
Definition: Conditions.h:219
int m_curl_dim
Curl-curl dimensionality.
Definition: Extrapolate.h:232
Array< OneD, const SpatialDomains::BoundaryConditionShPtr > m_PBndConds
pressure boundary conditions container
Definition: Extrapolate.h:238

◆ v_AddNormVelOnOBC()

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

Reimplemented in Nektar::WeakPressureExtrapolate, and Nektar::SubSteppingExtrapolateWeakPressure.

Definition at line 207 of file Extrapolate.cpp.

Referenced by AddNormVelOnOBC(), and CalcNeumannPressureBCs().

209  {
210  }

◆ v_CalcNeumannPressureBCs()

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

Unified routine for calculation high-oder terms

Reimplemented in Nektar::MappingExtrapolate.

Definition at line 126 of file Extrapolate.cpp.

References Nektar::eConvectiveOBC, Nektar::eHBCNeumann, m_bnd_dim, m_curl_dim, m_fields, m_hbcType, m_intSteps, m_PBndConds, m_PBndExp, m_pressureHBCs, and MountHOPBCs().

Referenced by CalcNeumannPressureBCs(), and Nektar::MappingExtrapolate::v_CalcNeumannPressureBCs().

130  {
131  int n, cnt;
132 
133  Array<OneD, NekDouble> Pvals;
134 
135  Array<OneD, Array<OneD, NekDouble> > Velocity(m_curl_dim);
136  Array<OneD, Array<OneD, NekDouble> > Advection(m_bnd_dim);
137 
138  Array<OneD, Array<OneD, NekDouble> > BndValues(m_bnd_dim);
139  Array<OneD, Array<OneD, NekDouble> > Q(m_curl_dim);
140 
142  for(n = cnt = 0; n < m_PBndConds.num_elements(); ++n)
143  {
144  // High order boundary condition;
145  if((m_hbcType[n] == eHBCNeumann)||(m_hbcType[n] == eConvectiveOBC))
146  {
147  m_fields[0]->GetBndElmtExpansion(n, BndElmtExp, false);
148  int nqb = m_PBndExp[n]->GetTotPoints();
149  int nq = BndElmtExp->GetTotPoints();
150 
151  for(int i = 0; i < m_bnd_dim; i++)
152  {
153  BndValues[i] = Array<OneD, NekDouble> (nqb,0.0);
154  }
155 
156  for(int i = 0; i < m_curl_dim; i++)
157  {
158  Q[i] = Array<OneD, NekDouble> (nq,0.0);
159  }
160 
161  // Obtaining fields on BndElmtExp
162  for(int i = 0; i < m_curl_dim; i++)
163  {
164  m_fields[0]->ExtractPhysToBndElmt(n, fields[i],Velocity[i]);
165  }
166 
167  if(N.num_elements()) // not required for some extrapolation
168  {
169  for(int i = 0; i < m_bnd_dim; i++)
170  {
171  m_fields[0]->ExtractPhysToBndElmt(n, N[i], Advection[i]);
172  }
173  }
174 
175  // CurlCurl
176  BndElmtExp->CurlCurl(Velocity, Q);
177 
178  // Mounting advection component into the high-order condition
179  for(int i = 0; i < m_bnd_dim; i++)
180  {
181  MountHOPBCs(nq, kinvis,Q[i],Advection[i]);
182  }
183 
184  Pvals = (m_pressureHBCs[m_intSteps-1]) + cnt;
185 
186  // Getting values on the boundary and filling the pressure bnd
187  // expansion. Multiplication by the normal is required
188  for(int i = 0; i < m_bnd_dim; i++)
189  {
190  m_fields[0]->ExtractElmtToBndPhys(n, Q[i],BndValues[i]);
191  }
192 
193  m_PBndExp[n]->NormVectorIProductWRTBase(BndValues, Pvals);
194 
195  // Get offset for next terms
196  cnt += m_PBndExp[n]->GetNcoeffs();
197  }
198  }
199  }
Array< OneD, MultiRegions::ExpListSharedPtr > m_PBndExp
pressure boundary conditions expansion container
Definition: Extrapolate.h:241
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Velocity fields.
Definition: Extrapolate.h:218
int m_bnd_dim
bounday dimensionality
Definition: Extrapolate.h:235
void MountHOPBCs(int HBCdata, NekDouble kinvis, Array< OneD, NekDouble > &Q, Array< OneD, const NekDouble > &Advection)
Definition: Extrapolate.h:391
Array< OneD, HBCType > m_hbcType
Array of type of high order BCs for splitting shemes.
Definition: Extrapolate.h:215
int m_intSteps
Maximum points used in pressure BC evaluation.
Definition: Extrapolate.h:253
Array< OneD, Array< OneD, NekDouble > > m_pressureHBCs
Storage for current and previous levels of high order pressure boundary conditions.
Definition: Extrapolate.h:258
int m_curl_dim
Curl-curl dimensionality.
Definition: Extrapolate.h:232
Array< OneD, const SpatialDomains::BoundaryConditionShPtr > m_PBndConds
pressure boundary conditions container
Definition: Extrapolate.h:238

◆ v_CorrectPressureBCs()

void Nektar::Extrapolate::v_CorrectPressureBCs ( const Array< OneD, NekDouble > &  pressure)
protectedvirtual

Reimplemented in Nektar::MappingExtrapolate.

Definition at line 202 of file Extrapolate.cpp.

Referenced by CalcNeumannPressureBCs(), and CorrectPressureBCs().

203  {
204  }

◆ v_EvaluatePressureBCs()

virtual void Nektar::Extrapolate::v_EvaluatePressureBCs ( const Array< OneD, const Array< OneD, NekDouble > > &  inarray,
const Array< OneD, const Array< OneD, NekDouble > > &  N,
NekDouble  kinvis 
)
protectedpure virtual

◆ v_GetSubStepIntegrationMethod()

LibUtilities::TimeIntegrationMethod Nektar::Extrapolate::v_GetSubStepIntegrationMethod ( void  )
protectedvirtual

◆ v_MountHOPBCs()

virtual void Nektar::Extrapolate::v_MountHOPBCs ( int  HBCdata,
NekDouble  kinvis,
Array< OneD, NekDouble > &  Q,
Array< OneD, const NekDouble > &  Advection 
)
protectedpure virtual

◆ v_SubStepAdvance()

virtual void Nektar::Extrapolate::v_SubStepAdvance ( const LibUtilities::TimeIntegrationSolutionSharedPtr integrationSoln,
int  nstep,
NekDouble  time 
)
protectedpure virtual

◆ v_SubSteppingTimeIntegration()

virtual void Nektar::Extrapolate::v_SubSteppingTimeIntegration ( int  intMethod,
const LibUtilities::TimeIntegrationWrapperSharedPtr IntegrationScheme 
)
protectedpure virtual

◆ v_SubStepSaveFields()

virtual void Nektar::Extrapolate::v_SubStepSaveFields ( int  nstep)
protectedpure virtual

◆ v_SubStepSetPressureBCs()

virtual void Nektar::Extrapolate::v_SubStepSetPressureBCs ( const Array< OneD, const Array< OneD, NekDouble > > &  inarray,
NekDouble  Aii_DT,
NekDouble  kinvis 
)
protectedpure virtual

Member Data Documentation

◆ def

std::string Nektar::Extrapolate::def
staticprivate
Initial value:
=
"StandardExtrapolate", "StandardExtrapolate")

Definition at line 274 of file Extrapolate.h.

Referenced by ~Extrapolate().

◆ m_advObject

SolverUtils::AdvectionSharedPtr Nektar::Extrapolate::m_advObject
protected

Definition at line 227 of file Extrapolate.h.

Referenced by Nektar::SubSteppingExtrapolate::SubStepAdvection().

◆ m_bnd_dim

int Nektar::Extrapolate::m_bnd_dim
protected

◆ m_comm

LibUtilities::CommSharedPtr Nektar::Extrapolate::m_comm
protected

◆ m_curl_dim

int Nektar::Extrapolate::m_curl_dim
protected

◆ m_fields

Array<OneD, MultiRegions::ExpListSharedPtr> Nektar::Extrapolate::m_fields
protected

◆ m_HBCnumber

int Nektar::Extrapolate::m_HBCnumber
protected

◆ m_hbcType

Array<OneD, HBCType> Nektar::Extrapolate::m_hbcType
protected

◆ m_houtflow

HighOrderOutflowSharedPtr Nektar::Extrapolate::m_houtflow
protected

◆ m_intSteps

int Nektar::Extrapolate::m_intSteps
protected

◆ m_iprodnormvel

Array<OneD, Array<OneD, NekDouble> > Nektar::Extrapolate::m_iprodnormvel
protected

Storage for current and previous levels of the inner product of normal velocity.

Definition at line 261 of file Extrapolate.h.

Referenced by AddDuDt(), AddVelBC(), GenerateHOPBCMap(), Nektar::MappingExtrapolate::v_CalcNeumannPressureBCs(), and Nektar::SubSteppingExtrapolate::v_SubStepAdvance().

◆ m_numHBCDof

int Nektar::Extrapolate::m_numHBCDof
protected

◆ m_PBndConds

Array<OneD, const SpatialDomains::BoundaryConditionShPtr> Nektar::Extrapolate::m_PBndConds
protected

◆ m_PBndExp

Array<OneD, MultiRegions::ExpListSharedPtr> Nektar::Extrapolate::m_PBndExp
protected

◆ m_pressure

MultiRegions::ExpListSharedPtr Nektar::Extrapolate::m_pressure
protected

Pointer to field holding pressure field.

Definition at line 221 of file Extrapolate.h.

Referenced by AddPressureToOutflowBCs(), GenerateHOPBCMap(), and Nektar::MappingExtrapolate::v_CorrectPressureBCs().

◆ m_pressureCalls

int Nektar::Extrapolate::m_pressureCalls
protected

◆ m_pressureHBCs

Array<OneD, Array<OneD, NekDouble> > Nektar::Extrapolate::m_pressureHBCs
protected

◆ m_previousVelFields

Array<OneD, Array<OneD, NekDouble> > Nektar::Extrapolate::m_previousVelFields
protected

Definition at line 229 of file Extrapolate.h.

◆ m_session

LibUtilities::SessionReaderSharedPtr Nektar::Extrapolate::m_session
protected

◆ m_timestep

NekDouble Nektar::Extrapolate::m_timestep
protected

◆ m_traceNormals

Array<OneD, Array<OneD, NekDouble> > Nektar::Extrapolate::m_traceNormals
protected

◆ m_velocity

Array<OneD, int> Nektar::Extrapolate::m_velocity
protected

◆ StifflyStable_Alpha_Coeffs

NekDouble Nektar::Extrapolate::StifflyStable_Alpha_Coeffs
staticprotected
Initial value:
= {
{ 1.0, 0.0, 0.0},{ 2.0, -0.5, 0.0},{ 3.0, -1.5, 1.0/3.0}}

Definition at line 267 of file Extrapolate.h.

Referenced by AccelerationBDF(), and EvaluateBDFArray().

◆ StifflyStable_Betaq_Coeffs

NekDouble Nektar::Extrapolate::StifflyStable_Betaq_Coeffs
staticprotected
Initial value:
= {
{ 1.0, 0.0, 0.0},{ 2.0, -1.0, 0.0},{ 3.0, -3.0, 1.0}}

Definition at line 266 of file Extrapolate.h.

Referenced by ExtrapolateArray().

◆ StifflyStable_Gamma0_Coeffs

NekDouble Nektar::Extrapolate::StifflyStable_Gamma0_Coeffs
staticprotected
Initial value:
= {
1.0, 1.5, 11.0/6.0}

Definition at line 268 of file Extrapolate.h.

Referenced by AccelerationBDF(), AddVelBC(), and UpdateRobinPrimCoeff().