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

Symmetry boundary conditions for compressible flow problems. More...

#include <SymmetryBC.h>

Inheritance diagram for Nektar::SymmetryBC:
[legend]

Static Public Member Functions

static CFSBndCondSharedPtr create (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)
 Creates an instance of this class. More...
 

Static Public Attributes

static std::string className
 Name of the class. More...
 

Protected Member Functions

void v_Apply (Array< OneD, Array< OneD, NekDouble > > &Fwd, Array< OneD, Array< OneD, NekDouble > > &physarray, const NekDouble &time) override
 
- Protected Member Functions inherited from 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)
 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 ()
 

Private Member Functions

 SymmetryBC (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)
 
 ~SymmetryBC (void) override
 

Friends

class MemoryManager< SymmetryBC >
 

Additional Inherited Members

- Public Member Functions inherited from Nektar::CFSBndCond
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 Attributes inherited from Nektar::CFSBndCond
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

Symmetry boundary conditions for compressible flow problems.

Definition at line 46 of file SymmetryBC.h.

Constructor & Destructor Documentation

◆ SymmetryBC()

Nektar::SymmetryBC::SymmetryBC ( 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 
)
private

Definition at line 46 of file SymmetryBC.cpp.

51 : CFSBndCond(pSession, pFields, pTraceNormals, pSpaceDim, bcRegion, cnt)
52{
54}
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.
Definition: CFSBndCond.cpp:47
NekDouble m_diffusionAveWeight
Weight for average calculation of diffusion term.
Definition: CFSBndCond.h:99

References Nektar::CFSBndCond::m_diffusionAveWeight.

◆ ~SymmetryBC()

Nektar::SymmetryBC::~SymmetryBC ( void  )
inlineoverrideprivate

Definition at line 77 of file SymmetryBC.h.

77{};

Member Function Documentation

◆ create()

static CFSBndCondSharedPtr Nektar::SymmetryBC::create ( 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 
)
inlinestatic

Creates an instance of this class.

Definition at line 52 of file SymmetryBC.h.

57 {
59 pSession, pFields, pTraceNormals, pSpaceDim, bcRegion, cnt);
60 return p;
61 }
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
std::shared_ptr< CFSBndCond > CFSBndCondSharedPtr
A shared pointer to a boundary condition object.
Definition: CFSBndCond.h:51

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

◆ v_Apply()

void Nektar::SymmetryBC::v_Apply ( Array< OneD, Array< OneD, NekDouble > > &  Fwd,
Array< OneD, Array< OneD, NekDouble > > &  physarray,
const NekDouble time 
)
overrideprotectedvirtual

Implements Nektar::CFSBndCond.

Definition at line 56 of file SymmetryBC.cpp.

59{
60 int i;
61 int nVariables = physarray.size();
62
63 const Array<OneD, const int> &traceBndMap = m_fields[0]->GetTraceBndMap();
64
65 // Take into account that for PDE based shock capturing, eps = 0 at the
66 // wall.
67 int e, id1, id2, nBCEdgePts, eMax;
68
69 eMax = m_fields[0]->GetBndCondExpansions()[m_bcRegion]->GetExpSize();
70
71 for (e = 0; e < eMax; ++e)
72 {
73 nBCEdgePts = m_fields[0]
74 ->GetBndCondExpansions()[m_bcRegion]
75 ->GetExp(e)
76 ->GetTotPoints();
77 id1 =
78 m_fields[0]->GetBndCondExpansions()[m_bcRegion]->GetPhys_Offset(e);
79 id2 =
80 m_fields[0]->GetTrace()->GetPhys_Offset(traceBndMap[m_offset + e]);
81
82 // For 2D/3D, define: v* = v - 2(v.n)n
83 Array<OneD, NekDouble> tmp(nBCEdgePts, 0.0);
84
85 // Calculate (v.n)
86 for (i = 0; i < m_spacedim; ++i)
87 {
88 Vmath::Vvtvp(nBCEdgePts, &Fwd[1 + i][id2], 1,
89 &m_traceNormals[i][id2], 1, &tmp[0], 1, &tmp[0], 1);
90 }
91
92 // Calculate 2.0(v.n)
93 Vmath::Smul(nBCEdgePts, -2.0, &tmp[0], 1, &tmp[0], 1);
94
95 // Calculate v* = v - 2.0(v.n)n
96 for (i = 0; i < m_spacedim; ++i)
97 {
98 Vmath::Vvtvp(nBCEdgePts, &tmp[0], 1, &m_traceNormals[i][id2], 1,
99 &Fwd[1 + i][id2], 1, &Fwd[1 + i][id2], 1);
100 }
101
102 // Copy boundary adjusted values into the boundary expansion
103 for (i = 0; i < nVariables; ++i)
104 {
105 Vmath::Vcopy(nBCEdgePts, &Fwd[i][id2], 1,
106 &(m_fields[i]
107 ->GetBndCondExpansions()[m_bcRegion]
108 ->UpdatePhys())[id1],
109 1);
110 }
111 }
112}
int m_spacedim
Space dimension.
Definition: CFSBndCond.h:95
Array< OneD, Array< OneD, NekDouble > > m_traceNormals
Trace normals.
Definition: CFSBndCond.h:93
int m_bcRegion
Id of the boundary region.
Definition: CFSBndCond.h:109
int m_offset
Offset.
Definition: CFSBndCond.h:111
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array of fields.
Definition: CFSBndCond.h:91
void Vvtvp(int n, const T *w, const int incw, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
vvtvp (vector times vector plus vector): z = w*x + y
Definition: Vmath.hpp:366
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*x.
Definition: Vmath.hpp:100
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.hpp:825

References Nektar::CFSBndCond::m_bcRegion, Nektar::CFSBndCond::m_fields, Nektar::CFSBndCond::m_offset, Nektar::CFSBndCond::m_spacedim, Nektar::CFSBndCond::m_traceNormals, Vmath::Smul(), Vmath::Vcopy(), and Vmath::Vvtvp().

Friends And Related Function Documentation

◆ MemoryManager< SymmetryBC >

friend class MemoryManager< SymmetryBC >
friend

Definition at line 1 of file SymmetryBC.h.

Member Data Documentation

◆ className

std::string Nektar::SymmetryBC::className
static
Initial value:
=
"Symmetry", SymmetryBC::create, "Symmetry boundary condition.")
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
Definition: NekFactory.hpp:197
static CFSBndCondSharedPtr create(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)
Creates an instance of this class.
Definition: SymmetryBC.h:52
CFSBndCondFactory & GetCFSBndCondFactory()
Declaration of the boundary condition factory singleton.
Definition: CFSBndCond.cpp:41

Name of the class.

Definition at line 64 of file SymmetryBC.h.