Nektar++
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Nektar::CFSBndCond Class Referenceabstract

Encapsulates the user-defined boundary conditions for compressible flow solver. More...

#include <CFSBndCond.h>

Inheritance diagram for Nektar::CFSBndCond:
[legend]

Public Member Functions

virtual ~CFSBndCond ()
 
void Apply (Array< OneD, Array< OneD, NekDouble > > &Fwd, Array< OneD, Array< OneD, NekDouble > > &physarray, const NekDouble &time=0)
 Apply the boundary condition. More...
 
void ApplyBwdWeight ()
 Apply the Weight of boundary condition. More...
 

Protected Member Functions

 CFSBndCond (const LibUtilities::SessionReaderSharedPtr &pSession, const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const Array< OneD, Array< OneD, NekDouble > > &pTraceNormals, const int pSpaceDim, const int bcRegion, const int cnt)
 Constructor. More...
 
virtual void v_Apply (Array< OneD, Array< OneD, NekDouble > > &Fwd, Array< OneD, Array< OneD, NekDouble > > &physarray, const NekDouble &time)=0
 
virtual void v_ApplyBwdWeight ()
 

Protected Attributes

LibUtilities::SessionReaderSharedPtr m_session
 Session reader. More...
 
Array< OneD, MultiRegions::ExpListSharedPtrm_fields
 Array of fields. More...
 
Array< OneD, Array< OneD, NekDouble > > m_traceNormals
 Trace normals. More...
 
int m_spacedim
 Space dimension. More...
 
VariableConverterSharedPtr m_varConv
 Auxiliary object to convert variables. More...
 
NekDouble m_diffusionAveWeight
 Weight for average calculation of diffusion term. More...
 
NekDouble m_gamma
 Parameters of the flow. More...
 
NekDouble m_rhoInf
 
NekDouble m_pInf
 
NekDouble m_pOut
 
Array< OneD, NekDoublem_velInf
 
int m_bcRegion
 Id of the boundary region. More...
 
int m_offset
 Offset. More...
 

Detailed Description

Encapsulates the user-defined boundary conditions for compressible flow solver.

Definition at line 69 of file CFSBndCond.h.

Constructor & Destructor Documentation

◆ ~CFSBndCond()

virtual Nektar::CFSBndCond::~CFSBndCond ( )
inlinevirtual

Definition at line 72 of file CFSBndCond.h.

73 {
74 }

◆ CFSBndCond()

Nektar::CFSBndCond::CFSBndCond ( const LibUtilities::SessionReaderSharedPtr pSession,
const Array< OneD, MultiRegions::ExpListSharedPtr > &  pFields,
const Array< OneD, Array< OneD, NekDouble > > &  pTraceNormals,
const int  pSpaceDim,
const int  bcRegion,
const int  cnt 
)
protected

Constructor.

Definition at line 47 of file CFSBndCond.cpp.

52 : m_session(pSession), m_fields(pFields), m_traceNormals(pTraceNormals),
53 m_spacedim(pSpaceDim), m_bcRegion(bcRegion), m_offset(cnt)
54{
55 m_velInf = Array<OneD, NekDouble>(m_spacedim, 0.0);
56 m_session->LoadParameter("Gamma", m_gamma, 1.4);
57 m_session->LoadParameter("rhoInf", m_rhoInf, 1.225);
58 m_session->LoadParameter("pInf", m_pInf, 101325);
59 m_session->LoadParameter("uInf", m_velInf[0], 0.1);
60 if (m_spacedim >= 2)
61 {
62 m_session->LoadParameter("vInf", m_velInf[1], 0.0);
63 }
64 if (m_spacedim == 3)
65 {
66 m_session->LoadParameter("wInf", m_velInf[2], 0.0);
67 }
68
69 // Create auxiliary object to convert variables
72
74}
NekDouble m_rhoInf
Definition: CFSBndCond.h:103
NekDouble m_diffusionAveWeight
Weight for average calculation of diffusion term.
Definition: CFSBndCond.h:99
LibUtilities::SessionReaderSharedPtr m_session
Session reader.
Definition: CFSBndCond.h:89
NekDouble m_pInf
Definition: CFSBndCond.h:104
int m_spacedim
Space dimension.
Definition: CFSBndCond.h:95
Array< OneD, Array< OneD, NekDouble > > m_traceNormals
Trace normals.
Definition: CFSBndCond.h:93
Array< OneD, NekDouble > m_velInf
Definition: CFSBndCond.h:106
NekDouble m_gamma
Parameters of the flow.
Definition: CFSBndCond.h:102
int m_bcRegion
Id of the boundary region.
Definition: CFSBndCond.h:109
VariableConverterSharedPtr m_varConv
Auxiliary object to convert variables.
Definition: CFSBndCond.h:97
int m_offset
Offset.
Definition: CFSBndCond.h:111
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array of fields.
Definition: CFSBndCond.h:91
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), m_diffusionAveWeight, m_gamma, m_pInf, m_rhoInf, m_session, m_spacedim, m_varConv, and m_velInf.

Member Function Documentation

◆ Apply()

void Nektar::CFSBndCond::Apply ( Array< OneD, Array< OneD, NekDouble > > &  Fwd,
Array< OneD, Array< OneD, NekDouble > > &  physarray,
const NekDouble time = 0 
)

Apply the boundary condition.

Parameters
bcRegionid of the boundary region
cnt
Fwd
physarray
time

Definition at line 83 of file CFSBndCond.cpp.

86{
87 v_Apply(Fwd, physarray, time);
88}
virtual void v_Apply(Array< OneD, Array< OneD, NekDouble > > &Fwd, Array< OneD, Array< OneD, NekDouble > > &physarray, const NekDouble &time)=0

References v_Apply().

◆ ApplyBwdWeight()

void Nektar::CFSBndCond::ApplyBwdWeight ( )
inline

Apply the Weight of boundary condition.

Definition at line 82 of file CFSBndCond.h.

83 {
85 }
virtual void v_ApplyBwdWeight()
Definition: CFSBndCond.cpp:97

References v_ApplyBwdWeight().

◆ v_Apply()

virtual void Nektar::CFSBndCond::v_Apply ( Array< OneD, Array< OneD, NekDouble > > &  Fwd,
Array< OneD, Array< OneD, NekDouble > > &  physarray,
const NekDouble time 
)
protectedpure virtual

◆ v_ApplyBwdWeight()

void Nektar::CFSBndCond::v_ApplyBwdWeight ( )
protectedvirtual

@ brief Newly added bc should specify this virtual function if the Bwd/value in m_bndCondExpansions is the target value like Direchlet bc weight should be 1.0. if some average Fwd and Bwd/value in m_bndCondExpansions is the target value like WallViscousBC weight should be 0.5.

Definition at line 97 of file CFSBndCond.cpp.

98{
99 size_t nVariables = m_fields.size();
100 for (int i = 0; i < nVariables; ++i)
101 {
102 m_fields[i]->SetBndCondBwdWeight(m_bcRegion, m_diffusionAveWeight);
103 }
104}

References m_bcRegion, m_diffusionAveWeight, and m_fields.

Referenced by ApplyBwdWeight().

Member Data Documentation

◆ m_bcRegion

int Nektar::CFSBndCond::m_bcRegion
protected

◆ m_diffusionAveWeight

NekDouble Nektar::CFSBndCond::m_diffusionAveWeight
protected

Weight for average calculation of diffusion term.

Definition at line 99 of file CFSBndCond.h.

Referenced by CFSBndCond(), Nektar::SymmetryBC::SymmetryBC(), v_ApplyBwdWeight(), Nektar::WallBC::WallBC(), and Nektar::WallViscousBC::WallViscousBC().

◆ m_fields

Array<OneD, MultiRegions::ExpListSharedPtr> Nektar::CFSBndCond::m_fields
protected

◆ m_gamma

NekDouble Nektar::CFSBndCond::m_gamma
protected

◆ m_offset

int Nektar::CFSBndCond::m_offset
protected

◆ m_pInf

NekDouble Nektar::CFSBndCond::m_pInf
protected

Definition at line 104 of file CFSBndCond.h.

Referenced by CFSBndCond(), and Nektar::RiemannInvariantBC::v_Apply().

◆ m_pOut

NekDouble Nektar::CFSBndCond::m_pOut
protected

Definition at line 105 of file CFSBndCond.h.

◆ m_rhoInf

NekDouble Nektar::CFSBndCond::m_rhoInf
protected

Definition at line 103 of file CFSBndCond.h.

Referenced by CFSBndCond(), and Nektar::RiemannInvariantBC::v_Apply().

◆ m_session

LibUtilities::SessionReaderSharedPtr Nektar::CFSBndCond::m_session
protected

◆ m_spacedim

int Nektar::CFSBndCond::m_spacedim
protected

◆ m_traceNormals

Array<OneD, Array<OneD, NekDouble> > Nektar::CFSBndCond::m_traceNormals
protected

◆ m_varConv

VariableConverterSharedPtr Nektar::CFSBndCond::m_varConv
protected

◆ m_velInf

Array<OneD, NekDouble> Nektar::CFSBndCond::m_velInf
protected