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

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

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
 
std::vector< SolverUtils::ForcingSharedPtrm_forcing
 
Array< OneD, Array< OneD, NekDouble > > m_previousVelFields
 
int m_curl_dim
 Curl-curl dimensionality. More...
 
int m_bnd_dim
 bounday dimensionality More...
 
Array< OneD, const SpatialDomains::BoundaryConditionShPtrm_PBndConds
 pressure boundary conditions container More...
 
Array< OneD, MultiRegions::ExpListSharedPtrm_PBndExp
 pressure boundary conditions expansion container More...
 
int m_pressureCalls
 number of times the high-order pressure BCs have been called More...
 
int m_numHBCDof
 
int m_HBCnumber
 
int m_intSteps
 Maximum points used in pressure BC evaluation. More...
 
NekDouble m_timestep
 
Array< OneD, Array< OneD, NekDouble > > m_pressureHBCs
 Storage for current and previous levels of high order pressure boundary conditions. More...
 
Array< OneD, Array< OneD, NekDouble > > m_iprodnormvel
 Storage for current and previous levels of the inner product of normal velocity. More...
 
Array< OneD, Array< OneD, NekDouble > > m_traceNormals
 
HighOrderOutflowSharedPtr m_houtflow
 

Static Protected Attributes

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}
 

Static Private Attributes

static std::string def
 

Detailed Description

Definition at line 73 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 54 of file Extrapolate.cpp.

59 : m_session(pSession), m_fields(pFields), m_pressure(pPressure),
60 m_velocity(pVel), m_advObject(advObject)
61{
62 m_session->LoadParameter("TimeStep", m_timestep, 0.01);
63 m_comm = m_session->GetComm();
64}
MultiRegions::ExpListSharedPtr m_pressure
Pointer to field holding pressure field.
Definition: Extrapolate.h:202
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Velocity fields.
Definition: Extrapolate.h:199
NekDouble m_timestep
Definition: Extrapolate.h:238
SolverUtils::AdvectionSharedPtr m_advObject
Definition: Extrapolate.h:208
Array< OneD, int > m_velocity
int which identifies which components of m_fields contains the velocity (u,v,w);
Definition: Extrapolate.h:206
LibUtilities::SessionReaderSharedPtr m_session
Definition: Extrapolate.h:191
LibUtilities::CommSharedPtr m_comm
Definition: Extrapolate.h:193

References m_comm, m_session, and m_timestep.

◆ ~Extrapolate()

Nektar::Extrapolate::~Extrapolate ( )
virtual

Definition at line 66 of file Extrapolate.cpp.

67{
68}

Member Function Documentation

◆ AddDuDt()

void Nektar::Extrapolate::AddDuDt ( void  )

Definition at line 77 of file Extrapolate.cpp.

78{
79 if (m_numHBCDof)
80 {
81 // Update velocity BF at n+1 (actually only needs doing if
82 // velocity is time dependent on HBCs)
84
85 // Calculate acceleration term at level n based on previous steps
87
88 // Subtract acceleration term off m_pressureHBCs[nlevels-1]
90 1, m_pressureHBCs[m_intSteps - 1], 1,
92 }
93}
Array< OneD, Array< OneD, NekDouble > > m_pressureHBCs
Storage for current and previous levels of high order pressure boundary conditions.
Definition: Extrapolate.h:242
virtual void v_AccelerationBDF(Array< OneD, Array< OneD, NekDouble > > &array)
void IProductNormVelocityBCOnHBC(Array< OneD, NekDouble > &IprodVn)
Array< OneD, Array< OneD, NekDouble > > m_iprodnormvel
Storage for current and previous levels of the inner product of normal velocity.
Definition: Extrapolate.h:246
int m_intSteps
Maximum points used in pressure BC evaluation.
Definition: Extrapolate.h:236
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:617

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

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

◆ AddNormVelOnOBC()

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

Definition at line 405 of file Extrapolate.h.

407{
408 v_AddNormVelOnOBC(nbcoeffs, nreg, u);
409}
virtual void v_AddNormVelOnOBC(const int nbcoeffs, const int nreg, Array< OneD, Array< OneD, NekDouble > > &u)

References v_AddNormVelOnOBC().

Referenced by CalcOutflowBCs().

◆ AddPressureToOutflowBCs()

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

Definition at line 465 of file Extrapolate.cpp.

466{
467 if (!m_houtflow.get())
468 {
469 return;
470 }
471
472 for (size_t n = 0; n < m_PBndConds.size(); ++n)
473 {
474 if (m_hbcType[n] == eConvectiveOBC)
475 {
476 int nqb = m_PBndExp[n]->GetTotPoints();
477 int ncb = m_PBndExp[n]->GetNcoeffs();
478
479 m_pressure->FillBndCondFromField(n, m_pressure->GetCoeffs());
480 Array<OneD, NekDouble> pbc(nqb);
481
482 m_PBndExp[n]->BwdTrans(m_PBndExp[n]->GetCoeffs(), pbc);
483
484 if (m_PBndExp[n]->GetWaveSpace())
485 {
486 m_PBndExp[n]->HomogeneousBwdTrans(nqb, pbc, pbc);
487 }
488
489 Array<OneD, NekDouble> wk(nqb);
490 Array<OneD, NekDouble> wk1(ncb);
491
492 // Get normal vector
493 Array<OneD, Array<OneD, NekDouble>> normals;
494 m_fields[0]->GetBoundaryNormals(n, normals);
495
496 // Add 1/kinvis * (pbc n )
497 for (int i = 0; i < m_curl_dim; ++i)
498 {
499 Vmath::Vmul(nqb, normals[i], 1, pbc, 1, wk, 1);
500
501 Vmath::Smul(nqb, 1.0 / kinvis, wk, 1, wk, 1);
502
503 if (m_houtflow->m_UBndExp[i][n]->GetWaveSpace())
504 {
505 m_houtflow->m_UBndExp[i][n]->HomogeneousFwdTrans(nqb, wk,
506 wk);
507 }
508 m_houtflow->m_UBndExp[i][n]->IProductWRTBase(wk, wk1);
509
510 Vmath::Vadd(ncb, wk1, 1,
511 m_houtflow->m_UBndExp[i][n]->GetCoeffs(), 1,
512 m_houtflow->m_UBndExp[i][n]->UpdateCoeffs(), 1);
513 }
514 }
515 }
516}
int m_curl_dim
Curl-curl dimensionality.
Definition: Extrapolate.h:215
Array< OneD, HBCType > m_hbcType
Array of type of high order BCs for splitting shemes.
Definition: Extrapolate.h:196
HighOrderOutflowSharedPtr m_houtflow
Definition: Extrapolate.h:256
Array< OneD, MultiRegions::ExpListSharedPtr > m_PBndExp
pressure boundary conditions expansion container
Definition: Extrapolate.h:224
Array< OneD, const SpatialDomains::BoundaryConditionShPtr > m_PBndConds
pressure boundary conditions container
Definition: Extrapolate.h:221
@ eConvectiveOBC
Definition: Extrapolate.h:55
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:207
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:354
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:245

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

◆ AddVelBC()

void Nektar::Extrapolate::AddVelBC ( void  )

Definition at line 98 of file Extrapolate.cpp.

99{
100 if (m_numHBCDof)
101 {
102 int order = std::min(m_pressureCalls, m_intSteps);
103
104 // Update velocity BF at n+1 (actually only needs doing if
105 // velocity is time dependent on HBCs)
107
108 // Subtract acceleration term off m_pressureHBCs[nlevels-1]
110 -1.0 * StifflyStable_Gamma0_Coeffs[order - 1] / m_timestep,
112 m_pressureHBCs[m_intSteps - 1], 1);
113 }
114}
int m_pressureCalls
number of times the high-order pressure BCs have been called
Definition: Extrapolate.h:227
static NekDouble StifflyStable_Gamma0_Coeffs[3]
Definition: Extrapolate.h:253

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

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

◆ 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 170 of file Extrapolate.h.

173 {
174 v_CalcNeumannPressureBCs(fields, N, kinvis);
175 }
virtual void v_CalcNeumannPressureBCs(const Array< OneD, const Array< OneD, NekDouble > > &fields, const Array< OneD, const Array< OneD, NekDouble > > &N, NekDouble kinvis)

References v_CalcNeumannPressureBCs().

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

◆ CalcOutflowBCs()

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

Definition at line 208 of file Extrapolate.cpp.

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

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 Nektar::ImplicitExtrapolate::v_EvaluatePressureBCs(), Nektar::StandardExtrapolate::v_EvaluatePressureBCs(), Nektar::WeakPressureExtrapolate::v_EvaluatePressureBCs(), Nektar::SubSteppingExtrapolate::v_SubStepSetPressureBCs(), and Nektar::SubSteppingExtrapolateWeakPressure::v_SubStepSetPressureBCs().

◆ CopyPressureHBCsToPbndExp()

void Nektar::Extrapolate::CopyPressureHBCsToPbndExp ( void  )

Definition at line 1039 of file Extrapolate.cpp.

1040{
1041 size_t n, cnt;
1042 for (cnt = n = 0; n < m_PBndConds.size(); ++n)
1043 {
1044 if ((m_hbcType[n] == eHBCNeumann) || (m_hbcType[n] == eConvectiveOBC))
1045 {
1046 int nq = m_PBndExp[n]->GetNcoeffs();
1047 Vmath::Vcopy(nq, &(m_pressureHBCs[m_intSteps - 1])[cnt], 1,
1048 &(m_PBndExp[n]->UpdateCoeffs()[0]), 1);
1049 cnt += nq;
1050 }
1051 }
1052}
@ eHBCNeumann
Definition: Extrapolate.h:53
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1191

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

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

◆ CorrectPressureBCs()

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

Definition at line 396 of file Extrapolate.h.

398{
400}
virtual void v_CorrectPressureBCs(const Array< OneD, NekDouble > &pressure)

References CG_Iterations::pressure, and v_CorrectPressureBCs().

◆ 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 984 of file Extrapolate.cpp.

985{
986 int nint = min(m_pressureCalls, m_intSteps);
987 int nlevels = array.size();
988 int nPts = array[0].size();
989
990 // Update array
991 RollOver(array);
992
993 // Extrapolate to outarray
994 Vmath::Smul(nPts, StifflyStable_Alpha_Coeffs[nint - 1][nint - 1],
995 array[nint - 1], 1, array[nlevels - 1], 1);
996
997 for (int n = 0; n < nint - 1; ++n)
998 {
999 Vmath::Svtvp(nPts, StifflyStable_Alpha_Coeffs[nint - 1][n], array[n], 1,
1000 array[nlevels - 1], 1, array[nlevels - 1], 1);
1001 }
1002}
static NekDouble StifflyStable_Alpha_Coeffs[3][3]
Definition: Extrapolate.h:252
void RollOver(Array< OneD, Array< OneD, NekDouble > > &input)

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

◆ 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 324 of file Extrapolate.h.

327{
328 v_EvaluatePressureBCs(inarray, N, kinvis);
329}
virtual void v_EvaluatePressureBCs(const Array< OneD, const Array< OneD, NekDouble > > &inarray, const Array< OneD, const Array< OneD, NekDouble > > &N, NekDouble kinvis)=0

References v_EvaluatePressureBCs().

◆ 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 958 of file Extrapolate.cpp.

959{
960 int nint = min(m_pressureCalls, m_intSteps);
961 int nlevels = array.size();
962 int nPts = array[0].size();
963
964 // Update array
965 RollOver(array);
966
967 // Extrapolate to outarray
968 Vmath::Smul(nPts, StifflyStable_Betaq_Coeffs[nint - 1][nint - 1],
969 array[nint - 1], 1, array[nlevels - 1], 1);
970
971 for (int n = 0; n < nint - 1; ++n)
972 {
973 Vmath::Svtvp(nPts, StifflyStable_Betaq_Coeffs[nint - 1][n], array[n], 1,
974 array[nlevels - 1], 1, array[nlevels - 1], 1);
975 }
976}
static NekDouble StifflyStable_Betaq_Coeffs[3][3]
Definition: Extrapolate.h:251

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

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

◆ 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 616 of file Extrapolate.cpp.

618{
619 m_PBndConds = m_pressure->GetBndConditions();
620 m_PBndExp = m_pressure->GetBndCondExpansions();
621
622 size_t cnt, n;
623
624 // Storage array for high order pressure BCs
625 m_pressureHBCs = Array<OneD, Array<OneD, NekDouble>>(m_intSteps);
626 m_iprodnormvel = Array<OneD, Array<OneD, NekDouble>>(m_intSteps + 1);
627
628 // Get useful values for HOBCs
629 m_HBCnumber = 0;
630 m_numHBCDof = 0;
631
632 int outHBCnumber = 0;
633 int numOutHBCPts = 0;
634
635 m_hbcType = Array<OneD, HBCType>(m_PBndConds.size(), eNOHBC);
636 for (n = 0; n < m_PBndConds.size(); ++n)
637 {
638 // High order boundary Neumann Condiiton
639 if (boost::iequals(m_PBndConds[n]->GetUserDefined(), "H"))
640 {
642 m_numHBCDof += m_PBndExp[n]->GetNcoeffs();
643 m_HBCnumber += m_PBndExp[n]->GetExpSize();
644 }
645
646 // High order outflow convective condition
647 if (m_PBndConds[n]->GetBoundaryConditionType() ==
649 boost::iequals(m_PBndConds[n]->GetUserDefined(), "HOutflow"))
650 {
652 m_numHBCDof += m_PBndExp[n]->GetNcoeffs();
653 m_HBCnumber += m_PBndExp[n]->GetExpSize();
654 numOutHBCPts += m_PBndExp[n]->GetTotPoints();
655 outHBCnumber++;
656 }
657 // High order outflow boundary condition;
658 else if (boost::iequals(m_PBndConds[n]->GetUserDefined(), "HOutflow"))
659 {
660 m_hbcType[n] = eOBC;
661 numOutHBCPts += m_PBndExp[n]->GetTotPoints();
662 outHBCnumber++;
663 }
664 }
665
666 m_iprodnormvel[0] = Array<OneD, NekDouble>(m_numHBCDof, 0.0);
667 for (int n = 0; n < m_intSteps; ++n)
668 {
669 m_pressureHBCs[n] = Array<OneD, NekDouble>(m_numHBCDof, 0.0);
670 m_iprodnormvel[n + 1] = Array<OneD, NekDouble>(m_numHBCDof, 0.0);
671 }
672
673 m_pressureCalls = 0;
674
675 switch (m_pressure->GetExpType())
676 {
678 {
679 m_curl_dim = 2;
680 m_bnd_dim = 2;
681 }
682 break;
684 {
685 m_curl_dim = 3;
686 m_bnd_dim = 2;
687 }
688 break;
690 {
691 m_curl_dim = 3;
692 m_bnd_dim = 1;
693 }
694 break;
696 {
697 m_curl_dim = 3;
698 m_bnd_dim = 3;
699 }
700 break;
701 default:
702 ASSERTL0(0, "Dimension not supported");
703 break;
704 }
705
706 // Initialise storage for outflow HOBCs
707 if (numOutHBCPts > 0)
708 {
710 numOutHBCPts, outHBCnumber, m_curl_dim, pSession);
711
713
714 // set up boundary expansions link
715 for (int i = 0; i < m_curl_dim; ++i)
716 {
717 m_houtflow->m_UBndExp[i] =
718 m_fields[m_velocity[i]]->GetBndCondExpansions();
719 }
720
721 for (n = 0, cnt = 0; n < m_PBndConds.size(); ++n)
722 {
723 if (boost::iequals(m_PBndConds[n]->GetUserDefined(), "HOutflow"))
724 {
725 m_houtflow->m_outflowVel[cnt] =
726 Array<OneD, Array<OneD, Array<OneD, NekDouble>>>(
727 m_curl_dim);
728
729 m_houtflow->m_outflowVelBnd[cnt] =
730 Array<OneD, Array<OneD, Array<OneD, NekDouble>>>(
731 m_curl_dim);
732
733 m_fields[0]->GetBndElmtExpansion(n, BndElmtExp, false);
734 int nqb = m_PBndExp[n]->GetTotPoints();
735 int nq = BndElmtExp->GetTotPoints();
736 for (int j = 0; j < m_curl_dim; ++j)
737 {
738 m_houtflow->m_outflowVel[cnt][j] =
739 Array<OneD, Array<OneD, NekDouble>>(m_intSteps);
740
741 m_houtflow->m_outflowVelBnd[cnt][j] =
742 Array<OneD, Array<OneD, NekDouble>>(m_intSteps);
743
744 for (int k = 0; k < m_intSteps; ++k)
745 {
746 m_houtflow->m_outflowVel[cnt][j][k] =
747 Array<OneD, NekDouble>(nq, 0.0);
748 m_houtflow->m_outflowVelBnd[cnt][j][k] =
749 Array<OneD, NekDouble>(nqb, 0.0);
750 }
751 }
752 cnt++;
753 }
754
755 // evaluate convective primitive coefficient if
756 // convective OBCs are used
757 if (m_hbcType[n] == eConvectiveOBC)
758 {
759 // initialise convective members of
760 // HighOrderOutflow struct
761 if (m_houtflow->m_pressurePrimCoeff.size() == 0)
762 {
763 m_houtflow->m_pressurePrimCoeff =
764 Array<OneD, NekDouble>(m_PBndConds.size(), 0.0);
765 m_houtflow->m_velocityPrimCoeff =
766 Array<OneD, Array<OneD, NekDouble>>(m_curl_dim);
767
768 for (int i = 0; i < m_curl_dim; ++i)
769 {
770 m_houtflow->m_velocityPrimCoeff[i] =
771 Array<OneD, NekDouble>(m_PBndConds.size(), 0.0);
772 }
773 }
774
775 LibUtilities::Equation coeff =
776 std::static_pointer_cast<
777 SpatialDomains::RobinBoundaryCondition>(m_PBndConds[n])
778 ->m_robinPrimitiveCoeff;
779
780 // checkout equation evaluation options!!
781 m_houtflow->m_pressurePrimCoeff[n] = coeff.Evaluate();
782
783 for (int i = 0; i < m_curl_dim; ++i)
784 {
785 Array<OneD, const SpatialDomains::BoundaryConditionShPtr>
786 UBndConds = m_fields[m_velocity[i]]->GetBndConditions();
787
788 LibUtilities::Equation coeff1 =
789 std::static_pointer_cast<
790 SpatialDomains::RobinBoundaryCondition>(
791 UBndConds[n])
792 ->m_robinPrimitiveCoeff;
793
794 m_houtflow->m_defVelPrimCoeff[i] = coeff1.GetExpression();
795
796 ASSERTL1(UBndConds[n]->GetBoundaryConditionType() ==
798 "Require Velocity "
799 "conditions to be of Robin type when pressure"
800 "outflow is specticied as Robin Boundary type");
801
802 // checkout equation evaluation options!!
803 m_houtflow->m_velocityPrimCoeff[i][n] = coeff1.Evaluate();
804 }
805 }
806 }
807 }
808}
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:215
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
Definition: ErrorUtil.hpp:249
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
@ eNOHBC
Definition: Extrapolate.h:52

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.

◆ GetMaxStdVelocity()

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

Definition at line 852 of file Extrapolate.cpp.

854{
855 // Checking if the problem is 2D
856 ASSERTL0(m_curl_dim >= 2, "Method not implemented for 1D");
857
858 size_t n_points_0 = m_fields[0]->GetExp(0)->GetTotPoints();
859 size_t n_element = m_fields[0]->GetExpSize();
860 size_t nvel = inarray.size();
861 size_t cnt;
862
863 NekDouble pntVelocity;
864
865 // Getting the standard velocity vector
866 Array<OneD, Array<OneD, NekDouble>> stdVelocity(nvel);
867 Array<OneD, NekDouble> tmp;
868 Array<OneD, NekDouble> maxV(n_element, 0.0);
870
871 for (size_t i = 0; i < nvel; ++i)
872 {
873 stdVelocity[i] = Array<OneD, NekDouble>(n_points_0);
874 }
875
876 cnt = 0.0;
877 for (size_t el = 0; el < n_element; ++el)
878 {
879 size_t n_points = m_fields[0]->GetExp(el)->GetTotPoints();
880 ptsKeys = m_fields[0]->GetExp(el)->GetPointsKeys();
881
882 // reset local space
883 if (n_points != n_points_0)
884 {
885 for (size_t j = 0; j < nvel; ++j)
886 {
887 stdVelocity[j] = Array<OneD, NekDouble>(n_points, 0.0);
888 }
889 n_points_0 = n_points;
890 }
891 else
892 {
893 for (size_t j = 0; j < nvel; ++j)
894 {
895 Vmath::Zero(n_points, stdVelocity[j], 1);
896 }
897 }
898
899 Array<TwoD, const NekDouble> gmat = m_fields[0]
900 ->GetExp(el)
901 ->GetGeom()
902 ->GetMetricInfo()
903 ->GetDerivFactors(ptsKeys);
904
905 if (m_fields[0]->GetExp(el)->GetGeom()->GetMetricInfo()->GetGtype() ==
907 {
908 for (size_t j = 0; j < nvel; ++j)
909 {
910 for (size_t k = 0; k < nvel; ++k)
911 {
912 Vmath::Vvtvp(n_points, gmat[k * nvel + j], 1,
913 tmp = inarray[k] + cnt, 1, stdVelocity[j], 1,
914 stdVelocity[j], 1);
915 }
916 }
917 }
918 else
919 {
920 for (size_t j = 0; j < nvel; ++j)
921 {
922 for (size_t k = 0; k < nvel; ++k)
923 {
924 Vmath::Svtvp(n_points, gmat[k * nvel + j][0],
925 tmp = inarray[k] + cnt, 1, stdVelocity[j], 1,
926 stdVelocity[j], 1);
927 }
928 }
929 }
930 cnt += n_points;
931
932 // Calculate total velocity in stdVelocity[0]
933 Vmath::Vmul(n_points, stdVelocity[0], 1, stdVelocity[0], 1,
934 stdVelocity[0], 1);
935 for (size_t k = 1; k < nvel; ++k)
936 {
937 Vmath::Vvtvp(n_points, stdVelocity[k], 1, stdVelocity[k], 1,
938 stdVelocity[0], 1, stdVelocity[0], 1);
939 }
940 pntVelocity = Vmath::Vmax(n_points, stdVelocity[0], 1);
941 maxV[el] = sqrt(pntVelocity);
942 }
943
944 return maxV;
945}
std::vector< PointsKey > PointsKeyVector
Definition: Points.h:236
@ eDeformed
Geometry is curved or has non-constant factors.
void Zero(int n, T *x, const int incx)
Zero vector.
Definition: Vmath.cpp:487
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:940
scalarT< T > sqrt(scalarT< T > in)
Definition: scalar.hpp:294

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

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

◆ GetSubStepName()

std::string Nektar::Extrapolate::GetSubStepName ( void  )
inline

Definition at line 388 of file Extrapolate.h.

389{
390 return v_GetSubStepName();
391}
virtual std::string v_GetSubStepName(void)

References v_GetSubStepName().

◆ IProductNormVelocityBCOnHBC()

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

Definition at line 547 of file Extrapolate.cpp.

548{
549
550 if (!m_HBCnumber)
551 {
552 return;
553 }
554 int i;
555 size_t n, cnt;
556 Array<OneD, NekDouble> IProdVnTmp;
557 Array<OneD, Array<OneD, NekDouble>> velbc(m_bnd_dim);
558 Array<OneD, Array<OneD, MultiRegions::ExpListSharedPtr>> VelBndExp(
559 m_bnd_dim);
560 for (i = 0; i < m_bnd_dim; ++i)
561 {
562 VelBndExp[i] = m_fields[m_velocity[i]]->GetBndCondExpansions();
563 }
564
565 for (n = cnt = 0; n < m_PBndConds.size(); ++n)
566 {
567 // High order boundary condition;
568 if (m_hbcType[n] == eHBCNeumann)
569 {
570 for (i = 0; i < m_bnd_dim; ++i)
571 {
572 velbc[i] = Array<OneD, NekDouble>(
573 VelBndExp[i][n]->GetTotPoints(), 0.0);
574 VelBndExp[i][n]->SetWaveSpace(
575 m_fields[m_velocity[i]]->GetWaveSpace());
576 VelBndExp[i][n]->BwdTrans(VelBndExp[i][n]->GetCoeffs(),
577 velbc[i]);
578 }
579 IProdVnTmp = IProdVn + cnt;
580 m_PBndExp[n]->NormVectorIProductWRTBase(velbc, IProdVnTmp);
581 cnt += m_PBndExp[n]->GetNcoeffs();
582 }
583 else if (m_hbcType[n] == eConvectiveOBC)
584 {
585 // skip over convective OBC
586 cnt += m_PBndExp[n]->GetNcoeffs();
587 }
588 }
589}

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

◆ IProductNormVelocityOnHBC()

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

Definition at line 518 of file Extrapolate.cpp.

521{
522 int i;
523 size_t n, cnt;
524 Array<OneD, NekDouble> IProdVnTmp;
525 Array<OneD, Array<OneD, NekDouble>> velbc(m_bnd_dim);
526
527 for (n = cnt = 0; n < m_PBndConds.size(); ++n)
528 {
529 // High order boundary condition;
530 if (m_hbcType[n] == eHBCNeumann)
531 {
532 for (i = 0; i < m_bnd_dim; ++i)
533 {
534 m_fields[0]->ExtractPhysToBnd(n, Vel[i], velbc[i]);
535 }
536 IProdVnTmp = IProdVn + cnt;
537 m_PBndExp[n]->NormVectorIProductWRTBase(velbc, IProdVnTmp);
538 cnt += m_PBndExp[n]->GetNcoeffs();
539 }
540 else if (m_hbcType[n] == eConvectiveOBC) // skip over conective OBC
541 {
542 cnt += m_PBndExp[n]->GetNcoeffs();
543 }
544 }
545}

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

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

◆ MountHOPBCs()

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

Definition at line 378 of file Extrapolate.h.

381{
382 v_MountHOPBCs(HBCdata, kinvis, Q, Advection);
383}
virtual void v_MountHOPBCs(int HBCdata, NekDouble kinvis, Array< OneD, NekDouble > &Q, Array< OneD, const NekDouble > &Advection)=0

References v_MountHOPBCs().

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

◆ 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 597 of file Extrapolate.cpp.

598{
599 int nlevels = input.size();
600
601 Array<OneD, NekDouble> tmp;
602
603 tmp = input[nlevels - 1];
604
605 for (int n = nlevels - 1; n > 0; --n)
606 {
607 input[n] = input[n - 1];
608 }
609
610 input[0] = tmp;
611}

Referenced by EvaluateBDFArray(), ExtrapolateArray(), v_AccelerationBDF(), and Nektar::StandardExtrapolate::v_AccelerationBDF().

◆ SetForcing()

void Nektar::Extrapolate::SetForcing ( const std::vector< SolverUtils::ForcingSharedPtr > &  forcing)
inline

Definition at line 351 of file Extrapolate.h.

353{
354 m_forcing = forcing;
355}
std::vector< SolverUtils::ForcingSharedPtr > m_forcing
Definition: Extrapolate.h:210

References m_forcing.

◆ SubStepAdvance()

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

Definition at line 370 of file Extrapolate.h.

371{
372 v_SubStepAdvance(nstep, time);
373}
virtual void v_SubStepAdvance(int nstep, NekDouble time)=0

References v_SubStepAdvance().

◆ SubSteppingTimeIntegration()

void Nektar::Extrapolate::SubSteppingTimeIntegration ( const LibUtilities::TimeIntegrationSchemeSharedPtr IntegrationScheme)
inline

Definition at line 334 of file Extrapolate.h.

336{
337 v_SubSteppingTimeIntegration(IntegrationScheme);
338}
virtual void v_SubSteppingTimeIntegration(const LibUtilities::TimeIntegrationSchemeSharedPtr &IntegrationScheme)=0

References v_SubSteppingTimeIntegration().

◆ SubStepSaveFields()

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

Definition at line 343 of file Extrapolate.h.

344{
345 v_SubStepSaveFields(nstep);
346}
virtual void v_SubStepSaveFields(int nstep)=0

References v_SubStepSaveFields().

◆ SubStepSetPressureBCs()

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

Definition at line 360 of file Extrapolate.h.

363{
364 v_SubStepSetPressureBCs(inarray, Aii_DT, kinvis);
365}
virtual void v_SubStepSetPressureBCs(const Array< OneD, const Array< OneD, NekDouble > > &inarray, NekDouble Aii_DT, NekDouble kinvis)=0

References v_SubStepSetPressureBCs().

◆ UpdateRobinPrimCoeff()

void Nektar::Extrapolate::UpdateRobinPrimCoeff ( void  )

Definition at line 810 of file Extrapolate.cpp.

811{
812
814 {
815 return;
816 }
817
818 for (size_t n = 0; n < m_PBndConds.size(); ++n)
819 {
820 // Get expansion with element on this boundary
821 if (m_hbcType[n] == eConvectiveOBC)
822 {
823 for (int i = 0; i < m_curl_dim; ++i)
824 {
825 Array<OneD, SpatialDomains::BoundaryConditionShPtr> UBndConds =
826 m_fields[m_velocity[i]]->UpdateBndConditions();
827
828 std::string primcoeff =
829 m_houtflow->m_defVelPrimCoeff[i] + "*" +
830 boost::lexical_cast<std::string>(
832
833 SpatialDomains::RobinBCShPtr rcond = std::dynamic_pointer_cast<
834 SpatialDomains::RobinBoundaryCondition>(UBndConds[n]);
835
839 m_session, rcond->m_robinFunction.GetExpression(),
840 primcoeff, rcond->GetUserDefined(),
841 rcond->m_filename);
842
843 UBndConds[n] = bcond;
844 }
845 }
846 }
847}
std::shared_ptr< BoundaryConditionBase > BoundaryConditionShPtr
Definition: Conditions.h:212
std::shared_ptr< RobinBoundaryCondition > RobinBCShPtr
Definition: Conditions.h:215

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

◆ v_AccelerationBDF()

void Nektar::Extrapolate::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 in Nektar::StandardExtrapolate.

Definition at line 1010 of file Extrapolate.cpp.

1011{
1012 int nlevels = array.size();
1013 int nPts = array[0].size();
1014
1015 if (nPts)
1016 {
1017 // Update array
1018 RollOver(array);
1019
1020 // Calculate acceleration using Backward Differentiation Formula
1021 Array<OneD, NekDouble> accelerationTerm(nPts, 0.0);
1022 if (m_pressureCalls > 2)
1023 {
1024 int acc_order = min(m_pressureCalls - 2, m_intSteps);
1025 Vmath::Smul(nPts, StifflyStable_Gamma0_Coeffs[acc_order - 1],
1026 array[0], 1, accelerationTerm, 1);
1027
1028 for (int i = 0; i < acc_order; i++)
1029 {
1031 nPts, -1 * StifflyStable_Alpha_Coeffs[acc_order - 1][i],
1032 array[i + 1], 1, accelerationTerm, 1, accelerationTerm, 1);
1033 }
1034 }
1035 array[nlevels - 1] = accelerationTerm;
1036 }
1037}

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

Referenced by AddDuDt().

◆ v_AddNormVelOnOBC()

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

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

Definition at line 202 of file Extrapolate.cpp.

204{
205 boost::ignore_unused(nbcoeffs, nreg, u);
206}

Referenced by AddNormVelOnOBC().

◆ 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 119 of file Extrapolate.cpp.

122{
123 size_t n, cnt;
124
125 Array<OneD, NekDouble> Pvals;
126
127 Array<OneD, Array<OneD, NekDouble>> Velocity(m_curl_dim);
128 Array<OneD, Array<OneD, NekDouble>> Advection(m_bnd_dim);
129
130 Array<OneD, Array<OneD, NekDouble>> BndValues(m_bnd_dim);
131 Array<OneD, Array<OneD, NekDouble>> Q(m_curl_dim);
132
133 // Loop all boundary conditions
135 for (n = cnt = 0; n < m_PBndConds.size(); ++n)
136 {
137 // Detect higher order boundary conditions
138 if ((m_hbcType[n] == eHBCNeumann) || (m_hbcType[n] == eConvectiveOBC))
139 {
140 m_fields[0]->GetBndElmtExpansion(n, BndElmtExp, false);
141 int nqb = m_PBndExp[n]->GetTotPoints();
142 int nq = BndElmtExp->GetTotPoints();
143 int ncoeffs = m_PBndExp[n]->GetNcoeffs();
144
145 for (int i = 0; i < m_bnd_dim; i++)
146 {
147 BndValues[i] = Array<OneD, NekDouble>(nqb, 0.0);
148 }
149
150 for (int i = 0; i < m_curl_dim; i++)
151 {
152 Q[i] = Array<OneD, NekDouble>(nq, 0.0);
153 }
154
155 // Obtaining fields on BndElmtExp
156 for (int i = 0; i < m_curl_dim; i++)
157 {
158 m_fields[0]->ExtractPhysToBndElmt(n, fields[i], Velocity[i]);
159 }
160
161 if (N.size()) // not required for some extrapolation
162 {
163 for (int i = 0; i < m_bnd_dim; i++)
164 {
165 m_fields[0]->ExtractPhysToBndElmt(n, N[i], Advection[i]);
166 }
167 }
168
169 // CurlCurl
170 BndElmtExp->CurlCurl(Velocity, Q);
171
172 // Mounting advection component into the high-order condition
173 for (int i = 0; i < m_bnd_dim; i++)
174 {
175 MountHOPBCs(nq, kinvis, Q[i], Advection[i]);
176 }
177
178 Pvals = (m_pressureHBCs[m_intSteps - 1]) + cnt;
179
180 // Getting values on the boundary and filling the pressure bnd
181 // expansion. Multiplication by the normal is required
182 for (int i = 0; i < m_bnd_dim; i++)
183 {
184 m_fields[0]->ExtractElmtToBndPhys(n, Q[i], BndValues[i]);
185 }
186
187 m_PBndExp[n]->NormVectorIProductWRTBase(BndValues, Pvals);
188
189 // Get offset for next terms
190 cnt += ncoeffs;
191 }
192 }
193}
void MountHOPBCs(int HBCdata, NekDouble kinvis, Array< OneD, NekDouble > &Q, Array< OneD, const NekDouble > &Advection)
Definition: Extrapolate.h:378

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

◆ v_CorrectPressureBCs()

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

Reimplemented in Nektar::MappingExtrapolate.

Definition at line 196 of file Extrapolate.cpp.

197{
198 boost::ignore_unused(pressure);
199}

References CG_Iterations::pressure.

Referenced by CorrectPressureBCs().

◆ 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_GetSubStepName()

std::string Nektar::Extrapolate::v_GetSubStepName ( void  )
protectedvirtual

Reimplemented in Nektar::SubSteppingExtrapolate.

Definition at line 947 of file Extrapolate.cpp.

948{
949 return "";
950}

Referenced by GetSubStepName().

◆ 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 ( int  nstep,
NekDouble  time 
)
protectedpure virtual

◆ v_SubSteppingTimeIntegration()

virtual void Nektar::Extrapolate::v_SubSteppingTimeIntegration ( const LibUtilities::TimeIntegrationSchemeSharedPtr 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")
static std::string RegisterDefaultSolverInfo(const std::string &pName, const std::string &pValue)
Registers the default string value of a solver info property.

Definition at line 259 of file Extrapolate.h.

◆ m_advObject

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

Definition at line 208 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_forcing

std::vector<SolverUtils::ForcingSharedPtr> Nektar::Extrapolate::m_forcing
protected

Definition at line 210 of file Extrapolate.h.

Referenced by SetForcing(), and Nektar::SubSteppingExtrapolate::SubStepAdvection().

◆ 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 246 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 202 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 212 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 252 of file Extrapolate.h.

Referenced by EvaluateBDFArray(), and v_AccelerationBDF().

◆ 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 251 of file Extrapolate.h.

Referenced by ExtrapolateArray().

◆ StifflyStable_Gamma0_Coeffs

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

Definition at line 253 of file Extrapolate.h.

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