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

#include <MovingFrameWall.h>

Inheritance diagram for Nektar::MovingFrameWall:
[legend]

Public Member Functions

 ~MovingFrameWall () override
 
- Public Member Functions inherited from Nektar::StaticWall
 ~StaticWall () override
 
- Public Member Functions inherited from Nektar::IncBaseCondition
virtual ~IncBaseCondition ()
 
void Update (const Array< OneD, const Array< OneD, NekDouble > > &fields, const Array< OneD, const Array< OneD, NekDouble > > &Adv, std::map< std::string, NekDouble > &params)
 
void Initialise (const LibUtilities::SessionReaderSharedPtr &pSession)
 

Static Public Member Functions

static IncBaseConditionSharedPtr create (const LibUtilities::SessionReaderSharedPtr pSession, Array< OneD, MultiRegions::ExpListSharedPtr > pFields, Array< OneD, SpatialDomains::BoundaryConditionShPtr > cond, Array< OneD, MultiRegions::ExpListSharedPtr > exp, int nbnd, int spacedim, int bnddim)
 
- Static Public Member Functions inherited from Nektar::StaticWall
static IncBaseConditionSharedPtr create (const LibUtilities::SessionReaderSharedPtr pSession, Array< OneD, MultiRegions::ExpListSharedPtr > pFields, Array< OneD, SpatialDomains::BoundaryConditionShPtr > cond, Array< OneD, MultiRegions::ExpListSharedPtr > exp, int nbnd, int spacedim, int bnddim)
 

Static Public Attributes

static std::string className
 
- Static Public Attributes inherited from Nektar::StaticWall
static std::string className
 

Protected Member Functions

void v_Initialise (const LibUtilities::SessionReaderSharedPtr &pSession) override
 
void v_Update (const Array< OneD, const Array< OneD, NekDouble > > &fields, const Array< OneD, const Array< OneD, NekDouble > > &Adv, std::map< std::string, NekDouble > &params) override
 v_Update set correct BCs (in wavespace) More...
 
 MovingFrameWall (const LibUtilities::SessionReaderSharedPtr pSession, Array< OneD, MultiRegions::ExpListSharedPtr > pFields, Array< OneD, SpatialDomains::BoundaryConditionShPtr > cond, Array< OneD, MultiRegions::ExpListSharedPtr > exp, int nbnd, int spacedim, int bnddim)
 
- Protected Member Functions inherited from Nektar::StaticWall
void v_Initialise (const LibUtilities::SessionReaderSharedPtr &pSession) override
 
void v_Update (const Array< OneD, const Array< OneD, NekDouble > > &fields, const Array< OneD, const Array< OneD, NekDouble > > &Adv, std::map< std::string, NekDouble > &params) override
 
 StaticWall (const LibUtilities::SessionReaderSharedPtr pSession, Array< OneD, MultiRegions::ExpListSharedPtr > pFields, Array< OneD, SpatialDomains::BoundaryConditionShPtr > cond, Array< OneD, MultiRegions::ExpListSharedPtr > exp, int nbnd, int spacedim, int bnddim)
 
- Protected Member Functions inherited from Nektar::IncBaseCondition
 IncBaseCondition (const LibUtilities::SessionReaderSharedPtr pSession, Array< OneD, MultiRegions::ExpListSharedPtr > pFields, Array< OneD, SpatialDomains::BoundaryConditionShPtr > cond, Array< OneD, MultiRegions::ExpListSharedPtr > exp, int nbnd, int spacedim, int bnddim)
 
virtual void v_Initialise (const LibUtilities::SessionReaderSharedPtr &pSession)
 
virtual void v_Update (const Array< OneD, const Array< OneD, NekDouble > > &fields, const Array< OneD, const Array< OneD, NekDouble > > &Adv, std::map< std::string, NekDouble > &params)
 
void ExtrapolateArray (const int numCalls, Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &array)
 
void RollOver (Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &input)
 
void AddVisPressureBCs (const Array< OneD, const Array< OneD, NekDouble > > &fields, Array< OneD, Array< OneD, NekDouble > > &N, std::map< std::string, NekDouble > &params)
 
void AddRigidBodyAcc (Array< OneD, Array< OneD, NekDouble > > &N, std::map< std::string, NekDouble > &params, int npts0)
 
void RigidBodyVelocity (Array< OneD, Array< OneD, NekDouble > > &velocities, std::map< std::string, NekDouble > &params, int npts0)
 
void InitialiseCoords (std::map< std::string, NekDouble > &params)
 
void SetNumPointsOnPlane0 (int &npointsPlane0)
 

Protected Attributes

int m_pressure
 
bool m_hasVels
 
bool m_hasPressure
 
- Protected Attributes inherited from Nektar::IncBaseCondition
int m_spacedim
 
int m_bnddim
 bounday dimensionality More...
 
int m_nbnd
 
int m_numCalls
 
int m_intSteps
 
std::map< int, SpatialDomains::BoundaryConditionShPtrm_BndConds
 
std::map< int, MultiRegions::ExpListSharedPtrm_BndExp
 
int m_npoints
 
Array< OneD, Array< OneD, NekDouble > > m_coords
 
MultiRegions::ExpListSharedPtr m_bndElmtExps
 
MultiRegions::ExpListSharedPtr m_field
 
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > m_viscous
 
int m_pressure
 
std::string classname
 

Friends

class MemoryManager< MovingFrameWall >
 

Additional Inherited Members

- Static Protected Attributes inherited from Nektar::IncBaseCondition
static NekDouble StifflyStable_Betaq_Coeffs [3][3]
 
static NekDouble StifflyStable_Alpha_Coeffs [3][3]
 
static NekDouble StifflyStable_Gamma0_Coeffs [3]
 

Detailed Description

Definition at line 48 of file MovingFrameWall.h.

Constructor & Destructor Documentation

◆ ~MovingFrameWall()

Nektar::MovingFrameWall::~MovingFrameWall ( )
override

Definition at line 72 of file MovingFrameWall.cpp.

73{
74}

◆ MovingFrameWall()

Nektar::MovingFrameWall::MovingFrameWall ( const LibUtilities::SessionReaderSharedPtr  pSession,
Array< OneD, MultiRegions::ExpListSharedPtr pFields,
Array< OneD, SpatialDomains::BoundaryConditionShPtr cond,
Array< OneD, MultiRegions::ExpListSharedPtr exp,
int  nbnd,
int  spacedim,
int  bnddim 
)
protected

Definition at line 45 of file MovingFrameWall.cpp.

52 : StaticWall(pSession, pFields, cond, exp, nbnd, spacedim, bnddim)
53{
54 classname = "MovingFrameWall";
55 m_hasVels = false;
56 for (size_t i = 0; i < m_bnddim; ++i)
57 {
58 if (cond[i]->GetUserDefined() == classname)
59 {
60 m_hasVels = true;
61 m_BndExp[i] = exp[i];
62 }
63 }
64 m_pressure = cond.size() - 1;
65 m_hasPressure = cond[m_pressure]->GetUserDefined() == classname;
66 if (m_hasPressure)
67 {
69 }
70}
std::map< int, MultiRegions::ExpListSharedPtr > m_BndExp
int m_bnddim
bounday dimensionality
StaticWall(const LibUtilities::SessionReaderSharedPtr pSession, Array< OneD, MultiRegions::ExpListSharedPtr > pFields, Array< OneD, SpatialDomains::BoundaryConditionShPtr > cond, Array< OneD, MultiRegions::ExpListSharedPtr > exp, int nbnd, int spacedim, int bnddim)
Definition: StaticWall.cpp:44

References Nektar::IncBaseCondition::classname, Nektar::IncBaseCondition::m_bnddim, Nektar::IncBaseCondition::m_BndExp, m_hasPressure, m_hasVels, and m_pressure.

Member Function Documentation

◆ create()

static IncBaseConditionSharedPtr Nektar::MovingFrameWall::create ( const LibUtilities::SessionReaderSharedPtr  pSession,
Array< OneD, MultiRegions::ExpListSharedPtr pFields,
Array< OneD, SpatialDomains::BoundaryConditionShPtr cond,
Array< OneD, MultiRegions::ExpListSharedPtr exp,
int  nbnd,
int  spacedim,
int  bnddim 
)
inlinestatic

Definition at line 53 of file MovingFrameWall.h.

59 {
62 pSession, pFields, cond, exp, nbnd, spacedim, bnddim);
63 p->Initialise(pSession);
64 return p;
65 }
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
std::shared_ptr< IncBaseCondition > IncBaseConditionSharedPtr

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

◆ v_Initialise()

void Nektar::MovingFrameWall::v_Initialise ( const LibUtilities::SessionReaderSharedPtr pSession)
overrideprotectedvirtual

Reimplemented from Nektar::IncBaseCondition.

Definition at line 76 of file MovingFrameWall.cpp.

78{
80 m_field->GetBndElmtExpansion(m_nbnd, m_bndElmtExps, false);
81 if (m_hasPressure)
82 {
83 m_viscous =
84 Array<OneD, Array<OneD, Array<OneD, NekDouble>>>(m_intSteps);
85 for (int n = 0; n < m_intSteps; ++n)
86 {
87 m_viscous[n] = Array<OneD, Array<OneD, NekDouble>>(m_bnddim);
88 for (int i = 0; i < m_bnddim; ++i)
89 {
90 m_viscous[n][i] = Array<OneD, NekDouble>(m_npoints, 0.0);
91 }
92 }
93 }
94}
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > m_viscous
MultiRegions::ExpListSharedPtr m_field
MultiRegions::ExpListSharedPtr m_bndElmtExps
virtual void v_Initialise(const LibUtilities::SessionReaderSharedPtr &pSession)

References Nektar::IncBaseCondition::m_bnddim, Nektar::IncBaseCondition::m_bndElmtExps, Nektar::IncBaseCondition::m_field, m_hasPressure, Nektar::IncBaseCondition::m_intSteps, Nektar::IncBaseCondition::m_nbnd, Nektar::IncBaseCondition::m_npoints, Nektar::IncBaseCondition::m_viscous, and Nektar::IncBaseCondition::v_Initialise().

◆ v_Update()

void Nektar::MovingFrameWall::v_Update ( const Array< OneD, const Array< OneD, NekDouble > > &  fields,
const Array< OneD, const Array< OneD, NekDouble > > &  Adv,
std::map< std::string, NekDouble > &  params 
)
overrideprotectedvirtual

v_Update set correct BCs (in wavespace)

Parameters
fields
Advis in wavespace for 3DH1D
params

Reimplemented from Nektar::IncBaseCondition.

Definition at line 100 of file MovingFrameWall.cpp.

104{
105 int nptsPlane0 = 0;
106 SetNumPointsOnPlane0(nptsPlane0);
107 if (params.find("Omega_x") != params.end() ||
108 params.find("Omega_y") != params.end() ||
109 params.find("Omega_z") != params.end())
110 {
111 InitialiseCoords(params);
112 }
113 // pressure
114 if (m_hasPressure && fields.size() > 0)
115 {
116 ++m_numCalls;
117
118 Array<OneD, Array<OneD, NekDouble>> rhs(m_bnddim);
119 for (int i = 0; i < m_bnddim; ++i)
120 {
121 rhs[i] = Array<OneD, NekDouble>(m_npoints, 0.);
122 }
123 // add viscous term
124 AddVisPressureBCs(fields, rhs, params);
125 // add DuDt term
126 AddRigidBodyAcc(rhs, params, nptsPlane0);
127 m_BndExp[m_pressure]->NormVectorIProductWRTBase(
128 rhs, m_BndExp[m_pressure]->UpdateCoeffs());
129 }
130 // velocity
131 if (m_hasVels && nptsPlane0)
132 {
133 Array<OneD, Array<OneD, NekDouble>> velocities(m_bnddim);
134 for (size_t k = 0; k < m_bnddim; ++k)
135 {
136 if (m_BndExp.find(k) != m_BndExp.end())
137 {
138 velocities[k] = Array<OneD, NekDouble>(nptsPlane0, 0.0);
139 }
140 }
141 RigidBodyVelocity(velocities, params, nptsPlane0);
142 for (int k = 0; k < m_bnddim; ++k)
143 {
144 if (m_BndExp.find(k) != m_BndExp.end())
145 {
146 if (m_BndExp[k]->GetExpType() == MultiRegions::e2DH1D)
147 {
148 m_BndExp[k]->GetPlane(0)->FwdTransBndConstrained(
149 velocities[k],
150 m_BndExp[k]->GetPlane(0)->UpdateCoeffs());
151 }
152 else
153 {
154 m_BndExp[k]->FwdTransBndConstrained(
155 velocities[k], m_BndExp[k]->UpdateCoeffs());
156 }
157 }
158 }
159 }
160}
void InitialiseCoords(std::map< std::string, NekDouble > &params)
void RigidBodyVelocity(Array< OneD, Array< OneD, NekDouble > > &velocities, std::map< std::string, NekDouble > &params, int npts0)
void AddRigidBodyAcc(Array< OneD, Array< OneD, NekDouble > > &N, std::map< std::string, NekDouble > &params, int npts0)
void SetNumPointsOnPlane0(int &npointsPlane0)
void AddVisPressureBCs(const Array< OneD, const Array< OneD, NekDouble > > &fields, Array< OneD, Array< OneD, NekDouble > > &N, std::map< std::string, NekDouble > &params)

References Nektar::IncBaseCondition::AddRigidBodyAcc(), Nektar::IncBaseCondition::AddVisPressureBCs(), Nektar::MultiRegions::e2DH1D, Nektar::IncBaseCondition::InitialiseCoords(), Nektar::IncBaseCondition::m_bnddim, Nektar::IncBaseCondition::m_BndExp, m_hasPressure, m_hasVels, Nektar::IncBaseCondition::m_npoints, Nektar::IncBaseCondition::m_numCalls, m_pressure, Nektar::IncBaseCondition::RigidBodyVelocity(), and Nektar::IncBaseCondition::SetNumPointsOnPlane0().

Friends And Related Function Documentation

◆ MemoryManager< MovingFrameWall >

friend class MemoryManager< MovingFrameWall >
friend

Definition at line 1 of file MovingFrameWall.h.

Member Data Documentation

◆ className

std::string Nektar::MovingFrameWall::className
static
Initial value:
=
"MovingFrameWall", MovingFrameWall::create,
"Far field boundary condition of moving reference frame")
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
static IncBaseConditionSharedPtr create(const LibUtilities::SessionReaderSharedPtr pSession, Array< OneD, MultiRegions::ExpListSharedPtr > pFields, Array< OneD, SpatialDomains::BoundaryConditionShPtr > cond, Array< OneD, MultiRegions::ExpListSharedPtr > exp, int nbnd, int spacedim, int bnddim)
IncBCFactory & GetIncBCFactory()

Definition at line 67 of file MovingFrameWall.h.

◆ m_hasPressure

bool Nektar::MovingFrameWall::m_hasPressure
protected

Definition at line 84 of file MovingFrameWall.h.

Referenced by MovingFrameWall(), v_Initialise(), and v_Update().

◆ m_hasVels

bool Nektar::MovingFrameWall::m_hasVels
protected

Definition at line 83 of file MovingFrameWall.h.

Referenced by MovingFrameWall(), and v_Update().

◆ m_pressure

int Nektar::MovingFrameWall::m_pressure
protected

Definition at line 77 of file MovingFrameWall.h.

Referenced by MovingFrameWall(), and v_Update().