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

#include <TransMovingWall.h>

Inheritance diagram for Nektar::TransMovingWall:
[legend]

Public Member Functions

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

NekDouble m_dt
 
int m_pressure
 
NekDouble Fourth_Coeffs [4]
 
- 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< TransMovingWall >
 

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 TransMovingWall.h.

Constructor & Destructor Documentation

◆ ~TransMovingWall()

Nektar::TransMovingWall::~TransMovingWall ( )
override

Definition at line 70 of file TransMovingWall.cpp.

71{
72}

◆ TransMovingWall()

Nektar::TransMovingWall::TransMovingWall ( 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 46 of file TransMovingWall.cpp.

53 : StaticWall(pSession, pFields, cond, exp, nbnd, spacedim, bnddim)
54{
55 classname = "TransMovingWall";
56 m_pressure = cond.size() - 1;
57 for (size_t i = 0; i < m_bnddim; ++i)
58 {
59 if (cond[i]->GetUserDefined() == "TimeDependent")
60 {
61 m_BndConds[i] = cond[i];
62 }
63 }
64 if (cond[m_pressure]->GetUserDefined() == classname)
65 {
67 }
68}
std::map< int, MultiRegions::ExpListSharedPtr > m_BndExp
int m_bnddim
bounday dimensionality
std::map< int, SpatialDomains::BoundaryConditionShPtr > m_BndConds
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_BndConds, Nektar::IncBaseCondition::m_bnddim, Nektar::IncBaseCondition::m_BndExp, and m_pressure.

Member Function Documentation

◆ create()

static IncBaseConditionSharedPtr Nektar::TransMovingWall::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 TransMovingWall.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::TransMovingWall::v_Initialise ( const LibUtilities::SessionReaderSharedPtr pSession)
overrideprotectedvirtual

Reimplemented from Nektar::StaticWall.

Definition at line 74 of file TransMovingWall.cpp.

76{
77 if (m_BndExp.empty())
78 {
79 return;
80 }
82 if (pSession->DefinesParameter("TimeStep"))
83 {
84 m_dt = pSession->GetParameter("TimeStep");
85 }
86 else
87 {
88 m_dt = 2.E-4;
89 }
90 NekDouble invdt = 1. / m_dt;
91 Fourth_Coeffs[0] = 1. / 12. * invdt;
92 Fourth_Coeffs[1] = -2. / 3. * invdt;
93 Fourth_Coeffs[2] = 2. / 3. * invdt;
94 Fourth_Coeffs[3] = -1. / 12. * invdt;
95}
void v_Initialise(const LibUtilities::SessionReaderSharedPtr &pSession) override
Definition: StaticWall.cpp:65
double NekDouble

References Fourth_Coeffs, Nektar::IncBaseCondition::m_BndExp, m_dt, and Nektar::StaticWall::v_Initialise().

◆ v_Update()

void Nektar::TransMovingWall::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

Reimplemented from Nektar::StaticWall.

Definition at line 97 of file TransMovingWall.cpp.

101{
102 if (m_BndExp.empty() || fields.size() == 0)
103 {
104 return;
105 }
106 ++m_numCalls;
107 int nptsPlane0 = 0;
108 SetNumPointsOnPlane0(nptsPlane0);
109 Array<OneD, Array<OneD, NekDouble>> rhs(m_bnddim);
110 for (int i = 0; i < m_bnddim; ++i)
111 {
112 rhs[i] = Array<OneD, NekDouble>(m_npoints, 0.);
113 }
114 // add viscous term
115 AddVisPressureBCs(fields, rhs, params);
116 // Add DuDt
117 std::map<std::string, NekDouble> transParams;
118 std::vector<std::string> accStr = {"A_x", "A_y", "A_z"};
119 NekDouble time = 0., dt2 = 2. * m_dt;
120 if (params.find("Time") != params.end())
121 {
122 time = params["Time"];
123 }
124 std::vector<NekDouble> times = {time - dt2, time - m_dt, time + m_dt,
125 time + dt2};
126 for (int i = 0; i < m_bnddim; ++i)
127 {
128 if (m_BndConds.find(i) != m_BndConds.end() && nptsPlane0)
129 {
130 NekDouble dudt = 0.;
131 LibUtilities::Equation equ =
132 std::static_pointer_cast<
133 SpatialDomains::DirichletBoundaryCondition>(m_BndConds[i])
134 ->m_dirichletCondition;
135 for (int j = 0; j < times.size(); ++j)
136 {
137 dudt += Fourth_Coeffs[j] * equ.Evaluate(0, 0., 0., times[j]);
138 }
139 transParams[accStr[i]] = dudt;
140 }
141 }
142 AddRigidBodyAcc(rhs, transParams, nptsPlane0);
143 m_BndExp[m_pressure]->NormVectorIProductWRTBase(
144 rhs, m_BndExp[m_pressure]->UpdateCoeffs());
145}
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::LibUtilities::Equation::Evaluate(), Fourth_Coeffs, Nektar::IncBaseCondition::m_BndConds, Nektar::IncBaseCondition::m_bnddim, Nektar::IncBaseCondition::m_BndExp, m_dt, Nektar::IncBaseCondition::m_npoints, Nektar::IncBaseCondition::m_numCalls, m_pressure, and Nektar::IncBaseCondition::SetNumPointsOnPlane0().

Friends And Related Function Documentation

◆ MemoryManager< TransMovingWall >

friend class MemoryManager< TransMovingWall >
friend

Definition at line 1 of file TransMovingWall.h.

Member Data Documentation

◆ className

std::string Nektar::TransMovingWall::className
static
Initial value:
=
"TransMovingWall", TransMovingWall::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 TransMovingWall.h.

◆ Fourth_Coeffs

NekDouble Nektar::TransMovingWall::Fourth_Coeffs[4]
protected

Definition at line 80 of file TransMovingWall.h.

Referenced by v_Initialise(), and v_Update().

◆ m_dt

NekDouble Nektar::TransMovingWall::m_dt
protected

Definition at line 78 of file TransMovingWall.h.

Referenced by v_Initialise(), and v_Update().

◆ m_pressure

int Nektar::TransMovingWall::m_pressure
protected

Definition at line 79 of file TransMovingWall.h.

Referenced by TransMovingWall(), and v_Update().