Nektar++
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
Nektar::HOPressureBndCondOp< TData > Class Template Referenceabstract

Higher-order pressure boundary condition, added to the pressure system as a Neumann contribution. More...

#include <HOPressureBndCondOp.hpp>

Inheritance diagram for Nektar::HOPressureBndCondOp< TData >:
[legend]

Public Member Functions

void SetVelocityContext (const MultiRegions::ExpListSharedPtr &velocityExpansionList, const std::vector< std::string > &velocityComponents)
 Set the velocity expansion list and the names of the velocity components, from which the boundary-adjacent elements are found.
 
void SetKinvis (const TData &kinvis)
 Set the kinematic viscosity kinvis Update() uses.
 
void SetTime (const TData &time)
 Set the time at which UpdateWithAcceleration() evaluates the prescribed boundary velocity (default 0).
 
void SetScale (const TData &scale)
 Set the scale by which Update() multiplies the fields it is passed (default 1).
 
void Update (LibUtilities::Field< TData, FieldState::Phys > &rhs, LibUtilities::Field< TData, FieldState::Phys > &velocity)
 Compute the pressure flux scale * (rhs - kinvis * CurlCurl(velocity)) . n on the boundary.
 
void UpdateWithAcceleration (LibUtilities::Field< TData, FieldState::Phys > &rhs, LibUtilities::Field< TData, FieldState::Phys > &velocity, LibUtilities::Field< TData, FieldState::Phys > &predictor)
 Compute the pressure flux, adding the acceleration needed to reach the prescribed boundary velocity at the time set by SetTime().
 
void UpdateWeak (LibUtilities::Field< TData, FieldState::Phys > &rhs, LibUtilities::Field< TData, FieldState::Phys > &velocity, LibUtilities::Field< TData, FieldState::Phys > &predictor)
 Compute the pressure flux of the weak pressure form: the flux of UpdateWithAcceleration() less scale * predictor . n.
 
bool HasNonDirichletVelocity () const
 Whether a region on this rank has a velocity component that is not Dirichlet, so that UpdateWithAcceleration() and UpdateWeak() read rhs.
 
- Public Member Functions inherited from Nektar::MultiRegions::NeuBndCondOp< TData >
void Apply (LibUtilities::Field< TData, FieldState::Coeff > &inout)
 
void operator() (LibUtilities::Field< TData, FieldState::Coeff > &inout)
 
void UpdateBndCoeffs (const TData &time=0.0)
 
size_t GetNumBndDofs ()
 
void AddNeumannSurfaceIntegral (LibUtilities::MemoryRegion< TData > &data)
 Add the surface integral of the Neumann boundary values on this rank, per component, as of their last update, to data[c] for component c, or data[c * nHomo + p] for plane p of a field with nHomo homogeneous planes, in the memory space of the operator's execution space.
 
void ExcludeUserDefinedType (const std::string &userDefinedType)
 Leave the boundary regions whose Neumann condition has USERDEFINEDTYPE userDefinedType, compared without regard to case, to another operator, which supplies their Neumann value: this operator no longer applies them.
 
- Public Member Functions inherited from Nektar::MultiRegions::Operator< TData >
virtual ~Operator ()=default
 
 Operator (const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > components)
 Construct the interface part of a concrete operator; called by the factory-registered creator functions.
 

Static Public Member Functions

static std::shared_ptr< HOPressureBndCondOp< TData > > Create (const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components, const std::string &execStr="")
 
- Static Public Member Functions inherited from Nektar::MultiRegions::NeuBndCondOp< TData >
static std::shared_ptr< NeuBndCondOp< TData > > Create (const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components, const std::string &execStr="")
 
- Static Public Member Functions inherited from Nektar::MultiRegions::Operator< TData >
template<template< typename > typename TOperator>
static std::shared_ptr< TOperator< TData > > Create (const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > components, const std::string &execStr)
 Create a concrete operator instance through the operator factory.
 
static std::string GetOpExecSpace (std::shared_ptr< LibUtilities::SessionReader > session, const bool warn=true)
 Return the execution space name ("opExecSpace") for an operator.
 
static const DefaultOpImplRule * GetDefaultOpImplRule (const StdRegions::StdExpansionSharedPtr &exp, const std::string &execSpace)
 Return the row of the default implementation table (DefaultOpImplTable.hpp) that a block of elements takes, or null if none does.
 
static std::string GetDefaultOpImpl (const StdRegions::StdExpansionSharedPtr &exp, const std::string &execSpace)
 Return the implementation a block of elements takes when neither the command line nor the session names one for its operator.
 
static std::vector< unsigned int > GetDefaultInterleaveWidths (const MultiRegions::ExpListSharedPtr &expansionList)
 Return the default interleave widths, one per block of expansionList, that persistent Fields (e.g. solution storage, time-integration and linear-solver workspace) built on it should be constructed with.
 
static bool IsDiscontinuousProjection (std::shared_ptr< LibUtilities::SessionReader > session)
 Return true if the session uses a Discontinuous (DG) projection.
 

Static Public Attributes

static const std::string name = "HOPressureBndCond"
 
static const std::string userDefinedType = "H"
 USERDEFINEDTYPE of the pressure Neumann conditions the operator applies.
 
- Static Public Attributes inherited from Nektar::MultiRegions::NeuBndCondOp< TData >
static const std::string name = "NeuBndCond"
 

Protected Member Functions

 HOPressureBndCondOp (const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components)
 
 ~HOPressureBndCondOp () override=default
 
virtual void v_SetVelocityContext (const MultiRegions::ExpListSharedPtr &velocityExpansionList, const std::vector< std::string > &velocityComponents)=0
 
virtual void v_Update (LibUtilities::Field< TData, FieldState::Phys > &rhs, LibUtilities::Field< TData, FieldState::Phys > &velocity)=0
 
virtual void v_UpdateWithAcceleration (LibUtilities::Field< TData, FieldState::Phys > &rhs, LibUtilities::Field< TData, FieldState::Phys > &velocity, LibUtilities::Field< TData, FieldState::Phys > &predictor)=0
 
virtual void v_UpdateWeak (LibUtilities::Field< TData, FieldState::Phys > &rhs, LibUtilities::Field< TData, FieldState::Phys > &velocity, LibUtilities::Field< TData, FieldState::Phys > &predictor)=0
 
- Protected Member Functions inherited from Nektar::MultiRegions::NeuBndCondOp< TData >
 NeuBndCondOp (const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components)
 
 ~NeuBndCondOp () override=default
 
virtual void v_Apply (LibUtilities::Field< TData, FieldState::Coeff > &inout)=0
 
virtual void v_UpdateBndCoeffs (const TData &time)=0
 
virtual size_t v_GetNumBndDofs ()=0
 
virtual void v_AddNeumannSurfaceIntegral (LibUtilities::MemoryRegion< TData > &data)=0
 
virtual void v_ExcludeUserDefinedType (const std::string &userDefinedType)=0
 

Protected Attributes

bool m_hasNonDirichletVelocity = false
 Set by SetVelocityContext(); read by HasNonDirichletVelocity().
 
bool m_isSetKinvis = false
 Set by SetKinvis(); checked by Update() in debug builds.
 
TData m_kinvis = 0.0
 Kinematic viscosity, set by SetKinvis().
 
TData m_time = 0.0
 Time of the prescribed boundary velocity, set by SetTime().
 
TData m_scale = 1.0
 Scale of the fields passed to Update(), set by SetScale().
 
- Protected Attributes inherited from Nektar::MultiRegions::NeuBndCondOp< TData >
bool m_bndCoeffsInitialised = false
 
bool m_hasTimeDependentBndCoeffs = false
 
- Protected Attributes inherited from Nektar::MultiRegions::Operator< TData >
MultiRegions::ExpListSharedPtr m_expansionList
 Expansion list the operator acts on.
 
std::vector< std::string > m_components
 Names of the field components the operator was built for.
 
LibUtilities::NekDataWarehouseSharedPtr m_dataWarehouse
 Data warehouse shared with the other operators on the expansion list, used to build and cache shared tables (basis matrices, mode indices, geometric factors) once.
 

Detailed Description

template<typename TData>
class Nektar::HOPressureBndCondOp< TData >

Higher-order pressure boundary condition, added to the pressure system as a Neumann contribution.

On every pressure boundary region with a Neumann condition and USERDEFINEDTYPE="H", the pressure flux is the normal component of scale * (rhs - kinvis * CurlCurl(velocity)), less the acceleration needed to reach the prescribed boundary velocity, in the velocity components that are Dirichlet on the region. The prescribed velocity is taken as the velocity solve imposes it, projected onto the boundary expansion of the velocity. Update() computes the flux from the current fields, with the kinematic viscosity set by SetKinvis(), the scale set by SetScale() and at the time set by SetTime(); Apply() adds its inner product to the pressure forcing. UpdateWeak() computes the flux of the weak pressure form, which leaves the explicit contribution to the volume term. It is added to the pressure system with LinearSystemOp::AddNeumannBCOp(op, userDefinedType), so that the default Neumann operator of the system leaves its regions out.

Definition at line 62 of file HOPressureBndCondOp.hpp.

Constructor & Destructor Documentation

◆ HOPressureBndCondOp()

template<typename TData >
Nektar::HOPressureBndCondOp< TData >::HOPressureBndCondOp ( const MultiRegions::ExpListSharedPtr &  expansionList,
const std::vector< std::string > &  components 
)
inlineprotected

Definition at line 206 of file HOPressureBndCondOp.hpp.

208 : MultiRegions::NeuBndCondOp<TData>(expansionList, components)
209 {
210 }

◆ ~HOPressureBndCondOp()

template<typename TData >
Nektar::HOPressureBndCondOp< TData >::~HOPressureBndCondOp ( )
overrideprotecteddefault

Member Function Documentation

◆ Create()

template<typename TData >
static std::shared_ptr< HOPressureBndCondOp< TData > > Nektar::HOPressureBndCondOp< TData >::Create ( const MultiRegions::ExpListSharedPtr &  expansionList,
const std::vector< std::string > &  components,
const std::string &  execStr = "" 
)
inlinestatic

Definition at line 65 of file HOPressureBndCondOp.hpp.

69 {
70 return MultiRegions::Operator<TData>::template Create<
71 HOPressureBndCondOp>(expansionList, components, execStr);
72 }
HOPressureBndCondOp(const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components)
static std::shared_ptr< HOPressureBndCondOp< TData > > Create(const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components, const std::string &execStr="")

References Nektar::HOPressureBndCondOp< TData >::Create().

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and Nektar::HOPressureBndCondOp< TData >::Create().

◆ HasNonDirichletVelocity()

template<typename TData >
bool Nektar::HOPressureBndCondOp< TData >::HasNonDirichletVelocity ( ) const
inline

Whether a region on this rank has a velocity component that is not Dirichlet, so that UpdateWithAcceleration() and UpdateWeak() read rhs.

Definition at line 189 of file HOPressureBndCondOp.hpp.

190 {
192 }
bool m_hasNonDirichletVelocity
Set by SetVelocityContext(); read by HasNonDirichletVelocity().

References Nektar::HOPressureBndCondOp< TData >::m_hasNonDirichletVelocity.

◆ SetKinvis()

template<typename TData >
void Nektar::HOPressureBndCondOp< TData >::SetKinvis ( const TData &  kinvis)
inline

Set the kinematic viscosity kinvis Update() uses.

Definition at line 94 of file HOPressureBndCondOp.hpp.

95 {
96 m_kinvis = kinvis;
97 m_isSetKinvis = true;
98 }
bool m_isSetKinvis
Set by SetKinvis(); checked by Update() in debug builds.
TData m_kinvis
Kinematic viscosity, set by SetKinvis().

References Nektar::HOPressureBndCondOp< TData >::m_isSetKinvis, and Nektar::HOPressureBndCondOp< TData >::m_kinvis.

◆ SetScale()

template<typename TData >
void Nektar::HOPressureBndCondOp< TData >::SetScale ( const TData &  scale)
inline

Set the scale by which Update() multiplies the fields it is passed (default 1).

Definition at line 113 of file HOPressureBndCondOp.hpp.

114 {
115 m_scale = scale;
116 }
TData m_scale
Scale of the fields passed to Update(), set by SetScale().

References Nektar::HOPressureBndCondOp< TData >::m_scale.

◆ SetTime()

template<typename TData >
void Nektar::HOPressureBndCondOp< TData >::SetTime ( const TData &  time)
inline

Set the time at which UpdateWithAcceleration() evaluates the prescribed boundary velocity (default 0).

Definition at line 104 of file HOPressureBndCondOp.hpp.

105 {
106 m_time = time;
107 }
TData m_time
Time of the prescribed boundary velocity, set by SetTime().

References Nektar::HOPressureBndCondOp< TData >::m_time.

◆ SetVelocityContext()

template<typename TData >
void Nektar::HOPressureBndCondOp< TData >::SetVelocityContext ( const MultiRegions::ExpListSharedPtr &  velocityExpansionList,
const std::vector< std::string > &  velocityComponents 
)
inline

Set the velocity expansion list and the names of the velocity components, from which the boundary-adjacent elements are found.

Definition at line 84 of file HOPressureBndCondOp.hpp.

87 {
88 v_SetVelocityContext(velocityExpansionList, velocityComponents);
89 }
virtual void v_SetVelocityContext(const MultiRegions::ExpListSharedPtr &velocityExpansionList, const std::vector< std::string > &velocityComponents)=0

References Nektar::HOPressureBndCondOp< TData >::v_SetVelocityContext().

◆ Update()

template<typename TData >
void Nektar::HOPressureBndCondOp< TData >::Update ( LibUtilities::Field< TData, FieldState::Phys > &  rhs,
LibUtilities::Field< TData, FieldState::Phys > &  velocity 
)
inline

Compute the pressure flux scale * (rhs - kinvis * CurlCurl(velocity)) . n on the boundary.

Definition at line 122 of file HOPressureBndCondOp.hpp.

124 {
125 v_Update(rhs, velocity);
126 }
virtual void v_Update(LibUtilities::Field< TData, FieldState::Phys > &rhs, LibUtilities::Field< TData, FieldState::Phys > &velocity)=0

References Nektar::HOPressureBndCondOp< TData >::v_Update().

◆ UpdateWeak()

template<typename TData >
void Nektar::HOPressureBndCondOp< TData >::UpdateWeak ( LibUtilities::Field< TData, FieldState::Phys > &  rhs,
LibUtilities::Field< TData, FieldState::Phys > &  velocity,
LibUtilities::Field< TData, FieldState::Phys > &  predictor 
)
inline

Compute the pressure flux of the weak pressure form: the flux of UpdateWithAcceleration() less scale * predictor . n.

The weak form takes the predictor, which holds the explicit advection and forcing, into the volume term of the pressure equation, so the flux is -scale * kinvis * CurlCurl(velocity) . n

  • scale * u_b(time) . n, the viscous term and the acceleration needed to reach the prescribed boundary velocity u_b of UpdateWithAcceleration().

A velocity component that is not Dirichlet on a region takes predictor - rhs, the velocity the predictor carries, as its boundary velocity, as UpdateWithAcceleration() does: its flux there is -scale * (kinvis * CurlCurl(velocity) + predictor - rhs) n_d. rhs and predictor are read only when HasNonDirichletVelocity(), and rhs may be uninstantiated otherwise.

Definition at line 177 of file HOPressureBndCondOp.hpp.

180 {
181 v_UpdateWeak(rhs, velocity, predictor);
182 }
virtual void v_UpdateWeak(LibUtilities::Field< TData, FieldState::Phys > &rhs, LibUtilities::Field< TData, FieldState::Phys > &velocity, LibUtilities::Field< TData, FieldState::Phys > &predictor)=0

References Nektar::HOPressureBndCondOp< TData >::v_UpdateWeak().

◆ UpdateWithAcceleration()

template<typename TData >
void Nektar::HOPressureBndCondOp< TData >::UpdateWithAcceleration ( LibUtilities::Field< TData, FieldState::Phys > &  rhs,
LibUtilities::Field< TData, FieldState::Phys > &  velocity,
LibUtilities::Field< TData, FieldState::Phys > &  predictor 
)
inline

Compute the pressure flux, adding the acceleration needed to reach the prescribed boundary velocity at the time set by SetTime().

predictor is the complete right-hand side of the implicit stage, which holds the explicit contribution rhs of Update(), so rhs cancels from the flux scale * (rhs - kinvis * CurlCurl(velocity)) . n

  • scale * (predictor - rhs) . n - scale * u_b(time) . n, which is scale * (predictor - kinvis * CurlCurl(velocity)) . n
  • scale * u_b(time) . n, with u_b the prescribed boundary velocity projected onto the boundary expansion of the velocity, the value the velocity solve imposes and the predictor carries on the boundary. It is evaluated at every call where a Dirichlet velocity condition of the region is time-dependent, and at the first call otherwise.

A velocity component that is not Dirichlet on a region has no prescribed boundary velocity and takes no acceleration: its flux there is scale * (rhs - kinvis * CurlCurl(velocity)) n_d. rhs is read only when HasNonDirichletVelocity(), and may be uninstantiated otherwise.

Definition at line 150 of file HOPressureBndCondOp.hpp.

154 {
155 v_UpdateWithAcceleration(rhs, velocity, predictor);
156 }
virtual void v_UpdateWithAcceleration(LibUtilities::Field< TData, FieldState::Phys > &rhs, LibUtilities::Field< TData, FieldState::Phys > &velocity, LibUtilities::Field< TData, FieldState::Phys > &predictor)=0

References Nektar::HOPressureBndCondOp< TData >::v_UpdateWithAcceleration().

◆ v_SetVelocityContext()

template<typename TData >
virtual void Nektar::HOPressureBndCondOp< TData >::v_SetVelocityContext ( const MultiRegions::ExpListSharedPtr &  velocityExpansionList,
const std::vector< std::string > &  velocityComponents 
)
protectedpure virtual

◆ v_Update()

template<typename TData >
virtual void Nektar::HOPressureBndCondOp< TData >::v_Update ( LibUtilities::Field< TData, FieldState::Phys > &  rhs,
LibUtilities::Field< TData, FieldState::Phys > &  velocity 
)
protectedpure virtual

◆ v_UpdateWeak()

template<typename TData >
virtual void Nektar::HOPressureBndCondOp< TData >::v_UpdateWeak ( LibUtilities::Field< TData, FieldState::Phys > &  rhs,
LibUtilities::Field< TData, FieldState::Phys > &  velocity,
LibUtilities::Field< TData, FieldState::Phys > &  predictor 
)
protectedpure virtual

◆ v_UpdateWithAcceleration()

template<typename TData >
virtual void Nektar::HOPressureBndCondOp< TData >::v_UpdateWithAcceleration ( LibUtilities::Field< TData, FieldState::Phys > &  rhs,
LibUtilities::Field< TData, FieldState::Phys > &  velocity,
LibUtilities::Field< TData, FieldState::Phys > &  predictor 
)
protectedpure virtual

Member Data Documentation

◆ m_hasNonDirichletVelocity

template<typename TData >
bool Nektar::HOPressureBndCondOp< TData >::m_hasNonDirichletVelocity = false
protected

◆ m_isSetKinvis

template<typename TData >
bool Nektar::HOPressureBndCondOp< TData >::m_isSetKinvis = false
protected

◆ m_kinvis

template<typename TData >
TData Nektar::HOPressureBndCondOp< TData >::m_kinvis = 0.0
protected

◆ m_scale

template<typename TData >
TData Nektar::HOPressureBndCondOp< TData >::m_scale = 1.0
protected

◆ m_time

template<typename TData >
TData Nektar::HOPressureBndCondOp< TData >::m_time = 0.0
protected

◆ name

template<typename TData >
const std::string Nektar::HOPressureBndCondOp< TData >::name = "HOPressureBndCond"
inlinestatic

Definition at line 74 of file HOPressureBndCondOp.hpp.

◆ userDefinedType

template<typename TData >
const std::string Nektar::HOPressureBndCondOp< TData >::userDefinedType = "H"
inlinestatic

USERDEFINEDTYPE of the pressure Neumann conditions the operator applies.

Definition at line 78 of file HOPressureBndCondOp.hpp.