34#ifndef BoundaryCondition_H
35#define BoundaryCondition_H
56class TransientBCInputFileReader;
58namespace grid_generator
67 std::vector<std::vector<real>>
qs;
104 return vf::gpu::BC_PRESSURE;
132 return vf::gpu::BC_SLIP;
139 this->normalXList.push_back(
normalX);
140 this->normalYList.push_back(
normalY);
141 this->normalZList.push_back(
normalZ);
187 return vf::gpu::BC_STRESS;
192 std::fill_n(std::back_inserter(this->normalXList), this->
indices.size(), normalX);
193 std::fill_n(std::back_inserter(this->normalYList), this->
indices.size(), normalY);
194 std::fill_n(std::back_inserter(this->normalZList), this->
indices.size(), normalZ);
196 std::fill_n(std::back_inserter(this->roughnessLengthList), this->
indices.size(), roughnessLength);
267 return this->roughnessLengthTemperatureList[index];
275 return this->surfaceHeatFluxList[index];
283 return this->surfaceTemperatureList[index];
291 return this->heatingRateList[index];
313 return vf::gpu::BC_VELOCITY;
318 for(
uint index : this->indices ) {
320 this->vxList.push_back(
vx);
321 this->vyList.push_back(
vy);
322 this->vzList.push_back(
vz);
363 return vf::gpu::BC_SOLID;
367 for(
uint index = 0; index < this->
indices.size(); index++ ){
369 this->vxList[index] =
vx;
370 this->vyList[index] =
vy;
371 this->vzList[index] =
vz;
385 this->vxList.push_back(
vx);
386 this->vyList.push_back(
vy);
387 this->vzList.push_back(
vz);
404 this->normalXList.push_back(
normalX);
405 this->normalYList.push_back(
normalY);
406 this->normalZList.push_back(
normalZ);
435 char getType()
const override
437 return vf::gpu::BC_VELOCITY;
441 real velocityX = 0.0;
442 real velocityY = 0.0;
443 real velocityZ = 0.0;
461 return vf::gpu::BC_AD;
485 return vf::gpu::BC_AD;
514 return vf::gpu::BC_AD;
519 std::fill_n(std::back_inserter(this->vxList), this->
indices.size(), vx);
520 std::fill_n(std::back_inserter(this->vyList), this->
indices.size(), vy);
521 std::fill_n(std::back_inserter(this->vzList), this->
indices.size(), vz);
522 std::fill_n(std::back_inserter(this->BCvalueList), this->
indices.size(), BCvalue);
536 real BCvalue, vx, vy, vz;
537 std::vector<real> BCvalueList, vxList, vyList, vzList;
557 return vf::gpu::BC_AD;
584 return vf::gpu::BC_AD;
void fillBoundaryValueLists()
real getBCvalue(uint index)
static SPtr< ADDirichletBoundaryCondition > make(real BCvalue, real vx, real vy, real vz)
ADDirichletBoundaryCondition(real BCValue, real vx, real vy, real vz)
char getType() const override
std::vector< real > gradientList
real getNormalY(uint index)
std::vector< real > normalXList
char getType() const override
static SPtr< ADFluxBoundaryCondition > make(real normalX, real normalY, real normalZ, real gradient)
real getGradient(uint index)
std::vector< real > normalZList
real getNormalZ(uint index)
ADFluxBoundaryCondition(real normalX, real normalY, real normalZ, real gradient)
void fillBoundaryValueLists()
real getNormalX(uint index)
std::vector< real > normalYList
std::vector< real > vxList
std::vector< real > gradientList
static SPtr< ADNeumannBoundaryCondition > make(real BCvalue, real vx, real vy, real vz)
void fillBoundaryValueLists()
real getBCgradient() const
ADNeumannBoundaryCondition(real gradient, real vx, real vy, real vz)
char getType() const override
std::vector< real > vzList
real getBCgradient(uint index)
std::vector< real > vyList
ADNoFluxBoundaryCondition()=default
char getType() const override
static SPtr< ADNoFluxBoundaryCondition > make()
char getType() const override
std::vector< uint > neighborIndices
ADOutflowBoundaryCondition()=default
void setAdditionalIndices(const SPtr< Grid > &grid, uint index) override
static SPtr< ADOutflowBoundaryCondition > make()
std::vector< real > vyList
std::vector< real > normalYList
static SPtr< GeometryBoundaryCondition > make()
std::vector< real > vzList
char getType() const override
void setTangentialVelocityForPatch(SPtr< Grid > grid, uint patch, real p1x, real p1y, real p1z, real p2x, real p2y, real p2z, real v, real r)
real getNormaly(uint index)
real getNormalz(uint index)
real getNormalx(uint index)
std::vector< real > vxList
void fillSlipNormalLists()
void setVelocityForPatch(uint patch, real vx, real vy, real vz)
std::vector< real > normalZList
std::vector< real > normalXList
real getVelocityZ() const
real getVelocityY() const
real getVelocityX() const
void setReader(SPtr< TransientBCInputFileReader > newReader)
SPtr< TransientBCInputFileReader > getReader()
static SPtr< PrecursorBoundaryCondition > make(real velocityX, real velocityY, real velocityZ)
void setAdditionalIndices(const SPtr< Grid > &grid, uint index) override
PressureBoundaryCondition(real rho)
char getType() const override
std::vector< uint > neighborIndices
static SPtr< PressureBoundaryCondition > make(real rho)
SlipBoundaryCondition(real normalX, real normalY, real normalZ)
std::vector< real > normalZList
std::vector< real > normalYList
void fillSlipNormalLists()
char getType() const override
real getNormaly(uint index)
static SPtr< SlipBoundaryCondition > make(real normalX, real normalY, real normalZ)
real getNormalz(uint index)
std::vector< real > normalXList
real getNormalx(uint index)
real getNormaly(uint index) const
uint getSamplingOffset() const
std::vector< uint > samplingIndices
char getType() const override
std::vector< real > roughnessLengthList
const real roughnessLength
static SPtr< StressBoundaryCondition > make(real normalX, real normalY, real normalZ, uint samplingOffset, real vonKarmanConstant, real roughnessLength, std::shared_ptr< GbSpatialData3D< real > > roughnessMap)
std::vector< real > normalYList
void setAdditionalIndices(const SPtr< Grid > &grid, uint index) override
real getRoughnessLength(uint index) const
real getNormalz(uint index) const
real getNormalx(uint index) const
StressBoundaryCondition(real normalX, real normalY, real normalZ, uint samplingOffset, real vonKarmanConstant, real roughnessLength, std::shared_ptr< GbSpatialData3D< real > > roughnessMap)
std::vector< real > samplingDistanceList
real getSamplingDistance(uint index) const
real getRoughnessLength() const
std::shared_ptr< GbSpatialData3D< real > > roughnessMap
real getVonKarmanConstant() const
const uint samplingOffset
std::vector< real > normalZList
uint getSamplingIndex(uint index) const
const real vonKarmanConstant
std::vector< real > normalXList
real getSurfaceTemperature() const
real getHeatingRate() const
SurfaceLayerBoundaryCondition(real normalX, real normalY, real normalZ, uint samplingOffset, real vonKarmanConstant, real roughnessLength, real roughnessLengthTemperature, real surfaceHeatFlux, real surfaceTemperature, real heatingRate, std::shared_ptr< GbSpatialData3D< real > > roughnessMap)
real getSurfaceHeatFlux() const
real getRoughnessLengthTemperature(uint index)
real getSurfaceTemperature(uint index)
real getHeatingRate(uint index)
std::vector< real > roughnessLengthTemperatureList
real roughnessLengthTemperature
std::vector< real > surfaceHeatFluxList
static SPtr< SurfaceLayerBoundaryCondition > make(real normalX, real normalY, real normalZ, uint samplingOffset, real vonKarmanConstant, real roughnessLength, real roughnessLengthTemperature, real surfaceHeatFlux, real surfaceTemperature, real heatingRate, std::shared_ptr< GbSpatialData3D< real > > roughnessMap)
real getSurfaceHeatFlux(uint index)
real getRoughnessLengthTemperature() const
std::vector< real > heatingRateList
std::vector< real > surfaceTemperatureList
std::vector< real > vyList
std::vector< real > vzList
char getType() const override
VelocityBoundaryCondition(real vx, real vy, real vz)
static SPtr< VelocityBoundaryCondition > make(real vx, real vy, real vz)
void setVelocityProfile(SPtr< Grid > grid, std::function< void(real, real, real, real &, real &, real &)> velocityProfile)
std::vector< real > vxList
void getCoords(SPtr< Grid > grid, std::vector< real > &x, std::vector< real > &y, std::vector< real > &z)
virtual void setAdditionalIndices(const SPtr< Grid > &, uint)
virtual ~BoundaryCondition()=default
bool isSide(SideType side) const
virtual char getType() const =0
std::vector< std::vector< real > > qs
real getQ(uint index, uint dir)
std::vector< uint > patches
std::vector< uint > indices
std::shared_ptr< T > SPtr