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

#include <MappingExtrapolate.h>

Inheritance diagram for Nektar::MappingExtrapolate:
[legend]

Public Member Functions

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

Static Public Member Functions

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

Static Public Attributes

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

Protected Attributes

GlobalMapping::MappingSharedPtr m_mapping
 
Array< OneD, NekDoublem_bcCorrection
 
bool m_implicitPressure
 
bool m_implicitViscous
 
NekDouble m_pressureRelaxation
 
- Protected Attributes inherited from Nektar::Extrapolate
LibUtilities::SessionReaderSharedPtr m_session
 
LibUtilities::CommSharedPtr m_comm
 
Array< OneD, HBCTypem_hbcType
 Array of type of high order BCs for splitting shemes. More...
 
Array< OneD, MultiRegions::ExpListSharedPtrm_fields
 Velocity fields. More...
 
MultiRegions::ExpListSharedPtr m_pressure
 Pointer to field holding pressure field. More...
 
Array< OneD, int > m_velocity
 int which identifies which components of m_fields contains the velocity (u,v,w); More...
 
SolverUtils::AdvectionSharedPtr m_advObject
 
std::vector< SolverUtils::ForcingSharedPtrm_forcing
 
Array< OneD, Array< OneD, NekDouble > > m_previousVelFields
 
int m_curl_dim
 Curl-curl dimensionality. More...
 
int m_bnd_dim
 bounday dimensionality More...
 
Array< OneD, const SpatialDomains::BoundaryConditionShPtrm_PBndConds
 pressure boundary conditions container More...
 
Array< OneD, MultiRegions::ExpListSharedPtrm_PBndExp
 pressure boundary conditions expansion container More...
 
Array< OneD, MultiRegions::ExpListSharedPtrm_bndElmtExps
 Boundary expansions on each domain boundary. More...
 
int m_pressureCalls
 number of times the high-order pressure BCs have been called More...
 
int m_numHBCDof
 
int m_HBCnumber
 
int m_intSteps
 Maximum points used in pressure BC evaluation. More...
 
NekDouble m_timestep
 
Array< OneD, Array< OneD, NekDouble > > m_pressureHBCs
 Storage for current and previous levels of high order pressure boundary conditions. More...
 
Array< OneD, Array< OneD, NekDouble > > m_iprodnormvel
 Storage for current and previous levels of the inner product of normal velocity. More...
 
Array< OneD, Array< OneD, NekDouble > > m_traceNormals
 
HighOrderOutflowSharedPtr m_houtflow
 

Additional Inherited Members

- Protected Member Functions inherited from Nektar::StandardExtrapolate
void v_EvaluatePressureBCs (const Array< OneD, const Array< OneD, NekDouble > > &fields, const Array< OneD, const Array< OneD, NekDouble > > &N, NekDouble kinvis) override
 
void v_SubSteppingTimeIntegration (const LibUtilities::TimeIntegrationSchemeSharedPtr &IntegrationScheme) override
 
void v_SubStepSaveFields (int nstep) override
 
void v_SubStepSetPressureBCs (const Array< OneD, const Array< OneD, NekDouble > > &inarray, NekDouble Aii_DT, NekDouble kinvis) override
 
void v_SubStepAdvance (int nstep, NekDouble time) override
 
void v_MountHOPBCs (int HBCdata, NekDouble kinvis, Array< OneD, NekDouble > &Q, Array< OneD, const NekDouble > &Advection) override
 
void v_AccelerationBDF (Array< OneD, Array< OneD, NekDouble > > &array) override
 
- Protected Member Functions inherited from Nektar::Extrapolate
virtual void v_EvaluatePressureBCs (const Array< OneD, const Array< OneD, NekDouble > > &inarray, const Array< OneD, const Array< OneD, NekDouble > > &N, NekDouble kinvis)=0
 
virtual void v_SubSteppingTimeIntegration (const LibUtilities::TimeIntegrationSchemeSharedPtr &IntegrationScheme)=0
 
virtual void v_SubStepSaveFields (int nstep)=0
 
virtual void v_SubStepSetPressureBCs (const Array< OneD, const Array< OneD, NekDouble > > &inarray, NekDouble Aii_DT, NekDouble kinvis)=0
 
virtual void v_SubStepAdvance (int nstep, NekDouble time)=0
 
virtual void v_MountHOPBCs (int HBCdata, NekDouble kinvis, Array< OneD, NekDouble > &Q, Array< OneD, const NekDouble > &Advection)=0
 
virtual std::string v_GetSubStepName (void)
 
virtual void v_AccelerationBDF (Array< OneD, Array< OneD, NekDouble > > &array)
 
void CalcNeumannPressureBCs (const Array< OneD, const Array< OneD, NekDouble > > &fields, const Array< OneD, const Array< OneD, NekDouble > > &N, NekDouble kinvis)
 
virtual void v_CalcNeumannPressureBCs (const Array< OneD, const Array< OneD, NekDouble > > &fields, const Array< OneD, const Array< OneD, NekDouble > > &N, NekDouble kinvis)
 
virtual void v_CorrectPressureBCs (const Array< OneD, NekDouble > &pressure)
 
virtual void v_AddNormVelOnOBC (const int nbcoeffs, const int nreg, Array< OneD, Array< OneD, NekDouble > > &u)
 
void CalcOutflowBCs (const Array< OneD, const Array< OneD, NekDouble > > &fields, NekDouble kinvis)
 
void RollOver (Array< OneD, Array< OneD, NekDouble > > &input)
 
- Static Protected Attributes inherited from Nektar::StandardExtrapolate
static NekDouble DuDt_Coeffs [3][4]
 
- Static Protected Attributes inherited from Nektar::Extrapolate
static NekDouble StifflyStable_Betaq_Coeffs [3][3]
 
static NekDouble StifflyStable_Alpha_Coeffs [3][3]
 
static NekDouble StifflyStable_Gamma0_Coeffs [3] = {1.0, 1.5, 11.0 / 6.0}
 

Detailed Description

Definition at line 51 of file MappingExtrapolate.h.

Constructor & Destructor Documentation

◆ MappingExtrapolate()

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

Definition at line 46 of file MappingExtrapolate.cpp.

51 : StandardExtrapolate(pSession, pFields, pPressure, pVel, advObject)
52{
54
55 // Load solve parameters related to the mapping
56 // Flags determining if pressure/viscous terms should be treated implicitly
57 m_session->MatchSolverInfo("MappingImplicitPressure", "True",
58 m_implicitPressure, false);
59 m_session->MatchSolverInfo("MappingImplicitViscous", "True",
60 m_implicitViscous, false);
61
62 // Relaxation parameter for pressure system
63 m_session->LoadParameter("MappingPressureRelaxation", m_pressureRelaxation,
64 1.0);
65}
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Velocity fields.
Definition: Extrapolate.h:201
LibUtilities::SessionReaderSharedPtr m_session
Definition: Extrapolate.h:193
static GLOBAL_MAPPING_EXPORT MappingSharedPtr Load(const LibUtilities::SessionReaderSharedPtr &pSession, const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields)
Return a pointer to the mapping, creating it on first call.
Definition: Mapping.cpp:266
GlobalMapping::MappingSharedPtr m_mapping
StandardExtrapolate(const LibUtilities::SessionReaderSharedPtr pSession, Array< OneD, MultiRegions::ExpListSharedPtr > pFields, MultiRegions::ExpListSharedPtr pPressure, const Array< OneD, int > pVel, const SolverUtils::AdvectionSharedPtr advObject)

References Nektar::GlobalMapping::Mapping::Load(), Nektar::Extrapolate::m_fields, m_implicitPressure, m_implicitViscous, m_mapping, m_pressureRelaxation, and Nektar::Extrapolate::m_session.

◆ ~MappingExtrapolate()

Nektar::MappingExtrapolate::~MappingExtrapolate ( )
override

Definition at line 67 of file MappingExtrapolate.cpp.

68{
69}

Member Function Documentation

◆ create()

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

Creates an instance of this class.

Definition at line 55 of file MappingExtrapolate.h.

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

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

◆ v_CalcNeumannPressureBCs()

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

Unified routine for calculation high-oder terms

Reimplemented from Nektar::Extrapolate.

Definition at line 205 of file MappingExtrapolate.cpp.

208{
209 if (m_mapping->HasConstantJacobian() && !m_implicitViscous)
210 {
211 Extrapolate::v_CalcNeumannPressureBCs(fields, N, kinvis);
212 }
213 else
214 {
215 size_t physTot = m_fields[0]->GetTotPoints();
216 size_t nvel = m_fields.size() - 1;
217 size_t i, n, cnt;
218
219 Array<OneD, NekDouble> Pvals;
220 Array<OneD, NekDouble> Uvals;
221
222 Array<OneD, Array<OneD, NekDouble>> Velocity(m_bnd_dim);
223 Array<OneD, Array<OneD, NekDouble>> Advection(m_bnd_dim);
224 // Get transformation Jacobian
225 Array<OneD, NekDouble> Jac(physTot, 0.0);
226 m_mapping->GetJacobian(Jac);
227 // Declare variables
228 Array<OneD, Array<OneD, NekDouble>> BndValues(m_bnd_dim);
229 Array<OneD, Array<OneD, NekDouble>> Q(m_bnd_dim);
230 Array<OneD, Array<OneD, NekDouble>> Q_field(nvel);
231 Array<OneD, Array<OneD, NekDouble>> fields_new(nvel);
232 Array<OneD, Array<OneD, NekDouble>> N_new(m_bnd_dim);
233 // Temporary variables
234 Array<OneD, NekDouble> tmp(physTot, 0.0);
235 Array<OneD, NekDouble> tmp2(physTot, 0.0);
236 for (int i = 0; i < m_bnd_dim; i++)
237 {
238 N_new[i] = Array<OneD, NekDouble>(physTot, 0.0);
239 }
240 for (i = 0; i < nvel; i++)
241 {
242 Q_field[i] = Array<OneD, NekDouble>(physTot, 0.0);
243 fields_new[i] = Array<OneD, NekDouble>(physTot, 0.0);
244 }
245
246 // Multiply convective terms by Jacobian
247 for (int i = 0; i < m_bnd_dim; i++)
248 {
249 if (m_fields[0]->GetWaveSpace())
250 {
251 m_fields[0]->HomogeneousBwdTrans(physTot, N[i], N_new[i]);
252 }
253 else
254 {
255 Vmath::Vcopy(physTot, N[i], 1, N_new[i], 1);
256 }
257 Vmath::Vmul(physTot, Jac, 1, N_new[i], 1, N_new[i], 1);
258 if (m_fields[0]->GetWaveSpace())
259 {
260 m_fields[0]->HomogeneousFwdTrans(physTot, N_new[i], N_new[i]);
261 }
262 }
263
264 // Get velocity in physical space
265 for (i = 0; i < nvel; i++)
266 {
267 if (m_fields[0]->GetWaveSpace())
268 {
269 m_fields[0]->HomogeneousBwdTrans(physTot, fields[i],
270 fields_new[i]);
271 }
272 else
273 {
274 Vmath::Vcopy(physTot, fields[i], 1, fields_new[i], 1);
275 }
276 }
277
278 // Calculate appropriate form of the CurlCurl operator
279 m_mapping->CurlCurlField(fields_new, Q_field, m_implicitViscous);
280
281 // If viscous terms are treated explicitly,
282 // add grad(U/J \dot grad J) to CurlCurl
284 {
285 m_mapping->DotGradJacobian(fields_new, tmp);
286 Vmath::Vdiv(physTot, tmp, 1, Jac, 1, tmp, 1);
287
288 bool wavespace = m_fields[0]->GetWaveSpace();
289 m_fields[0]->SetWaveSpace(false);
290 for (int i = 0; i < m_bnd_dim; i++)
291 {
292 m_fields[0]->PhysDeriv(MultiRegions::DirCartesianMap[i], tmp,
293 tmp2);
294 Vmath::Vadd(physTot, Q_field[i], 1, tmp2, 1, Q_field[i], 1);
295 }
296 m_fields[0]->SetWaveSpace(wavespace);
297 }
298
299 // Multiply by Jacobian and convert to wavespace (if necessary)
300 for (int i = 0; i < m_bnd_dim; i++)
301 {
302 Vmath::Vmul(physTot, Jac, 1, fields_new[i], 1, fields_new[i], 1);
303 Vmath::Vmul(physTot, Jac, 1, Q_field[i], 1, Q_field[i], 1);
304 if (m_fields[0]->GetWaveSpace())
305 {
306 m_fields[0]->HomogeneousFwdTrans(physTot, fields_new[i],
307 fields_new[i]);
308 m_fields[0]->HomogeneousFwdTrans(physTot, Q_field[i],
309 Q_field[i]);
310 }
311 }
312
314 for (n = cnt = 0; n < m_PBndConds.size(); ++n)
315 {
316 // High order boundary condition;
317 if (boost::iequals(m_PBndConds[n]->GetUserDefined(), "H"))
318 {
319 m_fields[0]->GetBndElmtExpansion(n, BndElmtExp);
320 size_t nq = BndElmtExp->GetTotPoints();
321
322 // Obtaining fields on BndElmtExp
323 for (int i = 0; i < m_bnd_dim; i++)
324 {
325 m_fields[0]->ExtractPhysToBndElmt(n, fields_new[i],
326 Velocity[i]);
327 m_fields[0]->ExtractPhysToBndElmt(n, N_new[i],
328 Advection[i]);
329 m_fields[0]->ExtractPhysToBndElmt(n, Q_field[i], Q[i]);
330 }
331
332 // Mounting advection component into the high-order condition
333 for (int i = 0; i < m_bnd_dim; i++)
334 {
335 MountHOPBCs(nq, kinvis, Q[i], Advection[i]);
336 }
337
338 Pvals = (m_pressureHBCs[m_intSteps - 1]) + cnt;
339 Uvals = (m_iprodnormvel[m_intSteps]) + cnt;
340
341 // Getting values on the edge and filling the pressure boundary
342 // expansion and the acceleration term. Multiplication by the
343 // normal is required
344 for (int i = 0; i < m_bnd_dim; i++)
345 {
346 m_fields[0]->ExtractElmtToBndPhys(n, Q[i], BndValues[i]);
347 }
348 m_PBndExp[n]->NormVectorIProductWRTBase(BndValues, Pvals);
349
350 for (int i = 0; i < m_bnd_dim; i++)
351 {
352 m_fields[0]->ExtractElmtToBndPhys(n, Velocity[i],
353 BndValues[i]);
354 }
355 m_PBndExp[n]->NormVectorIProductWRTBase(BndValues, Uvals);
356
357 // Get offset for next terms
358 cnt += m_PBndExp[n]->GetNcoeffs();
359 }
360 }
361 }
362 // If pressure terms are treated implicitly, we need to multiply
363 // by the relaxation parameter, and zero the correction term
365 {
368 m_pressureHBCs[m_intSteps - 1], 1);
369 }
370 m_bcCorrection = Array<OneD, NekDouble>(m_numHBCDof, 0.0);
371}
Array< OneD, Array< OneD, NekDouble > > m_pressureHBCs
Storage for current and previous levels of high order pressure boundary conditions.
Definition: Extrapolate.h:247
int m_bnd_dim
bounday dimensionality
Definition: Extrapolate.h:220
virtual void v_CalcNeumannPressureBCs(const Array< OneD, const Array< OneD, NekDouble > > &fields, const Array< OneD, const Array< OneD, NekDouble > > &N, NekDouble kinvis)
Array< OneD, Array< OneD, NekDouble > > m_iprodnormvel
Storage for current and previous levels of the inner product of normal velocity.
Definition: Extrapolate.h:251
int m_intSteps
Maximum points used in pressure BC evaluation.
Definition: Extrapolate.h:241
Array< OneD, MultiRegions::ExpListSharedPtr > m_PBndExp
pressure boundary conditions expansion container
Definition: Extrapolate.h:226
void MountHOPBCs(int HBCdata, NekDouble kinvis, Array< OneD, NekDouble > &Q, Array< OneD, const NekDouble > &Advection)
Definition: Extrapolate.h:383
Array< OneD, const SpatialDomains::BoundaryConditionShPtr > m_PBndConds
pressure boundary conditions container
Definition: Extrapolate.h:223
Array< OneD, NekDouble > m_bcCorrection
MultiRegions::Direction const DirCartesianMap[]
Definition: ExpList.h:87
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
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.hpp:72
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.hpp:180
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*x.
Definition: Vmath.hpp:100
void Vdiv(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.hpp:126
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.hpp:825

References Nektar::MultiRegions::DirCartesianMap, m_bcCorrection, Nektar::Extrapolate::m_bnd_dim, Nektar::Extrapolate::m_fields, m_implicitPressure, m_implicitViscous, Nektar::Extrapolate::m_intSteps, Nektar::Extrapolate::m_iprodnormvel, m_mapping, Nektar::Extrapolate::m_numHBCDof, Nektar::Extrapolate::m_PBndConds, Nektar::Extrapolate::m_PBndExp, Nektar::Extrapolate::m_pressureHBCs, m_pressureRelaxation, Nektar::Extrapolate::MountHOPBCs(), Vmath::Smul(), Nektar::Extrapolate::v_CalcNeumannPressureBCs(), Vmath::Vadd(), Vmath::Vcopy(), Vmath::Vdiv(), and Vmath::Vmul().

◆ v_CorrectPressureBCs()

void Nektar::MappingExtrapolate::v_CorrectPressureBCs ( const Array< OneD, NekDouble > &  pressure)
overridevirtual

Reimplemented from Nektar::Extrapolate.

Definition at line 74 of file MappingExtrapolate.cpp.

76{
77 if (m_HBCnumber > 0)
78 {
79 size_t cnt, n;
80 size_t physTot = m_fields[0]->GetTotPoints();
81 size_t nvel = m_fields.size() - 1;
82
83 Array<OneD, NekDouble> Vals;
84 // Remove previous correction
85 for (cnt = n = 0; n < m_PBndConds.size(); ++n)
86 {
87 if (m_PBndConds[n]->GetUserDefined() == "H")
88 {
89 size_t nq = m_PBndExp[n]->GetNcoeffs();
90 Vmath::Vsub(nq, &(m_PBndExp[n]->GetCoeffs()[0]), 1,
91 &(m_bcCorrection[cnt]), 1,
92 &(m_PBndExp[n]->UpdateCoeffs()[0]), 1);
93 cnt += nq;
94 }
95 }
96
97 // Calculate new correction
98 Array<OneD, NekDouble> Jac(physTot, 0.0);
99 m_mapping->GetJacobian(Jac);
100
101 Array<OneD, Array<OneD, NekDouble>> correction(nvel);
102 Array<OneD, Array<OneD, NekDouble>> gradP(nvel);
103 Array<OneD, Array<OneD, NekDouble>> wk(nvel);
104 Array<OneD, Array<OneD, NekDouble>> wk2(nvel);
105 for (size_t i = 0; i < nvel; i++)
106 {
107 wk[i] = Array<OneD, NekDouble>(physTot, 0.0);
108 gradP[i] = Array<OneD, NekDouble>(physTot, 0.0);
109 correction[i] = Array<OneD, NekDouble>(physTot, 0.0);
110 }
111
112 // Calculate G(p)
113 for (size_t i = 0; i < nvel; ++i)
114 {
116 gradP[i]);
117 if (m_fields[0]->GetWaveSpace())
118 {
119 m_fields[0]->HomogeneousBwdTrans(physTot, gradP[i], wk[i]);
120 }
121 else
122 {
123 Vmath::Vcopy(physTot, gradP[i], 1, wk[i], 1);
124 }
125 }
126 m_mapping->RaiseIndex(wk, correction); // G(p)
127
128 // alpha*J*(G(p))
129 if (!m_mapping->HasConstantJacobian())
130 {
131 for (size_t i = 0; i < nvel; ++i)
132 {
133 Vmath::Vmul(physTot, correction[i], 1, Jac, 1, correction[i],
134 1);
135 }
136 }
137 for (size_t i = 0; i < nvel; ++i)
138 {
139 Vmath::Smul(physTot, m_pressureRelaxation, correction[i], 1,
140 correction[i], 1);
141 }
142
143 if (m_pressure->GetWaveSpace())
144 {
145 for (size_t i = 0; i < nvel; ++i)
146 {
147 m_pressure->HomogeneousFwdTrans(physTot, correction[i],
148 correction[i]);
149 }
150 }
151 // p_i - alpha*J*div(G(p))
152 for (size_t i = 0; i < nvel; ++i)
153 {
154 Vmath::Vsub(physTot, gradP[i], 1, correction[i], 1, correction[i],
155 1);
156 }
157
158 // Get value at boundary and calculate Inner product
159 Array<OneD, Array<OneD, NekDouble>> correctionElmt(m_bnd_dim);
160 Array<OneD, Array<OneD, NekDouble>> BndValues(m_bnd_dim);
162 for (n = cnt = 0; n < m_PBndConds.size(); ++n)
163 {
164 // High order boundary condition;
165 if (boost::iequals(m_PBndConds[n]->GetUserDefined(), "H"))
166 {
167 m_fields[0]->GetBndElmtExpansion(n, BndElmtExp);
168
169 // Obtaining fields on BndElmtExp
170 for (int i = 0; i < m_bnd_dim; i++)
171 {
172 m_fields[0]->ExtractPhysToBndElmt(n, correction[i],
173 correctionElmt[i]);
174 }
175
176 Vals = m_bcCorrection + cnt;
177 // Getting values on the edge and filling the correction
178 for (int i = 0; i < m_bnd_dim; i++)
179 {
180 m_fields[0]->ExtractElmtToBndPhys(n, correctionElmt[i],
181 BndValues[i]);
182 }
183 m_PBndExp[n]->NormVectorIProductWRTBase(BndValues, Vals);
184
185 // Get offset for next terms
186 cnt += m_PBndExp[n]->GetNcoeffs();
187 }
188 }
189
190 // Apply new correction
191 for (size_t cnt = n = 0; n < m_PBndConds.size(); ++n)
192 {
193 if (m_PBndConds[n]->GetUserDefined() == "H")
194 {
195 size_t nq = m_PBndExp[n]->GetNcoeffs();
196 Vmath::Vadd(nq, &(m_PBndExp[n]->GetCoeffs()[0]), 1,
197 &(m_bcCorrection[cnt]), 1,
198 &(m_PBndExp[n]->UpdateCoeffs()[0]), 1);
199 cnt += nq;
200 }
201 }
202 }
203}
MultiRegions::ExpListSharedPtr m_pressure
Pointer to field holding pressure field.
Definition: Extrapolate.h:204
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.hpp:220

References Nektar::MultiRegions::DirCartesianMap, m_bcCorrection, Nektar::Extrapolate::m_bnd_dim, Nektar::Extrapolate::m_fields, Nektar::Extrapolate::m_HBCnumber, m_mapping, Nektar::Extrapolate::m_PBndConds, Nektar::Extrapolate::m_PBndExp, Nektar::Extrapolate::m_pressure, m_pressureRelaxation, CG_Iterations::pressure, Vmath::Smul(), Vmath::Vadd(), Vmath::Vcopy(), Vmath::Vmul(), and Vmath::Vsub().

Member Data Documentation

◆ className

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

Name of class.

Registers the class with the Factory.

Definition at line 68 of file MappingExtrapolate.h.

◆ m_bcCorrection

Array<OneD, NekDouble> Nektar::MappingExtrapolate::m_bcCorrection
protected

Definition at line 89 of file MappingExtrapolate.h.

Referenced by v_CalcNeumannPressureBCs(), and v_CorrectPressureBCs().

◆ m_implicitPressure

bool Nektar::MappingExtrapolate::m_implicitPressure
protected

Definition at line 93 of file MappingExtrapolate.h.

Referenced by MappingExtrapolate(), and v_CalcNeumannPressureBCs().

◆ m_implicitViscous

bool Nektar::MappingExtrapolate::m_implicitViscous
protected

Definition at line 94 of file MappingExtrapolate.h.

Referenced by MappingExtrapolate(), and v_CalcNeumannPressureBCs().

◆ m_mapping

GlobalMapping::MappingSharedPtr Nektar::MappingExtrapolate::m_mapping
protected

◆ m_pressureRelaxation

NekDouble Nektar::MappingExtrapolate::m_pressureRelaxation
protected