VirtualFluids 0.2.0
Parallel CFD LBM Solver
Loading...
Searching...
No Matches
VelocityBC Class Reference

A class provides an interface for velocity boundary condition in grid generator. More...

#include <VelocityBC.h>

Inheritance diagram for VelocityBC:
BC

Public Member Functions

 VelocityBC ()
 
 VelocityBC (const bool &vx1, const bool &vx2, const bool &vx3, const BCFunction &velVxBC)
 
 VelocityBC (const bool &vx1, const bool &vx2, const bool &vx3, const mu::Parser &function, const real &startTime, const real &endTime)
 
 VelocityBC (const bool &vx1, const bool &vx2, const bool &vx3, const mu::Parser &function1, const mu::Parser &function2, const mu::Parser &function3, const real &startTime, const real &endTime)
 
 VelocityBC (const bool &vx1, const bool &vx2, const bool &vx3, const std::string &functionstring, const real &startTime, const real &endTime)
 
 VelocityBC (const BCFunction &velBC, bool x1Dir, bool x2Dir, bool x3Dir)
 
 VelocityBC (const BCFunction &velVx1BC, const BCFunction &velVx2BC, const BCFunction &velVx3BC)
 
 VelocityBC (const std::vector< BCFunction > &velVx1BCs, const std::vector< BCFunction > &velVx2BCs, const std::vector< BCFunction > &velVx3BCs)
 
 VelocityBC (const real &vx1, const real &vx1StartTime, const real &vx1EndTime, const real &vx2, const real &vx2StartTime, const real &vx2EndTime, const real &vx3, const real &vx3StartTime, const real &vx3EndTime)
 
 VelocityBC (const std::string &vx1Function, const real &vx1StartTime, const real &vx1EndTime, const std::string &vx2Function, const real &vx2StartTime, const real &vx2EndTime, const std::string &vx3Function, const real &vx3StartTime, const real &vx3EndTime)
 
void setTimePeriodic ()
 
void unsetTimePeriodic ()
 
bool isTimePeriodic ()
 
void setNewVelocities (const real &vx1, const real &vx1StartTime, const real &vx1EndTime, const real &vx2, const real &vx2StartTime, const real &vx2EndTime, const real &vx3, const real &vx3StartTime, const real &vx3EndTime)
 
std::string toString ()
 
void init (const D3Q27Interactor *const &interactor, const real &time=0) override
 
void update (const D3Q27Interactor *const &interactor, const real &time=0) override
 
void adaptBCForDirection (const D3Q27Interactor &interactor, SPtr< BoundaryConditions > bc, const real &worldX1, const real &worldX2, const real &worldX3, const real &q, const int &fdirection, const real &time=0) override
 
void adaptBC (const D3Q27Interactor &interactor, SPtr< BoundaryConditions > bc, const real &worldX1, const real &worldX2, const real &worldX3, const real &time=0) override
 
UbTupleDouble3 getVelocity (const real &x1, const real &x2, const real &x3, const real &timeStep) const
 
- Public Member Functions inherited from BC
 BC ()=default
 
 BC (const short &secondaryBcOption)
 
virtual ~BC ()=default
 
bool isTimeDependent ()
 
virtual short getSecondaryBcOption ()
 
virtual void setSecondaryBcOption (const short &val)
 
void setBCStrategy (SPtr< BCStrategy > bcStrategy)
 

Protected Member Functions

void init ()
 
void init (std::vector< BCFunction > &vxBCs)
 
void setTimeDependent ()
 
void unsetTimeDependent ()
 
void clear ()
 
void setNodeVelocity (const D3Q27Interactor &interactor, SPtr< BoundaryConditions > bc, const real &worldX1, const real &worldX2, const real &worldX3, const real &timestep)
 

Additional Inherited Members

- Protected Attributes inherited from BC
short secondaryBcOption { 0 }
 
char type { 0 }
 
char bcStrategyKey { 0 }
 
- Static Protected Attributes inherited from BC
static const char TIMEDEPENDENT = 1 << 0
 
static const char TIMEPERIODIC = 1 << 1
 
static char keyCounter = 0
 

Detailed Description

A class provides an interface for velocity boundary condition in grid generator.

Example:

vector<BCFunction> vx1BCs,vx2BCs,vx3BCs;
vx1BCs.push_back(BCFunction(0.01 , 0 , 100) ); //t=[0 ..100[ -> vx1 = 0.01
vx1BCs.push_back(BCFunction(0.004, 100, 200) ); //t=[100..200[ -> vx1 = 0.004
vx1BCs.push_back(BCFunction(0.03 , 200, 400) ); //t=[200..400] -> vx1 = 0.03
vx2BCs.push_back(BCFunction(0.02 , 0 , 200) ); //t=[0 ..200[ -> vx2 = 0.02
vx2BCs.push_back(BCFunction(0.002, 200, 300) ); //t=[200..300[ -> vx2 = 0.002
vx2BCs.push_back(BCFunction(0.043, 300, 600) ); //t=[300..600] -> vx2 = 0.043
VelocityBC BC(vx1BCs,vx2BCs,vx3BCs);
BC.setTimePeriodic(); //-> t=[0 ..100[ -> vx1 = 0.01
// t=[100..200[ -> vx1 = 0.004
// t=[200..400[ -> vx1 = 0.03
// t=[400..500[ -> vx1 = 0.01
// t=[500..600[ -> vx1 = 0.004
// t=[600..800[ -> vx1 = 0.03 ...
// t=[0 ..200[ -> vx2 = 0.02
// t=[200..300[ -> vx2 = 0.002
// t=[300..600] -> vx2 = 0.043
// t=[600..800[ -> vx2 = 0.02
// t=[800..900[ -> vx2 = 0.002
// t=[900..1200]-> vx2 = 0.043 ...
A class implements function parcer for boundary conditions.
Definition BCFunction.h:45
Abstract class of baundary conditions adapter.
Definition BC.h:48
BC()=default
A class provides an interface for velocity boundary condition in grid generator.
Definition VelocityBC.h:84
std::shared_ptr< T > SPtr

Example of parabolic inflow:

mu::Parser fct;
fct.SetExpr("max(vmax*(1.0-4.0*((x2-x2_vmax)^2+(x3-x3_vmax)^2)/H^2),0.0)"); //paraboloid (with vmax for
(0/x2_vmax/x3_vmax) fct.DefineConst("x2Vmax", 0.0 ); //x2-Pos für vmax fct.DefineConst("x3Vmax", 0.0
); //x3-Pos für vmax fct.DefineConst("H" , diameterOfPipe); fct.DefineConst("vmax" , vmax );
VelocityBC velBC(true, false ,false ,fct, 0, BCFunction::INFCONST);
static const real INFCONST
Definition BCFunction.h:48

Definition at line 83 of file VelocityBC.h.

Constructor & Destructor Documentation

◆ VelocityBC() [1/4]

VelocityBC::VelocityBC ( )
inline

Definition at line 87 of file VelocityBC.h.

◆ VelocityBC() [2/4]

VelocityBC::VelocityBC ( const bool vx1,
const bool vx2,
const bool vx3,
const std::string &  functionstring,
const real startTime,
const real endTime 
)

◆ VelocityBC() [3/4]

VelocityBC::VelocityBC ( const std::vector< BCFunction > &  velVx1BCs,
const std::vector< BCFunction > &  velVx2BCs,
const std::vector< BCFunction > &  velVx3BCs 
)

◆ VelocityBC() [4/4]

VelocityBC::VelocityBC ( const std::string &  vx1Function,
const real vx1StartTime,
const real vx1EndTime,
const std::string &  vx2Function,
const real vx2StartTime,
const real vx2EndTime,
const std::string &  vx3Function,
const real vx3StartTime,
const real vx3EndTime 
)

Member Function Documentation

◆ clear()

void VelocityBC::clear ( )
inlineprotected

Definition at line 150 of file VelocityBC.h.

◆ isTimePeriodic()

bool VelocityBC::isTimePeriodic ( )
inline

Definition at line 119 of file VelocityBC.h.

◆ setTimeDependent()

void VelocityBC::setTimeDependent ( )
inlineprotected

Definition at line 147 of file VelocityBC.h.

◆ setTimePeriodic()

void VelocityBC::setTimePeriodic ( )
inline

Definition at line 117 of file VelocityBC.h.

◆ unsetTimeDependent()

void VelocityBC::unsetTimeDependent ( )
inlineprotected

Definition at line 148 of file VelocityBC.h.

◆ unsetTimePeriodic()

void VelocityBC::unsetTimePeriodic ( )
inline

Definition at line 118 of file VelocityBC.h.


The documentation for this class was generated from the following files: