Loading src/Examples/turbulent-flows/two-equation-model/KOmega-model/BoundaryConditions/Boiler/DisipationBoundaryConditionBoiler.h +9 −18 Original line number Original line Diff line number Diff line Loading @@ -129,8 +129,7 @@ class DisipationBoundaryConditionsBoiler< Meshes::Grid< 1, MeshReal, Device, Mes const auto& neighborEntities = entity.getNeighborEntities(); const auto& neighborEntities = entity.getNeighborEntities(); const IndexType& index = entity.getIndex(); const IndexType& index = entity.getIndex(); if( entity.getCoordinates().x() == 0 ) if( entity.getCoordinates().x() == 0 ) return this->turbulenceConstant return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ) ) * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ), ( 3.0 / 2.0 ) ) / this->lengthScale; / this->lengthScale; else else return u[ neighborEntities.template getEntityIndex< -1 >() ]; return u[ neighborEntities.template getEntityIndex< -1 >() ]; Loading Loading @@ -279,8 +278,7 @@ class DisipationBoundaryConditionsBoiler< Meshes::Grid< 2, MeshReal, Device, Mes if( entity.getCoordinates().x() == 0 ) if( entity.getCoordinates().x() == 0 ) { { if( ( entity.getCoordinates().y() < 0.20 * ( entity.getMesh().getDimensions().y() - 1 ) ) && ( entity.getCoordinates().y() > 0.19 * ( entity.getMesh().getDimensions().y() - 1 ) ) ) if( ( entity.getCoordinates().y() < 0.20 * ( entity.getMesh().getDimensions().y() - 1 ) ) && ( entity.getCoordinates().y() > 0.19 * ( entity.getMesh().getDimensions().y() - 1 ) ) ) return this->turbulenceConstant return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ) ) * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ), ( 3.0 / 2.0 ) ) / this->lengthScale; / this->lengthScale; else else return u[ neighborEntities.template getEntityIndex< 0, 0 >() ]; return u[ neighborEntities.template getEntityIndex< 0, 0 >() ]; Loading @@ -304,8 +302,7 @@ class DisipationBoundaryConditionsBoiler< Meshes::Grid< 2, MeshReal, Device, Mes if( entity.getCoordinates().x() == entity.getMesh().getDimensions().x() - 1 ) if( entity.getCoordinates().x() == entity.getMesh().getDimensions().x() - 1 ) { { if( ( entity.getCoordinates().y() < 0.20 * ( entity.getMesh().getDimensions().y() - 1 ) ) && ( entity.getCoordinates().y() > 0.19 * ( entity.getMesh().getDimensions().y() - 1 ) ) ) if( ( entity.getCoordinates().y() < 0.20 * ( entity.getMesh().getDimensions().y() - 1 ) ) && ( entity.getCoordinates().y() > 0.19 * ( entity.getMesh().getDimensions().y() - 1 ) ) ) return this->turbulenceConstant return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ) ) * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ), ( 3.0 / 2.0 ) ) / this->lengthScale; / this->lengthScale; else if( entity.getCoordinates().y() > 0.8 * ( entity.getMesh().getDimensions().y() - 1 ) && false ) else if( entity.getCoordinates().y() > 0.8 * ( entity.getMesh().getDimensions().y() - 1 ) && false ) return u[ neighborEntities.template getEntityIndex< 0, 0 >() ]; return u[ neighborEntities.template getEntityIndex< 0, 0 >() ]; Loading @@ -330,8 +327,7 @@ class DisipationBoundaryConditionsBoiler< Meshes::Grid< 2, MeshReal, Device, Mes if( entity.getCoordinates().y() == 0 ) if( entity.getCoordinates().y() == 0 ) { { if( ( entity.getCoordinates().x() < 0.6 * ( entity.getMesh().getDimensions().x() - 1 ) ) && ( entity.getCoordinates().x() > 0.4 * ( entity.getMesh().getDimensions().x() - 1 ) ) ) if( ( entity.getCoordinates().x() < 0.6 * ( entity.getMesh().getDimensions().x() - 1 ) ) && ( entity.getCoordinates().x() > 0.4 * ( entity.getMesh().getDimensions().x() - 1 ) ) ) return this->turbulenceConstant return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ) ) * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ), ( 3.0 / 2.0 ) ) / this->lengthScale; / this->lengthScale; else else return u[ neighborEntities.template getEntityIndex< 0, 0 >() ]; return u[ neighborEntities.template getEntityIndex< 0, 0 >() ]; Loading Loading @@ -527,8 +523,7 @@ class DisipationBoundaryConditionsBoiler< Meshes::Grid< 3, MeshReal, Device, Mes { { if( ( entity.getCoordinates().y() < 0.59 * ( entity.getMesh().getDimensions().y() - 1 ) ) && ( entity.getCoordinates().y() > 0.39 * ( entity.getMesh().getDimensions().y() - 1 ) ) if( ( entity.getCoordinates().y() < 0.59 * ( entity.getMesh().getDimensions().y() - 1 ) ) && ( entity.getCoordinates().y() > 0.39 * ( entity.getMesh().getDimensions().y() - 1 ) ) &&( entity.getCoordinates().z() < 0.59 * ( entity.getMesh().getDimensions().z() - 1 ) ) && ( entity.getCoordinates().z() > 0.39 * ( entity.getMesh().getDimensions().z() - 1 ) ) ) &&( entity.getCoordinates().z() < 0.59 * ( entity.getMesh().getDimensions().z() - 1 ) ) && ( entity.getCoordinates().z() > 0.39 * ( entity.getMesh().getDimensions().z() - 1 ) ) ) return this->turbulenceConstant return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ) ) * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ), ( 3.0 / 2.0 ) ) / this->lengthScale; / this->lengthScale; else else return u[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ]; return u[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ]; Loading @@ -537,8 +532,7 @@ class DisipationBoundaryConditionsBoiler< Meshes::Grid< 3, MeshReal, Device, Mes { { if( ( entity.getCoordinates().y() < 0.59 * ( entity.getMesh().getDimensions().y() - 1 ) ) && ( entity.getCoordinates().y() > 0.39 * ( entity.getMesh().getDimensions().y() - 1 ) ) if( ( entity.getCoordinates().y() < 0.59 * ( entity.getMesh().getDimensions().y() - 1 ) ) && ( entity.getCoordinates().y() > 0.39 * ( entity.getMesh().getDimensions().y() - 1 ) ) &&( entity.getCoordinates().z() < 0.59 * ( entity.getMesh().getDimensions().z() - 1 ) ) && ( entity.getCoordinates().z() > 0.39 * ( entity.getMesh().getDimensions().z() - 1 ) ) ) &&( entity.getCoordinates().z() < 0.59 * ( entity.getMesh().getDimensions().z() - 1 ) ) && ( entity.getCoordinates().z() > 0.39 * ( entity.getMesh().getDimensions().z() - 1 ) ) ) return this->turbulenceConstant return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ) ) * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ), ( 3.0 / 2.0 ) ) / this->lengthScale; / this->lengthScale; else if( entity.getCoordinates().y() >0.8 * ( entity.getMesh().getDimensions().y() - 1 ) ) else if( entity.getCoordinates().y() >0.8 * ( entity.getMesh().getDimensions().y() - 1 ) ) return u[ neighborEntities.template getEntityIndex< -1, 0, 0 >() ]; return u[ neighborEntities.template getEntityIndex< -1, 0, 0 >() ]; Loading @@ -549,8 +543,7 @@ class DisipationBoundaryConditionsBoiler< Meshes::Grid< 3, MeshReal, Device, Mes { { if( ( entity.getCoordinates().x() < 0.59 * ( entity.getMesh().getDimensions().x() - 1 ) ) && ( entity.getCoordinates().x() > 0.39 * ( entity.getMesh().getDimensions().x() - 1 ) ) if( ( entity.getCoordinates().x() < 0.59 * ( entity.getMesh().getDimensions().x() - 1 ) ) && ( entity.getCoordinates().x() > 0.39 * ( entity.getMesh().getDimensions().x() - 1 ) ) &&( entity.getCoordinates().z() < 0.59 * ( entity.getMesh().getDimensions().z() - 1 ) ) && ( entity.getCoordinates().z() > 0.39 * ( entity.getMesh().getDimensions().z() - 1 ) ) ) &&( entity.getCoordinates().z() < 0.59 * ( entity.getMesh().getDimensions().z() - 1 ) ) && ( entity.getCoordinates().z() > 0.39 * ( entity.getMesh().getDimensions().z() - 1 ) ) ) return this->turbulenceConstant return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ) ) * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ), ( 3.0 / 2.0 ) ) / this->lengthScale; / this->lengthScale; else else return u[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ]; return u[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ]; Loading @@ -559,8 +552,7 @@ class DisipationBoundaryConditionsBoiler< Meshes::Grid< 3, MeshReal, Device, Mes { { if( ( entity.getCoordinates().x() < 0.59 * ( entity.getMesh().getDimensions().x() - 1 ) ) && ( entity.getCoordinates().x() > 0.39 * ( entity.getMesh().getDimensions().x() - 1 ) ) if( ( entity.getCoordinates().x() < 0.59 * ( entity.getMesh().getDimensions().x() - 1 ) ) && ( entity.getCoordinates().x() > 0.39 * ( entity.getMesh().getDimensions().x() - 1 ) ) &&( entity.getCoordinates().z() < 0.59 * ( entity.getMesh().getDimensions().z() - 1 ) ) && ( entity.getCoordinates().z() > 0.39 * ( entity.getMesh().getDimensions().z() - 1 ) ) ) &&( entity.getCoordinates().z() < 0.59 * ( entity.getMesh().getDimensions().z() - 1 ) ) && ( entity.getCoordinates().z() > 0.39 * ( entity.getMesh().getDimensions().z() - 1 ) ) ) return this->turbulenceConstant return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ) ) * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ), ( 3.0 / 2.0 ) ) / this->lengthScale; / this->lengthScale; else else return u[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ]; return u[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ]; Loading @@ -569,8 +561,7 @@ class DisipationBoundaryConditionsBoiler< Meshes::Grid< 3, MeshReal, Device, Mes { { if( ( entity.getCoordinates().x() < 0.6 * ( entity.getMesh().getDimensions().y() - 1 ) ) && ( entity.getCoordinates().y() > 0.4 * ( entity.getMesh().getDimensions().y() - 1 ) ) if( ( entity.getCoordinates().x() < 0.6 * ( entity.getMesh().getDimensions().y() - 1 ) ) && ( entity.getCoordinates().y() > 0.4 * ( entity.getMesh().getDimensions().y() - 1 ) ) &&( entity.getCoordinates().y() < 0.6 * ( entity.getMesh().getDimensions().z() - 1 ) ) && ( entity.getCoordinates().z() > 0.4 * ( entity.getMesh().getDimensions().z() - 1 ) ) ) &&( entity.getCoordinates().y() < 0.6 * ( entity.getMesh().getDimensions().z() - 1 ) ) && ( entity.getCoordinates().z() > 0.4 * ( entity.getMesh().getDimensions().z() - 1 ) ) ) return this->turbulenceConstant return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ) ) * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ), ( 3.0 / 2.0 ) ) / this->lengthScale; / this->lengthScale; else else Loading src/Examples/turbulent-flows/two-equation-model/KOmega-model/BoundaryConditions/BoilerModel/DisipationBoundaryConditionBoilerModel.h +15 −26 Original line number Original line Diff line number Diff line Loading @@ -129,8 +129,7 @@ class DisipationBoundaryConditionsBoilerModel< Meshes::Grid< 1, MeshReal, Device const auto& neighborEntities = entity.getNeighborEntities(); const auto& neighborEntities = entity.getNeighborEntities(); const IndexType& index = entity.getIndex(); const IndexType& index = entity.getIndex(); if( entity.getCoordinates().x() == 0 ) if( entity.getCoordinates().x() == 0 ) return this->turbulenceConstant return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ) ) * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ), ( 3.0 / 2.0 ) ) / this->lengthScale; / this->lengthScale; else else return u[ neighborEntities.template getEntityIndex< -1 >() ]; return u[ neighborEntities.template getEntityIndex< -1 >() ]; Loading Loading @@ -337,8 +336,7 @@ class DisipationBoundaryConditionsBoilerModel< Meshes::Grid< 2, MeshReal, Device ) ) // throttle Disipation // throttle Disipation { { return this->turbulenceConstant return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ) ) * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ), ( 3.0 / 2.0 ) ) / this->lengthScale; / this->lengthScale; } } return u[ neighborEntities.template getEntityIndex< 0, 0 >() ]; return u[ neighborEntities.template getEntityIndex< 0, 0 >() ]; Loading Loading @@ -385,8 +383,7 @@ class DisipationBoundaryConditionsBoilerModel< Meshes::Grid< 2, MeshReal, Device ) ) // throttle Disipation // throttle Disipation { { return this->turbulenceConstant return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ) ) * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ), ( 3.0 / 2.0 ) ) / this->lengthScale; / this->lengthScale; } } // if for chimney exit // if for chimney exit Loading @@ -397,7 +394,8 @@ class DisipationBoundaryConditionsBoilerModel< Meshes::Grid< 2, MeshReal, Device if( ( entity.getCoordinates().x() < 0.592 * ( entity.getMesh().getDimensions().x() - 1 ) ) if( ( entity.getCoordinates().x() < 0.592 * ( entity.getMesh().getDimensions().x() - 1 ) ) && && ( entity.getCoordinates().x() > 0.408 * ( entity.getMesh().getDimensions().x() - 1 ) ) ) ( entity.getCoordinates().x() > 0.408 * ( entity.getMesh().getDimensions().x() - 1 ) ) ) return 2.0/3.0 * this->intensity * this->intensity * this->verticalThrottleSpeed * this->verticalThrottleSpeed; return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->verticalThrottleSpeed * this->verticalThrottleSpeed ) ) / this->lengthScale; return u[ neighborEntities.template getEntityIndex< 0, 0 >() ]; return u[ neighborEntities.template getEntityIndex< 0, 0 >() ]; } } // The following line is commented to avoid compiler warning // The following line is commented to avoid compiler warning Loading Loading @@ -619,12 +617,10 @@ const RealType operator()( const MeshFunction& u, // if for y axis // if for y axis { { if( entity.getCoordinates().y() < 0.08 * std::cos( this->xYAngle ) * ( entity.getMesh().getDimensions().y() - 1 ) ) if( entity.getCoordinates().y() < 0.08 * std::cos( this->xYAngle ) * ( entity.getMesh().getDimensions().y() - 1 ) ) return this->turbulenceConstant return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ) ) * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ), ( 3.0 / 2.0 ) ) / this->lengthScale; / this->lengthScale; if ( entity.getCoordinates().y() > ( 1 - 0.08 * std::sin( this->xYAngle ) ) * ( entity.getMesh().getDimensions().y() - 1 ) ) if ( entity.getCoordinates().y() > ( 1 - 0.08 * std::sin( this->xYAngle ) ) * ( entity.getMesh().getDimensions().y() - 1 ) ) return this->turbulenceConstant return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ) ) * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ), ( 3.0 / 2.0 ) ) / this->lengthScale; / this->lengthScale; return u[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ]; return u[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ]; } } Loading Loading @@ -673,12 +669,10 @@ const RealType operator()( const MeshFunction& u, // if for y axis // if for y axis { { if( entity.getCoordinates().y() < 0.08 * std::sin( this->xYAngle ) * ( entity.getMesh().getDimensions().y() - 1 ) ) if( entity.getCoordinates().y() < 0.08 * std::sin( this->xYAngle ) * ( entity.getMesh().getDimensions().y() - 1 ) ) return this->turbulenceConstant return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ) ) * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ), ( 3.0 / 2.0 ) ) / this->lengthScale; / this->lengthScale; if ( entity.getCoordinates().y() > ( 1 - 0.08 * std::cos( this->xYAngle ) ) * ( entity.getMesh().getDimensions().y() - 1 ) ) if ( entity.getCoordinates().y() > ( 1 - 0.08 * std::cos( this->xYAngle ) ) * ( entity.getMesh().getDimensions().y() - 1 ) ) return this->turbulenceConstant return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ) ) * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ), ( 3.0 / 2.0 ) ) / this->lengthScale; / this->lengthScale; return u[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ]; return u[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ]; // if for chimney exit // if for chimney exit Loading Loading @@ -728,12 +722,10 @@ const RealType operator()( const MeshFunction& u, // if for x axis // if for x axis { { if( entity.getCoordinates().x() < 0.08 * std::sin( this->xYAngle ) * ( entity.getMesh().getDimensions().x() - 1 ) ) if( entity.getCoordinates().x() < 0.08 * std::sin( this->xYAngle ) * ( entity.getMesh().getDimensions().x() - 1 ) ) return this->turbulenceConstant return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ) ) * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ), ( 3.0 / 2.0 ) ) / this->lengthScale; / this->lengthScale; if ( entity.getCoordinates().x() > ( 1 - 0.08 * std::cos( this->xYAngle ) ) * ( entity.getMesh().getDimensions().x() - 1 ) ) if ( entity.getCoordinates().x() > ( 1 - 0.08 * std::cos( this->xYAngle ) ) * ( entity.getMesh().getDimensions().x() - 1 ) ) return this->turbulenceConstant return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ) ) * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ), ( 3.0 / 2.0 ) ) / this->lengthScale; / this->lengthScale; return u[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ]; return u[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ]; Loading Loading @@ -783,12 +775,10 @@ const RealType operator()( const MeshFunction& u, // if for x axis // if for x axis { { if( entity.getCoordinates().x() < 0.08 * std::cos( this->xYAngle ) * ( entity.getMesh().getDimensions().x() - 1 ) ) if( entity.getCoordinates().x() < 0.08 * std::cos( this->xYAngle ) * ( entity.getMesh().getDimensions().x() - 1 ) ) return this->turbulenceConstant return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ) ) * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ), ( 3.0 / 2.0 ) ) / this->lengthScale; / this->lengthScale; if ( entity.getCoordinates().x() > ( 1 - 0.08 * std::sin( this->xYAngle ) ) * ( entity.getMesh().getDimensions().x() - 1 ) ) if ( entity.getCoordinates().x() > ( 1 - 0.08 * std::sin( this->xYAngle ) ) * ( entity.getMesh().getDimensions().x() - 1 ) ) return this->turbulenceConstant return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ) ) * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ), ( 3.0 / 2.0 ) ) / this->lengthScale; / this->lengthScale; return u[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ]; return u[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ]; } } Loading @@ -798,8 +788,7 @@ const RealType operator()( const MeshFunction& u, { { if( ( entity.getCoordinates().y() < 0.592 * ( entity.getMesh().getDimensions().y() - 1 ) ) && ( entity.getCoordinates().y() > 0.408 * ( entity.getMesh().getDimensions().y() - 1 ) ) ) if( ( entity.getCoordinates().y() < 0.592 * ( entity.getMesh().getDimensions().y() - 1 ) ) && ( entity.getCoordinates().y() > 0.408 * ( entity.getMesh().getDimensions().y() - 1 ) ) ) // &&( entity.getCoordinates().y() < 0.6 * ( entity.getMesh().getDimensions().z() - 1 ) ) && ( entity.getCoordinates().z() > 0.4 * ( entity.getMesh().getDimensions().z() - 1 ) ) ) // &&( entity.getCoordinates().y() < 0.6 * ( entity.getMesh().getDimensions().z() - 1 ) ) && ( entity.getCoordinates().z() > 0.4 * ( entity.getMesh().getDimensions().z() - 1 ) ) ) return this->turbulenceConstant return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->verticalThrottleSpeed * this->verticalThrottleSpeed ) ) * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ), ( 3.0 / 2.0 ) ) / this->lengthScale; / this->lengthScale; return u[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ]; return u[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ]; } } Loading src/Examples/turbulent-flows/two-equation-model/KOmega-model/BoundaryConditions/Cavity/DisipationBoundaryConditionCavity.h +4 −7 Original line number Original line Diff line number Diff line Loading @@ -128,8 +128,7 @@ class DisipationBoundaryConditionsCavity< Meshes::Grid< 1, MeshReal, Device, Mes const auto& neighborEntities = entity.getNeighborEntities(); const auto& neighborEntities = entity.getNeighborEntities(); const IndexType& index = entity.getIndex(); const IndexType& index = entity.getIndex(); if( entity.getCoordinates().x() == 0 ) if( entity.getCoordinates().x() == 0 ) return this->turbulenceConstant return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ) ) * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ), ( 3.0 / 2.0 ) ) / this->lengthScale; / this->lengthScale; else else return u[ neighborEntities.template getEntityIndex< -1 >() ]; return u[ neighborEntities.template getEntityIndex< -1 >() ]; Loading Loading @@ -290,8 +289,7 @@ class DisipationBoundaryConditionsCavity< Meshes::Grid< 2, MeshReal, Device, Mes // The following line is commented to avoid compiler warning // The following line is commented to avoid compiler warning //if( entity.getCoordinates().y() == entity.getMesh().getDimensions().y() - 1 ) //if( entity.getCoordinates().y() == entity.getMesh().getDimensions().y() - 1 ) { { return this->turbulenceConstant return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ) ) * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ), ( 3.0 / 2.0 ) ) / this->lengthScale; / this->lengthScale; } } } } Loading Loading @@ -469,8 +467,7 @@ class DisipationBoundaryConditionsCavity< Meshes::Grid< 3, MeshReal, Device, Mes // The following line is commented to avoid compiler warning // The following line is commented to avoid compiler warning //if( entity.getCoordinates().z() == entity.getMesh().getDimensions().z() - 1 ) //if( entity.getCoordinates().z() == entity.getMesh().getDimensions().z() - 1 ) { { return this->turbulenceConstant return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ) ) * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ), ( 3.0 / 2.0 ) ) / this->lengthScale; / this->lengthScale; } } } } Loading src/Examples/turbulent-flows/two-equation-model/KOmega-model/PhysicalVariablesGetter.h +7 −16 Original line number Original line Diff line number Diff line Loading @@ -147,11 +147,9 @@ class PhysicalVariablesGetter public: public: typedef typename MeshType::RealType RealType; typedef typename MeshType::RealType RealType; TurbulentViscosityGetter( MeshFunctionPointer density, TurbulentViscosityGetter( MeshFunctionPointer turbulentEnergy, MeshFunctionPointer turbulentEnergy, RealType turbulenceConstant, MeshFunctionPointer disipation ) MeshFunctionPointer disipation ) : density( density ), turbulentEnergy( turbulentEnergy ), turbulenceConstant( turbulenceConstant ), disipation( disipation ) {} :turbulentEnergy( turbulentEnergy ), disipation( disipation ) {} template< typename EntityType > template< typename EntityType > __cuda_callable__ __cuda_callable__ Loading @@ -161,15 +159,12 @@ class PhysicalVariablesGetter if( disipation.template getData< DeviceType >()( meshEntity ) == 0.0 ) if( disipation.template getData< DeviceType >()( meshEntity ) == 0.0 ) return 0; return 0; else else return density.template getData< DeviceType >()( meshEntity ) * turbulenceConstant return turbulentEnergy.template getData< DeviceType >()( meshEntity ) * turbulentEnergy.template getData< DeviceType >()( meshEntity ) * turbulentEnergy.template getData< DeviceType >()( meshEntity ) / disipation.template getData< DeviceType >()( meshEntity ); / disipation.template getData< DeviceType >()( meshEntity ); } } protected: protected: const MeshFunctionPointer density, turbulentEnergy, disipation; const MeshFunctionPointer disipation, turbulentEnergy; const RealType turbulenceConstant; }; }; Loading Loading @@ -221,18 +216,14 @@ class PhysicalVariablesGetter } } } } void getTurbulentViscosity( const ConservativeVariablesPointer& conservativeVariables, void getTurbulentViscosity( MeshFunctionPointer& turbulentEnergy_no_rho, MeshFunctionPointer& turbulentEnergy_no_rho, MeshFunctionPointer& disipation_no_rho, MeshFunctionPointer& disipation_no_rho, const RealType& turbulenceConstant, MeshFunctionPointer& turbulentViscosity ) MeshFunctionPointer& turbulentViscosity ) { { Functions::MeshFunctionEvaluator< MeshFunctionType, TurbulentViscosityGetter > evaluator; Functions::MeshFunctionEvaluator< MeshFunctionType, TurbulentViscosityGetter > evaluator; for( int i = 0; i < Dimensions; i++ ) for( int i = 0; i < Dimensions; i++ ) { { Pointers::SharedPointer< TurbulentViscosityGetter, DeviceType > turbulentViscosityGetter( conservativeVariables->getDensity(), Pointers::SharedPointer< TurbulentViscosityGetter, DeviceType > turbulentViscosityGetter( turbulentEnergy_no_rho, turbulentEnergy_no_rho, turbulenceConstant, disipation_no_rho); disipation_no_rho); evaluator.evaluate( turbulentViscosity, turbulentViscosityGetter ); evaluator.evaluate( turbulentViscosity, turbulentViscosityGetter ); } } Loading src/Examples/turbulent-flows/two-equation-model/KOmega-model/RiemannProblemInitialCondition.h +16 −16 File changed.Preview size limit exceeded, changes collapsed. Show changes Loading
src/Examples/turbulent-flows/two-equation-model/KOmega-model/BoundaryConditions/Boiler/DisipationBoundaryConditionBoiler.h +9 −18 Original line number Original line Diff line number Diff line Loading @@ -129,8 +129,7 @@ class DisipationBoundaryConditionsBoiler< Meshes::Grid< 1, MeshReal, Device, Mes const auto& neighborEntities = entity.getNeighborEntities(); const auto& neighborEntities = entity.getNeighborEntities(); const IndexType& index = entity.getIndex(); const IndexType& index = entity.getIndex(); if( entity.getCoordinates().x() == 0 ) if( entity.getCoordinates().x() == 0 ) return this->turbulenceConstant return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ) ) * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ), ( 3.0 / 2.0 ) ) / this->lengthScale; / this->lengthScale; else else return u[ neighborEntities.template getEntityIndex< -1 >() ]; return u[ neighborEntities.template getEntityIndex< -1 >() ]; Loading Loading @@ -279,8 +278,7 @@ class DisipationBoundaryConditionsBoiler< Meshes::Grid< 2, MeshReal, Device, Mes if( entity.getCoordinates().x() == 0 ) if( entity.getCoordinates().x() == 0 ) { { if( ( entity.getCoordinates().y() < 0.20 * ( entity.getMesh().getDimensions().y() - 1 ) ) && ( entity.getCoordinates().y() > 0.19 * ( entity.getMesh().getDimensions().y() - 1 ) ) ) if( ( entity.getCoordinates().y() < 0.20 * ( entity.getMesh().getDimensions().y() - 1 ) ) && ( entity.getCoordinates().y() > 0.19 * ( entity.getMesh().getDimensions().y() - 1 ) ) ) return this->turbulenceConstant return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ) ) * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ), ( 3.0 / 2.0 ) ) / this->lengthScale; / this->lengthScale; else else return u[ neighborEntities.template getEntityIndex< 0, 0 >() ]; return u[ neighborEntities.template getEntityIndex< 0, 0 >() ]; Loading @@ -304,8 +302,7 @@ class DisipationBoundaryConditionsBoiler< Meshes::Grid< 2, MeshReal, Device, Mes if( entity.getCoordinates().x() == entity.getMesh().getDimensions().x() - 1 ) if( entity.getCoordinates().x() == entity.getMesh().getDimensions().x() - 1 ) { { if( ( entity.getCoordinates().y() < 0.20 * ( entity.getMesh().getDimensions().y() - 1 ) ) && ( entity.getCoordinates().y() > 0.19 * ( entity.getMesh().getDimensions().y() - 1 ) ) ) if( ( entity.getCoordinates().y() < 0.20 * ( entity.getMesh().getDimensions().y() - 1 ) ) && ( entity.getCoordinates().y() > 0.19 * ( entity.getMesh().getDimensions().y() - 1 ) ) ) return this->turbulenceConstant return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ) ) * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ), ( 3.0 / 2.0 ) ) / this->lengthScale; / this->lengthScale; else if( entity.getCoordinates().y() > 0.8 * ( entity.getMesh().getDimensions().y() - 1 ) && false ) else if( entity.getCoordinates().y() > 0.8 * ( entity.getMesh().getDimensions().y() - 1 ) && false ) return u[ neighborEntities.template getEntityIndex< 0, 0 >() ]; return u[ neighborEntities.template getEntityIndex< 0, 0 >() ]; Loading @@ -330,8 +327,7 @@ class DisipationBoundaryConditionsBoiler< Meshes::Grid< 2, MeshReal, Device, Mes if( entity.getCoordinates().y() == 0 ) if( entity.getCoordinates().y() == 0 ) { { if( ( entity.getCoordinates().x() < 0.6 * ( entity.getMesh().getDimensions().x() - 1 ) ) && ( entity.getCoordinates().x() > 0.4 * ( entity.getMesh().getDimensions().x() - 1 ) ) ) if( ( entity.getCoordinates().x() < 0.6 * ( entity.getMesh().getDimensions().x() - 1 ) ) && ( entity.getCoordinates().x() > 0.4 * ( entity.getMesh().getDimensions().x() - 1 ) ) ) return this->turbulenceConstant return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ) ) * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ), ( 3.0 / 2.0 ) ) / this->lengthScale; / this->lengthScale; else else return u[ neighborEntities.template getEntityIndex< 0, 0 >() ]; return u[ neighborEntities.template getEntityIndex< 0, 0 >() ]; Loading Loading @@ -527,8 +523,7 @@ class DisipationBoundaryConditionsBoiler< Meshes::Grid< 3, MeshReal, Device, Mes { { if( ( entity.getCoordinates().y() < 0.59 * ( entity.getMesh().getDimensions().y() - 1 ) ) && ( entity.getCoordinates().y() > 0.39 * ( entity.getMesh().getDimensions().y() - 1 ) ) if( ( entity.getCoordinates().y() < 0.59 * ( entity.getMesh().getDimensions().y() - 1 ) ) && ( entity.getCoordinates().y() > 0.39 * ( entity.getMesh().getDimensions().y() - 1 ) ) &&( entity.getCoordinates().z() < 0.59 * ( entity.getMesh().getDimensions().z() - 1 ) ) && ( entity.getCoordinates().z() > 0.39 * ( entity.getMesh().getDimensions().z() - 1 ) ) ) &&( entity.getCoordinates().z() < 0.59 * ( entity.getMesh().getDimensions().z() - 1 ) ) && ( entity.getCoordinates().z() > 0.39 * ( entity.getMesh().getDimensions().z() - 1 ) ) ) return this->turbulenceConstant return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ) ) * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ), ( 3.0 / 2.0 ) ) / this->lengthScale; / this->lengthScale; else else return u[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ]; return u[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ]; Loading @@ -537,8 +532,7 @@ class DisipationBoundaryConditionsBoiler< Meshes::Grid< 3, MeshReal, Device, Mes { { if( ( entity.getCoordinates().y() < 0.59 * ( entity.getMesh().getDimensions().y() - 1 ) ) && ( entity.getCoordinates().y() > 0.39 * ( entity.getMesh().getDimensions().y() - 1 ) ) if( ( entity.getCoordinates().y() < 0.59 * ( entity.getMesh().getDimensions().y() - 1 ) ) && ( entity.getCoordinates().y() > 0.39 * ( entity.getMesh().getDimensions().y() - 1 ) ) &&( entity.getCoordinates().z() < 0.59 * ( entity.getMesh().getDimensions().z() - 1 ) ) && ( entity.getCoordinates().z() > 0.39 * ( entity.getMesh().getDimensions().z() - 1 ) ) ) &&( entity.getCoordinates().z() < 0.59 * ( entity.getMesh().getDimensions().z() - 1 ) ) && ( entity.getCoordinates().z() > 0.39 * ( entity.getMesh().getDimensions().z() - 1 ) ) ) return this->turbulenceConstant return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ) ) * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ), ( 3.0 / 2.0 ) ) / this->lengthScale; / this->lengthScale; else if( entity.getCoordinates().y() >0.8 * ( entity.getMesh().getDimensions().y() - 1 ) ) else if( entity.getCoordinates().y() >0.8 * ( entity.getMesh().getDimensions().y() - 1 ) ) return u[ neighborEntities.template getEntityIndex< -1, 0, 0 >() ]; return u[ neighborEntities.template getEntityIndex< -1, 0, 0 >() ]; Loading @@ -549,8 +543,7 @@ class DisipationBoundaryConditionsBoiler< Meshes::Grid< 3, MeshReal, Device, Mes { { if( ( entity.getCoordinates().x() < 0.59 * ( entity.getMesh().getDimensions().x() - 1 ) ) && ( entity.getCoordinates().x() > 0.39 * ( entity.getMesh().getDimensions().x() - 1 ) ) if( ( entity.getCoordinates().x() < 0.59 * ( entity.getMesh().getDimensions().x() - 1 ) ) && ( entity.getCoordinates().x() > 0.39 * ( entity.getMesh().getDimensions().x() - 1 ) ) &&( entity.getCoordinates().z() < 0.59 * ( entity.getMesh().getDimensions().z() - 1 ) ) && ( entity.getCoordinates().z() > 0.39 * ( entity.getMesh().getDimensions().z() - 1 ) ) ) &&( entity.getCoordinates().z() < 0.59 * ( entity.getMesh().getDimensions().z() - 1 ) ) && ( entity.getCoordinates().z() > 0.39 * ( entity.getMesh().getDimensions().z() - 1 ) ) ) return this->turbulenceConstant return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ) ) * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ), ( 3.0 / 2.0 ) ) / this->lengthScale; / this->lengthScale; else else return u[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ]; return u[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ]; Loading @@ -559,8 +552,7 @@ class DisipationBoundaryConditionsBoiler< Meshes::Grid< 3, MeshReal, Device, Mes { { if( ( entity.getCoordinates().x() < 0.59 * ( entity.getMesh().getDimensions().x() - 1 ) ) && ( entity.getCoordinates().x() > 0.39 * ( entity.getMesh().getDimensions().x() - 1 ) ) if( ( entity.getCoordinates().x() < 0.59 * ( entity.getMesh().getDimensions().x() - 1 ) ) && ( entity.getCoordinates().x() > 0.39 * ( entity.getMesh().getDimensions().x() - 1 ) ) &&( entity.getCoordinates().z() < 0.59 * ( entity.getMesh().getDimensions().z() - 1 ) ) && ( entity.getCoordinates().z() > 0.39 * ( entity.getMesh().getDimensions().z() - 1 ) ) ) &&( entity.getCoordinates().z() < 0.59 * ( entity.getMesh().getDimensions().z() - 1 ) ) && ( entity.getCoordinates().z() > 0.39 * ( entity.getMesh().getDimensions().z() - 1 ) ) ) return this->turbulenceConstant return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ) ) * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ), ( 3.0 / 2.0 ) ) / this->lengthScale; / this->lengthScale; else else return u[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ]; return u[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ]; Loading @@ -569,8 +561,7 @@ class DisipationBoundaryConditionsBoiler< Meshes::Grid< 3, MeshReal, Device, Mes { { if( ( entity.getCoordinates().x() < 0.6 * ( entity.getMesh().getDimensions().y() - 1 ) ) && ( entity.getCoordinates().y() > 0.4 * ( entity.getMesh().getDimensions().y() - 1 ) ) if( ( entity.getCoordinates().x() < 0.6 * ( entity.getMesh().getDimensions().y() - 1 ) ) && ( entity.getCoordinates().y() > 0.4 * ( entity.getMesh().getDimensions().y() - 1 ) ) &&( entity.getCoordinates().y() < 0.6 * ( entity.getMesh().getDimensions().z() - 1 ) ) && ( entity.getCoordinates().z() > 0.4 * ( entity.getMesh().getDimensions().z() - 1 ) ) ) &&( entity.getCoordinates().y() < 0.6 * ( entity.getMesh().getDimensions().z() - 1 ) ) && ( entity.getCoordinates().z() > 0.4 * ( entity.getMesh().getDimensions().z() - 1 ) ) ) return this->turbulenceConstant return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ) ) * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ), ( 3.0 / 2.0 ) ) / this->lengthScale; / this->lengthScale; else else Loading
src/Examples/turbulent-flows/two-equation-model/KOmega-model/BoundaryConditions/BoilerModel/DisipationBoundaryConditionBoilerModel.h +15 −26 Original line number Original line Diff line number Diff line Loading @@ -129,8 +129,7 @@ class DisipationBoundaryConditionsBoilerModel< Meshes::Grid< 1, MeshReal, Device const auto& neighborEntities = entity.getNeighborEntities(); const auto& neighborEntities = entity.getNeighborEntities(); const IndexType& index = entity.getIndex(); const IndexType& index = entity.getIndex(); if( entity.getCoordinates().x() == 0 ) if( entity.getCoordinates().x() == 0 ) return this->turbulenceConstant return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ) ) * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ), ( 3.0 / 2.0 ) ) / this->lengthScale; / this->lengthScale; else else return u[ neighborEntities.template getEntityIndex< -1 >() ]; return u[ neighborEntities.template getEntityIndex< -1 >() ]; Loading Loading @@ -337,8 +336,7 @@ class DisipationBoundaryConditionsBoilerModel< Meshes::Grid< 2, MeshReal, Device ) ) // throttle Disipation // throttle Disipation { { return this->turbulenceConstant return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ) ) * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ), ( 3.0 / 2.0 ) ) / this->lengthScale; / this->lengthScale; } } return u[ neighborEntities.template getEntityIndex< 0, 0 >() ]; return u[ neighborEntities.template getEntityIndex< 0, 0 >() ]; Loading Loading @@ -385,8 +383,7 @@ class DisipationBoundaryConditionsBoilerModel< Meshes::Grid< 2, MeshReal, Device ) ) // throttle Disipation // throttle Disipation { { return this->turbulenceConstant return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ) ) * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ), ( 3.0 / 2.0 ) ) / this->lengthScale; / this->lengthScale; } } // if for chimney exit // if for chimney exit Loading @@ -397,7 +394,8 @@ class DisipationBoundaryConditionsBoilerModel< Meshes::Grid< 2, MeshReal, Device if( ( entity.getCoordinates().x() < 0.592 * ( entity.getMesh().getDimensions().x() - 1 ) ) if( ( entity.getCoordinates().x() < 0.592 * ( entity.getMesh().getDimensions().x() - 1 ) ) && && ( entity.getCoordinates().x() > 0.408 * ( entity.getMesh().getDimensions().x() - 1 ) ) ) ( entity.getCoordinates().x() > 0.408 * ( entity.getMesh().getDimensions().x() - 1 ) ) ) return 2.0/3.0 * this->intensity * this->intensity * this->verticalThrottleSpeed * this->verticalThrottleSpeed; return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->verticalThrottleSpeed * this->verticalThrottleSpeed ) ) / this->lengthScale; return u[ neighborEntities.template getEntityIndex< 0, 0 >() ]; return u[ neighborEntities.template getEntityIndex< 0, 0 >() ]; } } // The following line is commented to avoid compiler warning // The following line is commented to avoid compiler warning Loading Loading @@ -619,12 +617,10 @@ const RealType operator()( const MeshFunction& u, // if for y axis // if for y axis { { if( entity.getCoordinates().y() < 0.08 * std::cos( this->xYAngle ) * ( entity.getMesh().getDimensions().y() - 1 ) ) if( entity.getCoordinates().y() < 0.08 * std::cos( this->xYAngle ) * ( entity.getMesh().getDimensions().y() - 1 ) ) return this->turbulenceConstant return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ) ) * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ), ( 3.0 / 2.0 ) ) / this->lengthScale; / this->lengthScale; if ( entity.getCoordinates().y() > ( 1 - 0.08 * std::sin( this->xYAngle ) ) * ( entity.getMesh().getDimensions().y() - 1 ) ) if ( entity.getCoordinates().y() > ( 1 - 0.08 * std::sin( this->xYAngle ) ) * ( entity.getMesh().getDimensions().y() - 1 ) ) return this->turbulenceConstant return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ) ) * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ), ( 3.0 / 2.0 ) ) / this->lengthScale; / this->lengthScale; return u[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ]; return u[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ]; } } Loading Loading @@ -673,12 +669,10 @@ const RealType operator()( const MeshFunction& u, // if for y axis // if for y axis { { if( entity.getCoordinates().y() < 0.08 * std::sin( this->xYAngle ) * ( entity.getMesh().getDimensions().y() - 1 ) ) if( entity.getCoordinates().y() < 0.08 * std::sin( this->xYAngle ) * ( entity.getMesh().getDimensions().y() - 1 ) ) return this->turbulenceConstant return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ) ) * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ), ( 3.0 / 2.0 ) ) / this->lengthScale; / this->lengthScale; if ( entity.getCoordinates().y() > ( 1 - 0.08 * std::cos( this->xYAngle ) ) * ( entity.getMesh().getDimensions().y() - 1 ) ) if ( entity.getCoordinates().y() > ( 1 - 0.08 * std::cos( this->xYAngle ) ) * ( entity.getMesh().getDimensions().y() - 1 ) ) return this->turbulenceConstant return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ) ) * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ), ( 3.0 / 2.0 ) ) / this->lengthScale; / this->lengthScale; return u[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ]; return u[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ]; // if for chimney exit // if for chimney exit Loading Loading @@ -728,12 +722,10 @@ const RealType operator()( const MeshFunction& u, // if for x axis // if for x axis { { if( entity.getCoordinates().x() < 0.08 * std::sin( this->xYAngle ) * ( entity.getMesh().getDimensions().x() - 1 ) ) if( entity.getCoordinates().x() < 0.08 * std::sin( this->xYAngle ) * ( entity.getMesh().getDimensions().x() - 1 ) ) return this->turbulenceConstant return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ) ) * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ), ( 3.0 / 2.0 ) ) / this->lengthScale; / this->lengthScale; if ( entity.getCoordinates().x() > ( 1 - 0.08 * std::cos( this->xYAngle ) ) * ( entity.getMesh().getDimensions().x() - 1 ) ) if ( entity.getCoordinates().x() > ( 1 - 0.08 * std::cos( this->xYAngle ) ) * ( entity.getMesh().getDimensions().x() - 1 ) ) return this->turbulenceConstant return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ) ) * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ), ( 3.0 / 2.0 ) ) / this->lengthScale; / this->lengthScale; return u[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ]; return u[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ]; Loading Loading @@ -783,12 +775,10 @@ const RealType operator()( const MeshFunction& u, // if for x axis // if for x axis { { if( entity.getCoordinates().x() < 0.08 * std::cos( this->xYAngle ) * ( entity.getMesh().getDimensions().x() - 1 ) ) if( entity.getCoordinates().x() < 0.08 * std::cos( this->xYAngle ) * ( entity.getMesh().getDimensions().x() - 1 ) ) return this->turbulenceConstant return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ) ) * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ), ( 3.0 / 2.0 ) ) / this->lengthScale; / this->lengthScale; if ( entity.getCoordinates().x() > ( 1 - 0.08 * std::sin( this->xYAngle ) ) * ( entity.getMesh().getDimensions().x() - 1 ) ) if ( entity.getCoordinates().x() > ( 1 - 0.08 * std::sin( this->xYAngle ) ) * ( entity.getMesh().getDimensions().x() - 1 ) ) return this->turbulenceConstant return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ) ) * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ), ( 3.0 / 2.0 ) ) / this->lengthScale; / this->lengthScale; return u[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ]; return u[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ]; } } Loading @@ -798,8 +788,7 @@ const RealType operator()( const MeshFunction& u, { { if( ( entity.getCoordinates().y() < 0.592 * ( entity.getMesh().getDimensions().y() - 1 ) ) && ( entity.getCoordinates().y() > 0.408 * ( entity.getMesh().getDimensions().y() - 1 ) ) ) if( ( entity.getCoordinates().y() < 0.592 * ( entity.getMesh().getDimensions().y() - 1 ) ) && ( entity.getCoordinates().y() > 0.408 * ( entity.getMesh().getDimensions().y() - 1 ) ) ) // &&( entity.getCoordinates().y() < 0.6 * ( entity.getMesh().getDimensions().z() - 1 ) ) && ( entity.getCoordinates().z() > 0.4 * ( entity.getMesh().getDimensions().z() - 1 ) ) ) // &&( entity.getCoordinates().y() < 0.6 * ( entity.getMesh().getDimensions().z() - 1 ) ) && ( entity.getCoordinates().z() > 0.4 * ( entity.getMesh().getDimensions().z() - 1 ) ) ) return this->turbulenceConstant return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->verticalThrottleSpeed * this->verticalThrottleSpeed ) ) * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ), ( 3.0 / 2.0 ) ) / this->lengthScale; / this->lengthScale; return u[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ]; return u[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ]; } } Loading
src/Examples/turbulent-flows/two-equation-model/KOmega-model/BoundaryConditions/Cavity/DisipationBoundaryConditionCavity.h +4 −7 Original line number Original line Diff line number Diff line Loading @@ -128,8 +128,7 @@ class DisipationBoundaryConditionsCavity< Meshes::Grid< 1, MeshReal, Device, Mes const auto& neighborEntities = entity.getNeighborEntities(); const auto& neighborEntities = entity.getNeighborEntities(); const IndexType& index = entity.getIndex(); const IndexType& index = entity.getIndex(); if( entity.getCoordinates().x() == 0 ) if( entity.getCoordinates().x() == 0 ) return this->turbulenceConstant return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ) ) * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ), ( 3.0 / 2.0 ) ) / this->lengthScale; / this->lengthScale; else else return u[ neighborEntities.template getEntityIndex< -1 >() ]; return u[ neighborEntities.template getEntityIndex< -1 >() ]; Loading Loading @@ -290,8 +289,7 @@ class DisipationBoundaryConditionsCavity< Meshes::Grid< 2, MeshReal, Device, Mes // The following line is commented to avoid compiler warning // The following line is commented to avoid compiler warning //if( entity.getCoordinates().y() == entity.getMesh().getDimensions().y() - 1 ) //if( entity.getCoordinates().y() == entity.getMesh().getDimensions().y() - 1 ) { { return this->turbulenceConstant return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ) ) * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ), ( 3.0 / 2.0 ) ) / this->lengthScale; / this->lengthScale; } } } } Loading Loading @@ -469,8 +467,7 @@ class DisipationBoundaryConditionsCavity< Meshes::Grid< 3, MeshReal, Device, Mes // The following line is commented to avoid compiler warning // The following line is commented to avoid compiler warning //if( entity.getCoordinates().z() == entity.getMesh().getDimensions().z() - 1 ) //if( entity.getCoordinates().z() == entity.getMesh().getDimensions().z() - 1 ) { { return this->turbulenceConstant return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ) ) * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ), ( 3.0 / 2.0 ) ) / this->lengthScale; / this->lengthScale; } } } } Loading
src/Examples/turbulent-flows/two-equation-model/KOmega-model/PhysicalVariablesGetter.h +7 −16 Original line number Original line Diff line number Diff line Loading @@ -147,11 +147,9 @@ class PhysicalVariablesGetter public: public: typedef typename MeshType::RealType RealType; typedef typename MeshType::RealType RealType; TurbulentViscosityGetter( MeshFunctionPointer density, TurbulentViscosityGetter( MeshFunctionPointer turbulentEnergy, MeshFunctionPointer turbulentEnergy, RealType turbulenceConstant, MeshFunctionPointer disipation ) MeshFunctionPointer disipation ) : density( density ), turbulentEnergy( turbulentEnergy ), turbulenceConstant( turbulenceConstant ), disipation( disipation ) {} :turbulentEnergy( turbulentEnergy ), disipation( disipation ) {} template< typename EntityType > template< typename EntityType > __cuda_callable__ __cuda_callable__ Loading @@ -161,15 +159,12 @@ class PhysicalVariablesGetter if( disipation.template getData< DeviceType >()( meshEntity ) == 0.0 ) if( disipation.template getData< DeviceType >()( meshEntity ) == 0.0 ) return 0; return 0; else else return density.template getData< DeviceType >()( meshEntity ) * turbulenceConstant return turbulentEnergy.template getData< DeviceType >()( meshEntity ) * turbulentEnergy.template getData< DeviceType >()( meshEntity ) * turbulentEnergy.template getData< DeviceType >()( meshEntity ) / disipation.template getData< DeviceType >()( meshEntity ); / disipation.template getData< DeviceType >()( meshEntity ); } } protected: protected: const MeshFunctionPointer density, turbulentEnergy, disipation; const MeshFunctionPointer disipation, turbulentEnergy; const RealType turbulenceConstant; }; }; Loading Loading @@ -221,18 +216,14 @@ class PhysicalVariablesGetter } } } } void getTurbulentViscosity( const ConservativeVariablesPointer& conservativeVariables, void getTurbulentViscosity( MeshFunctionPointer& turbulentEnergy_no_rho, MeshFunctionPointer& turbulentEnergy_no_rho, MeshFunctionPointer& disipation_no_rho, MeshFunctionPointer& disipation_no_rho, const RealType& turbulenceConstant, MeshFunctionPointer& turbulentViscosity ) MeshFunctionPointer& turbulentViscosity ) { { Functions::MeshFunctionEvaluator< MeshFunctionType, TurbulentViscosityGetter > evaluator; Functions::MeshFunctionEvaluator< MeshFunctionType, TurbulentViscosityGetter > evaluator; for( int i = 0; i < Dimensions; i++ ) for( int i = 0; i < Dimensions; i++ ) { { Pointers::SharedPointer< TurbulentViscosityGetter, DeviceType > turbulentViscosityGetter( conservativeVariables->getDensity(), Pointers::SharedPointer< TurbulentViscosityGetter, DeviceType > turbulentViscosityGetter( turbulentEnergy_no_rho, turbulentEnergy_no_rho, turbulenceConstant, disipation_no_rho); disipation_no_rho); evaluator.evaluate( turbulentViscosity, turbulentViscosityGetter ); evaluator.evaluate( turbulentViscosity, turbulentViscosityGetter ); } } Loading
src/Examples/turbulent-flows/two-equation-model/KOmega-model/RiemannProblemInitialCondition.h +16 −16 File changed.Preview size limit exceeded, changes collapsed. Show changes