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::HOutflowBndCondOp< TData > Class Template Referenceabstract

Dong's high-order outflow boundary condition, a pressure Dirichlet condition coupled with a velocity Neumann condition. More...

#include <HOutflowBndCondOp.hpp>

Inheritance diagram for Nektar::HOutflowBndCondOp< 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, and build the velocity boundary data.
 
void SetKinvis (const TData &kinvis)
 Set the kinematic viscosity UpdatePressure() and the velocity Neumann condition use.
 
void SetTime (const TData &time)
 Set the time at which UpdatePressure() evaluates the Neumann value f_b of the velocity conditions (default 0). A region whose f_b does not use t is evaluated only by the first UpdatePressure().
 
void SetScale (const TData &scale)
 Set the scale by which UpdatePressure() multiplies the velocity it is passed, and its gradient, to give the velocity u* (default 1).
 
void UpdatePressure (LibUtilities::Field< TData, FieldState::Phys > &velocity)
 Set the pressure boundary values from the extrapolated velocity.
 
void SetPressure (LibUtilities::Field< TData, FieldState::Phys > &pressure)
 Set the solved pressure, in physical space, from which the velocity Neumann condition computes the velocity flux when it is applied.
 
std::shared_ptr< MultiRegions::DirBndCondOp< TData > > GetPressureDirichletOp ()
 The Dirichlet condition of the pressure system, whose Apply() is ApplyPressure().
 
std::shared_ptr< MultiRegions::NeuBndCondOp< TData > > GetVelocityNeumannOp ()
 The Neumann condition of the velocity system, whose Apply() is ApplyVelocity(), available once SetVelocityContext() has been called.
 
- 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< HOutflowBndCondOp< TData > > Create (const MultiRegions::ExpListSharedPtr &pressureExpansionList, const std::vector< std::string > &pressureComponents, 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 = "HOutflowBndCond"
 
static const std::string userDefinedType = "HOutflow"
 USERDEFINEDTYPE of the pressure Dirichlet and velocity Neumann conditions the operator applies.
 

Protected Member Functions

 HOutflowBndCondOp (const MultiRegions::ExpListSharedPtr &pressureExpansionList, const std::vector< std::string > &pressureComponents)
 
 ~HOutflowBndCondOp () override=default
 
virtual void v_SetVelocityContext (const MultiRegions::ExpListSharedPtr &velocityExpansionList, const std::vector< std::string > &velocityComponents)=0
 
virtual void v_UpdatePressure (LibUtilities::Field< TData, FieldState::Phys > &velocity)=0
 

Protected Attributes

std::shared_ptr< MultiRegions::DirBndCondOp< TData > > m_pressureAdapter
 
std::shared_ptr< MultiRegions::NeuBndCondOp< TData > > m_velocityAdapter
 
TData m_kinvis = 0.0
 Kinematic viscosity, set by SetKinvis().
 
TData m_time = 0.0
 Time of the Neumann value f_b, set by SetTime().
 
TData m_scale = 1.0
 Scale of the velocity passed to UpdatePressure(), set by SetScale().
 
LibUtilities::Field< TData, FieldState::Phys > * m_pressure = nullptr
 Solved pressure, set by SetPressure(); not owned.
 
- 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::HOutflowBndCondOp< TData >

Dong's high-order outflow boundary condition, a pressure Dirichlet condition coupled with a velocity Neumann condition.

It applies to the boundary regions whose pressure condition is Dirichlet and whose velocity conditions are Neumann, all with USERDEFINEDTYPE="HOutflow". The operator holds the boundary data both conditions share and is not itself a boundary condition operator: ApplyPressure() sets the Dirichlet pressure coefficients and ApplyVelocity() adds the velocity flux. GetPressureDirichletOp() and GetVelocityNeumannOp() return the Dirichlet condition of the pressure system and the Neumann condition of the velocity system, which forward their Apply() to them. UpdatePressure() sets the pressure from the extrapolated velocity before the pressure solve. ApplyVelocity() computes the velocity flux from the solved pressure set by SetPressure() and the boundary data of the last UpdatePressure(), so the flux always reflects the pressure as it stands when the velocity system applies it. Both UpdatePressure() and ApplyVelocity() take the kinematic viscosity set by SetKinvis(), and UpdatePressure() the time set by SetTime() and the velocity scale set by SetScale().

Definition at line 67 of file HOutflowBndCondOp.hpp.

Constructor & Destructor Documentation

◆ HOutflowBndCondOp()

template<typename TData >
Nektar::HOutflowBndCondOp< TData >::HOutflowBndCondOp ( const MultiRegions::ExpListSharedPtr &  pressureExpansionList,
const std::vector< std::string > &  pressureComponents 
)
inlineprotected

Definition at line 200 of file HOutflowBndCondOp.hpp.

203 : MultiRegions::Operator<TData>(pressureExpansionList,
204 pressureComponents)
205 {
206 }

◆ ~HOutflowBndCondOp()

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

Member Function Documentation

◆ Create()

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

Definition at line 70 of file HOutflowBndCondOp.hpp.

74 {
75 return MultiRegions::Operator<TData>::template Create<
76 HOutflowBndCondOp>(pressureExpansionList, pressureComponents,
77 execStr);
78 }
static std::shared_ptr< HOutflowBndCondOp< TData > > Create(const MultiRegions::ExpListSharedPtr &pressureExpansionList, const std::vector< std::string > &pressureComponents, const std::string &execStr="")
HOutflowBndCondOp(const MultiRegions::ExpListSharedPtr &pressureExpansionList, const std::vector< std::string > &pressureComponents)

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

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

◆ GetPressureDirichletOp()

template<typename TData >
std::shared_ptr< MultiRegions::DirBndCondOp< TData > > Nektar::HOutflowBndCondOp< TData >::GetPressureDirichletOp ( )
inline

The Dirichlet condition of the pressure system, whose Apply() is ApplyPressure().

It sets only the pressure coefficients of the regions, and is added to the pressure system with LinearSystemOp::AddDirichletBCOp(op), after the default Dirichlet operator of the system, whose values for the regions it overwrites.

Definition at line 163 of file HOutflowBndCondOp.hpp.

164 {
165 return m_pressureAdapter;
166 }
std::shared_ptr< MultiRegions::DirBndCondOp< TData > > m_pressureAdapter

References Nektar::HOutflowBndCondOp< TData >::m_pressureAdapter.

◆ GetVelocityNeumannOp()

template<typename TData >
std::shared_ptr< MultiRegions::NeuBndCondOp< TData > > Nektar::HOutflowBndCondOp< TData >::GetVelocityNeumannOp ( )
inline

The Neumann condition of the velocity system, whose Apply() is ApplyVelocity(), available once SetVelocityContext() has been called.

It applies the whole velocity flux of the regions, and is added to the velocity system with LinearSystemOp::AddNeumannBCOp(op, userDefinedType), so that the default Neumann operator of the system leaves them out.

Definition at line 178 of file HOutflowBndCondOp.hpp.

179 {
181 "SetVelocityContext must be called before requesting the "
182 "HOutflow velocity adapter.");
183 return m_velocityAdapter;
184 }
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
std::shared_ptr< MultiRegions::NeuBndCondOp< TData > > m_velocityAdapter

References ASSERTL1, and Nektar::HOutflowBndCondOp< TData >::m_velocityAdapter.

◆ SetKinvis()

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

Set the kinematic viscosity UpdatePressure() and the velocity Neumann condition use.

Definition at line 101 of file HOutflowBndCondOp.hpp.

102 {
103 m_kinvis = kinvis;
104 }
TData m_kinvis
Kinematic viscosity, set by SetKinvis().

References Nektar::HOutflowBndCondOp< TData >::m_kinvis.

◆ SetPressure()

template<typename TData >
void Nektar::HOutflowBndCondOp< TData >::SetPressure ( LibUtilities::Field< TData, FieldState::Phys > &  pressure)
inline

Set the solved pressure, in physical space, from which the velocity Neumann condition computes the velocity flux when it is applied.

The operator does not take ownership of pressure, which must outlive it. The flux is computed from the values pressure holds when the velocity Neumann condition is applied, so a pressure refilled in place need not be set again.

Definition at line 148 of file HOutflowBndCondOp.hpp.

149 {
151 }
LibUtilities::Field< TData, FieldState::Phys > * m_pressure
Solved pressure, set by SetPressure(); not owned.

References Nektar::HOutflowBndCondOp< TData >::m_pressure.

◆ SetScale()

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

Set the scale by which UpdatePressure() multiplies the velocity it is passed, and its gradient, to give the velocity u* (default 1).

Definition at line 120 of file HOutflowBndCondOp.hpp.

121 {
122 m_scale = scale;
123 }
TData m_scale
Scale of the velocity passed to UpdatePressure(), set by SetScale().

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

◆ SetTime()

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

Set the time at which UpdatePressure() evaluates the Neumann value f_b of the velocity conditions (default 0). A region whose f_b does not use t is evaluated only by the first UpdatePressure().

Definition at line 111 of file HOutflowBndCondOp.hpp.

112 {
113 m_time = time;
114 }
TData m_time
Time of the Neumann value f_b, set by SetTime().

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

◆ SetVelocityContext()

template<typename TData >
void Nektar::HOutflowBndCondOp< 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, and build the velocity boundary data.

Definition at line 90 of file HOutflowBndCondOp.hpp.

93 {
94 v_SetVelocityContext(velocityExpansionList, velocityComponents);
95 }
virtual void v_SetVelocityContext(const MultiRegions::ExpListSharedPtr &velocityExpansionList, const std::vector< std::string > &velocityComponents)=0

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

◆ UpdatePressure()

template<typename TData >
void Nektar::HOutflowBndCondOp< TData >::UpdatePressure ( LibUtilities::Field< TData, FieldState::Phys > &  velocity)
inline

Set the pressure boundary values from the extrapolated velocity.

Parameters
velocityIMEX-extrapolated velocity at the scale of the time integrator; the scale set by SetScale() converts it, and its gradient, to the velocity u*.

Definition at line 132 of file HOutflowBndCondOp.hpp.

133 {
134 v_UpdatePressure(velocity);
135 }
virtual void v_UpdatePressure(LibUtilities::Field< TData, FieldState::Phys > &velocity)=0

References Nektar::HOutflowBndCondOp< TData >::v_UpdatePressure().

◆ v_SetVelocityContext()

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

◆ v_UpdatePressure()

template<typename TData >
virtual void Nektar::HOutflowBndCondOp< TData >::v_UpdatePressure ( LibUtilities::Field< TData, FieldState::Phys > &  velocity)
protectedpure virtual

Member Data Documentation

◆ m_kinvis

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

◆ m_pressure

template<typename TData >
LibUtilities::Field<TData, FieldState::Phys>* Nektar::HOutflowBndCondOp< TData >::m_pressure = nullptr
protected

◆ m_pressureAdapter

template<typename TData >
std::shared_ptr<MultiRegions::DirBndCondOp<TData> > Nektar::HOutflowBndCondOp< TData >::m_pressureAdapter
protected

◆ m_scale

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

◆ m_time

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

◆ m_velocityAdapter

template<typename TData >
std::shared_ptr<MultiRegions::NeuBndCondOp<TData> > Nektar::HOutflowBndCondOp< TData >::m_velocityAdapter
protected

◆ name

template<typename TData >
const std::string Nektar::HOutflowBndCondOp< TData >::name = "HOutflowBndCond"
inlinestatic

Definition at line 80 of file HOutflowBndCondOp.hpp.

◆ userDefinedType

template<typename TData >
const std::string Nektar::HOutflowBndCondOp< TData >::userDefinedType = "HOutflow"
inlinestatic

USERDEFINEDTYPE of the pressure Dirichlet and velocity Neumann conditions the operator applies.

Definition at line 84 of file HOutflowBndCondOp.hpp.