Loading src/Examples/flows/BoundaryConditions/Boiler/BoundaryConditionsBoiler.h +16 −0 Original line number Diff line number Diff line Loading @@ -99,6 +99,22 @@ class BoundaryConditionsBoiler this->energyBoundaryConditionsPointer->setCavitySpeed(cavitySpeed); } void setHorizontalThrottleSpeed(const RealType startSpeed, const RealType finalSpeed, const RealType time, const RealType finalTime ) { } void setVerticalThrottleSpeed(const RealType startSpeed, const RealType finalSpeed, const RealType time, const RealType finalTime ) { } DensityBoundaryConditionsTypePointer& getDensityBoundaryCondition() { return this->densityBoundaryConditionsPointer; Loading src/Examples/flows/BoundaryConditions/BoilerModel/BoundaryConditionsBoilerModel.h +39 −4 Original line number Diff line number Diff line Loading @@ -115,10 +115,45 @@ class BoundaryConditionsBoilerModel void setSpeed(const RealType cavitySpeed) { this->momentumXBoundaryConditionsPointer->setCavitySpeed(cavitySpeed); this->momentumYBoundaryConditionsPointer->setCavitySpeed(cavitySpeed); this->momentumZBoundaryConditionsPointer->setCavitySpeed(cavitySpeed); this->energyBoundaryConditionsPointer->setCavitySpeed(cavitySpeed); } void setHorizontalThrottleSpeed(const RealType startSpeed, const RealType finalSpeed, const RealType time, const RealType finalTime ) { RealType horizontalThrottleSpeed = 0; if(time <= finalTime) if( time != 0 || finalTime != 0 ) horizontalThrottleSpeed = startSpeed + ( finalSpeed - startSpeed ) / ( time / finalTime ); else horizontalThrottleSpeed = 0; else horizontalThrottleSpeed = finalSpeed; this->momentumXBoundaryConditionsPointer->setHorizontalThrottleSpeed(horizontalThrottleSpeed); this->momentumYBoundaryConditionsPointer->setHorizontalThrottleSpeed(horizontalThrottleSpeed); this->momentumZBoundaryConditionsPointer->setHorizontalThrottleSpeed(horizontalThrottleSpeed); this->energyBoundaryConditionsPointer->setHorizontalThrottleSpeed(horizontalThrottleSpeed); } void setVerticalThrottleSpeed(const RealType startSpeed, const RealType finalSpeed, const RealType time, const RealType finalTime ) { RealType verticalThrottleSpeed = 0; if(time <= finalTime) if( time != 0 || finalTime != 0 ) verticalThrottleSpeed = startSpeed + ( finalSpeed - startSpeed ) / ( time / finalTime ); else verticalThrottleSpeed = 0; else verticalThrottleSpeed = finalSpeed; this->momentumXBoundaryConditionsPointer->setVerticalThrottleSpeed(verticalThrottleSpeed); this->momentumYBoundaryConditionsPointer->setVerticalThrottleSpeed(verticalThrottleSpeed); this->momentumZBoundaryConditionsPointer->setVerticalThrottleSpeed(verticalThrottleSpeed); this->energyBoundaryConditionsPointer->setVerticalThrottleSpeed(verticalThrottleSpeed); } DensityBoundaryConditionsTypePointer& getDensityBoundaryCondition() Loading src/Examples/flows/BoundaryConditions/BoilerModel/EnergyBoundaryConditionBoilerModel.h +79 −35 Original line number Diff line number Diff line Loading @@ -208,9 +208,14 @@ class EnergyBoundaryConditionsBoilerModel< Meshes::Grid< 1, MeshReal, Device, Me this->pressure = pressure; } void setCavitySpeed(const RealType cavitySpeed) void setHorizontalThrottleSpeed(const RealType horizontalThrottleSpeed) { this->cavitySpeed = cavitySpeed; this->horizontalThrottleSpeed = horizontalThrottleSpeed; } void setVerticalThrottleSpeed(const RealType verticalThrottleSpeed) { this->verticalThrottleSpeed = verticalThrottleSpeed; } void setZAngle(const RealType zAngle) Loading @@ -226,7 +231,8 @@ class EnergyBoundaryConditionsBoilerModel< Meshes::Grid< 1, MeshReal, Device, Me private: CompressibleConservativeVariablesPointer compressibleConservativeVariables; RealType timestep; RealType cavitySpeed; RealType horizontalThrottleSpeed; RealType verticalThrottleSpeed; RealType gamma; MeshFunctionPointer pressure; RealType zAngle; Loading Loading @@ -328,9 +334,9 @@ class EnergyBoundaryConditionsBoilerModel< Meshes::Grid< 2, MeshReal, Device, Me + 0.5 * (* this->compressibleConservativeVariables->getDensity())[neighborEntities.template getEntityIndex< 0, 0 >()] * ( this->cavitySpeed this->horizontalThrottleSpeed * this->cavitySpeed this->horizontalThrottleSpeed ); } return u[ neighborEntities.template getEntityIndex< 0, 0 >() ]; Loading Loading @@ -383,14 +389,26 @@ class EnergyBoundaryConditionsBoilerModel< Meshes::Grid< 2, MeshReal, Device, Me + 0.5 * (* this->compressibleConservativeVariables->getDensity())[neighborEntities.template getEntityIndex< 0, 0 >()] * ( this->cavitySpeed this->horizontalThrottleSpeed * this->cavitySpeed this->horizontalThrottleSpeed ); } // if for chimney exit if( entity.getCoordinates().y() > 0.835 * ( entity.getMesh().getDimensions().y() - 1 ) ) return u[ neighborEntities.template getEntityIndex< -1, 0 >() ]; if( (* this->compressibleConservativeVariables->getDensity())[neighborEntities.template getEntityIndex< 0, 0 >()] != 0 ) return ( (* this->pressure)[ neighborEntities.template getEntityIndex< 0, 0 >() ] / ( this->gamma - 1 ) ) + 0.5 * ( ( (* ( *this->compressibleConservativeVariables->getMomentum() )[ 0 ] )[neighborEntities.template getEntityIndex< 0, 0 >()] * (* ( *this->compressibleConservativeVariables->getMomentum() )[ 0 ] )[neighborEntities.template getEntityIndex< 0, 0 >()] + (* ( *this->compressibleConservativeVariables->getMomentum() )[ 1 ] )[neighborEntities.template getEntityIndex< 0, 0 >()] * (* ( *this->compressibleConservativeVariables->getMomentum() )[ 1 ] )[neighborEntities.template getEntityIndex< 0, 0 >()] ) / (* this->compressibleConservativeVariables->getDensity())[neighborEntities.template getEntityIndex< 0, 0 >()] ); else return u[ neighborEntities.template getEntityIndex< -1, 0 >() ]; return u[ neighborEntities.template getEntityIndex< 0, 0 >() ]; } if( entity.getCoordinates().y() == 0 ) Loading @@ -404,9 +422,9 @@ class EnergyBoundaryConditionsBoilerModel< Meshes::Grid< 2, MeshReal, Device, Me + 0.5 * (* this->compressibleConservativeVariables->getDensity())[neighborEntities.template getEntityIndex< 0, 0 >()] * ( this->cavitySpeed this->verticalThrottleSpeed * this->cavitySpeed this->verticalThrottleSpeed ); return u[ neighborEntities.template getEntityIndex< 0, 0 >() ]; } Loading Loading @@ -491,9 +509,14 @@ class EnergyBoundaryConditionsBoilerModel< Meshes::Grid< 2, MeshReal, Device, Me this->pressure = pressure; } void setCavitySpeed(const RealType cavitySpeed) void setHorizontalThrottleSpeed(const RealType horizontalThrottleSpeed) { this->horizontalThrottleSpeed = horizontalThrottleSpeed; } void setVerticalThrottleSpeed(const RealType verticalThrottleSpeed) { this->cavitySpeed = cavitySpeed; this->verticalThrottleSpeed = verticalThrottleSpeed; } void setZAngle(const RealType zAngle) Loading @@ -509,7 +532,8 @@ class EnergyBoundaryConditionsBoilerModel< Meshes::Grid< 2, MeshReal, Device, Me private: CompressibleConservativeVariablesPointer compressibleConservativeVariables; RealType timestep; RealType cavitySpeed; RealType horizontalThrottleSpeed; RealType verticalThrottleSpeed; RealType gamma; MeshFunctionPointer pressure; RealType zAngle; Loading Loading @@ -610,9 +634,9 @@ const RealType operator()( const MeshFunction& u, + 0.5 * (* this->compressibleConservativeVariables->getDensity())[neighborEntities.template getEntityIndex< 0, 0, 0 >()] * ( this->cavitySpeed this->horizontalThrottleSpeed * this->cavitySpeed this->horizontalThrottleSpeed ); if ( entity.getCoordinates().y() > ( 1 - 0.08 * std::sin( this->xYAngle ) ) * ( entity.getMesh().getDimensions().y() - 1 ) ) return ( (* this->pressure)[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ] Loading @@ -621,9 +645,9 @@ const RealType operator()( const MeshFunction& u, + 0.5 * (* this->compressibleConservativeVariables->getDensity())[neighborEntities.template getEntityIndex< 0, 0, 0 >()] * ( this->cavitySpeed this->horizontalThrottleSpeed * this->cavitySpeed this->horizontalThrottleSpeed ); return u[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ]; } Loading Loading @@ -678,9 +702,9 @@ const RealType operator()( const MeshFunction& u, + 0.5 * (* this->compressibleConservativeVariables->getDensity())[neighborEntities.template getEntityIndex< 0, 0, 0 >()] * ( this->cavitySpeed this->horizontalThrottleSpeed * this->cavitySpeed this->horizontalThrottleSpeed ); if ( entity.getCoordinates().y() > ( 1 - 0.08 * std::cos( this->xYAngle ) ) * ( entity.getMesh().getDimensions().y() - 1 ) ) return ( (* this->pressure)[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ] Loading @@ -689,16 +713,30 @@ const RealType operator()( const MeshFunction& u, + 0.5 * (* this->compressibleConservativeVariables->getDensity())[neighborEntities.template getEntityIndex< 0, 0, 0 >()] * ( this->cavitySpeed this->horizontalThrottleSpeed * this->cavitySpeed this->horizontalThrottleSpeed ); return u[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ]; // if for chimney exit } if( entity.getCoordinates().z() > 0.835 * ( entity.getMesh().getDimensions().z() - 1 ) ) return u[ neighborEntities.template getEntityIndex< -1, 0, 0 >() ]; if( (* this->compressibleConservativeVariables->getDensity())[neighborEntities.template getEntityIndex< 0, 0, 0 >()] != 0 ) return ( (* this->pressure)[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ] / ( this->gamma - 1 ) ) + 0.5 * ( ( (* ( *this->compressibleConservativeVariables->getMomentum() )[ 0 ] )[neighborEntities.template getEntityIndex< 0, 0, 0 >()] * (* ( *this->compressibleConservativeVariables->getMomentum() )[ 0 ] )[neighborEntities.template getEntityIndex< 0, 0, 0 >()] + (* ( *this->compressibleConservativeVariables->getMomentum() )[ 1 ] )[neighborEntities.template getEntityIndex< 0, 0, 0 >()] * (* ( *this->compressibleConservativeVariables->getMomentum() )[ 1 ] )[neighborEntities.template getEntityIndex< 0, 0, 0 >()] + (* ( *this->compressibleConservativeVariables->getMomentum() )[ 2 ] )[neighborEntities.template getEntityIndex< 0, 0, 0 >()] * (* ( *this->compressibleConservativeVariables->getMomentum() )[ 2 ] )[neighborEntities.template getEntityIndex< 0, 0, 0 >()] ) / (* this->compressibleConservativeVariables->getDensity())[neighborEntities.template getEntityIndex< 0, 0, 0 >()] ); else return u[ neighborEntities.template getEntityIndex< -1, 0, 0 >() ]; return u[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ]; } if( entity.getCoordinates().y() == 0 ) Loading Loading @@ -750,9 +788,9 @@ const RealType operator()( const MeshFunction& u, + 0.5 * (* this->compressibleConservativeVariables->getDensity())[neighborEntities.template getEntityIndex< 0, 0, 0 >()] * ( this->cavitySpeed this->horizontalThrottleSpeed * this->cavitySpeed this->horizontalThrottleSpeed ); if ( entity.getCoordinates().x() > ( 1 - 0.08 * std::cos( this->xYAngle ) ) * ( entity.getMesh().getDimensions().x() - 1 ) ) return ( (* this->pressure)[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ] Loading @@ -761,9 +799,9 @@ const RealType operator()( const MeshFunction& u, + 0.5 * (* this->compressibleConservativeVariables->getDensity())[neighborEntities.template getEntityIndex< 0, 0, 0 >()] * ( this->cavitySpeed this->horizontalThrottleSpeed * this->cavitySpeed this->horizontalThrottleSpeed ); return u[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ]; Loading Loading @@ -819,9 +857,9 @@ const RealType operator()( const MeshFunction& u, + 0.5 * (* this->compressibleConservativeVariables->getDensity())[neighborEntities.template getEntityIndex< 0, 0, 0 >()] * ( this->cavitySpeed this->horizontalThrottleSpeed * this->cavitySpeed this->horizontalThrottleSpeed ); if ( entity.getCoordinates().x() > ( 1 - 0.08 * std::sin( this->xYAngle ) ) * ( entity.getMesh().getDimensions().x() - 1 ) ) return ( (* this->pressure)[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ] Loading @@ -830,9 +868,9 @@ const RealType operator()( const MeshFunction& u, + 0.5 * (* this->compressibleConservativeVariables->getDensity())[neighborEntities.template getEntityIndex< 0, 0, 0 >()] * ( this->cavitySpeed this->horizontalThrottleSpeed * this->cavitySpeed this->horizontalThrottleSpeed ); return u[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ]; } Loading @@ -848,9 +886,9 @@ const RealType operator()( const MeshFunction& u, + 0.5 * (* this->compressibleConservativeVariables->getDensity())[neighborEntities.template getEntityIndex< 0, 0, 0 >()] * ( this->cavitySpeed this->verticalThrottleSpeed * this->cavitySpeed this->verticalThrottleSpeed ); return u[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ]; } Loading Loading @@ -878,9 +916,14 @@ const RealType operator()( const MeshFunction& u, this->pressure = pressure; } void setCavitySpeed(const RealType cavitySpeed) void setHorizontalThrottleSpeed(const RealType horizontalThrottleSpeed) { this->horizontalThrottleSpeed = horizontalThrottleSpeed; } void setVerticalThrottleSpeed(const RealType verticalThrottleSpeed) { this->cavitySpeed = cavitySpeed; this->verticalThrottleSpeed = verticalThrottleSpeed; } void setZAngle(const RealType zAngle) Loading @@ -896,7 +939,8 @@ const RealType operator()( const MeshFunction& u, private: CompressibleConservativeVariablesPointer compressibleConservativeVariables; RealType timestep; RealType cavitySpeed; RealType horizontalThrottleSpeed; RealType verticalThrottleSpeed; RealType gamma; MeshFunctionPointer pressure; RealType zAngle; Loading src/Examples/flows/BoundaryConditions/BoilerModel/MomentumXBoundaryConditionBoilerModel.h +37 −19 Original line number Diff line number Diff line Loading @@ -199,9 +199,14 @@ class MomentumXBoundaryConditionsBoilerModel< Meshes::Grid< 1, MeshReal, Device, this->pressure = pressure; } void setCavitySpeed(const RealType cavitySpeed) void setHorizontalThrottleSpeed(const RealType horizontalThrottleSpeed) { this->cavitySpeed = cavitySpeed; this->horizontalThrottleSpeed = horizontalThrottleSpeed; } void setVerticalThrottleSpeed(const RealType verticalThrottleSpeed) { this->verticalThrottleSpeed = verticalThrottleSpeed; } void setZAngle(const RealType zAngle) Loading @@ -217,7 +222,8 @@ class MomentumXBoundaryConditionsBoilerModel< Meshes::Grid< 1, MeshReal, Device, private: CompressibleConservativeVariablesPointer compressibleConservativeVariables; RealType timestep; RealType cavitySpeed; RealType horizontalThrottleSpeed; RealType verticalThrottleSpeed; RealType gamma; MeshFunctionPointer pressure; RealType zAngle; Loading Loading @@ -315,7 +321,7 @@ class MomentumXBoundaryConditionsBoilerModel< Meshes::Grid< 2, MeshReal, Device, { return (* this->compressibleConservativeVariables->getDensity())[neighborEntities.template getEntityIndex< 0, 0 >()] * ( this->cavitySpeed this->horizontalThrottleSpeed * std::cos( this->zAngle ) ); } Loading Loading @@ -365,7 +371,7 @@ class MomentumXBoundaryConditionsBoilerModel< Meshes::Grid< 2, MeshReal, Device, { return (* this->compressibleConservativeVariables->getDensity())[neighborEntities.template getEntityIndex< 0, 0 >()] * ( this->cavitySpeed * ( -1.0 ) this->horizontalThrottleSpeed * ( -1.0 ) * std::cos( this->zAngle ) ); } Loading Loading @@ -469,9 +475,14 @@ class MomentumXBoundaryConditionsBoilerModel< Meshes::Grid< 2, MeshReal, Device, this->pressure = pressure; } void setCavitySpeed(const RealType cavitySpeed) void setHorizontalThrottleSpeed(const RealType horizontalThrottleSpeed) { this->cavitySpeed = cavitySpeed; this->horizontalThrottleSpeed = horizontalThrottleSpeed; } void setVerticalThrottleSpeed(const RealType verticalThrottleSpeed) { this->verticalThrottleSpeed = verticalThrottleSpeed; } void setZAngle(const RealType zAngle) Loading @@ -487,7 +498,8 @@ class MomentumXBoundaryConditionsBoilerModel< Meshes::Grid< 2, MeshReal, Device, private: CompressibleConservativeVariablesPointer compressibleConservativeVariables; RealType timestep; RealType cavitySpeed; RealType horizontalThrottleSpeed; RealType verticalThrottleSpeed; RealType gamma; MeshFunctionPointer pressure; RealType zAngle; Loading Loading @@ -584,14 +596,14 @@ class MomentumXBoundaryConditionsBoilerModel< Meshes::Grid< 3, MeshReal, Device, if( entity.getCoordinates().y() < 0.08 * std::cos( this->xYAngle ) * ( entity.getMesh().getDimensions().y() - 1 ) ) return (* this->compressibleConservativeVariables->getDensity())[neighborEntities.template getEntityIndex< 0, 0, 0 >()] * ( this->cavitySpeed this->horizontalThrottleSpeed * std::cos( this->xYAngle ) * std::cos( this->zAngle ) ); if ( entity.getCoordinates().y() > ( 1 - 0.08 * std::sin( this->xYAngle ) ) * ( entity.getMesh().getDimensions().y() - 1 ) ) return (* this->compressibleConservativeVariables->getDensity())[neighborEntities.template getEntityIndex< 0, 0, 0 >()] * ( this->cavitySpeed this->horizontalThrottleSpeed * std::sin( this->xYAngle ) * std::cos( this->zAngle ) ); Loading Loading @@ -644,14 +656,14 @@ class MomentumXBoundaryConditionsBoilerModel< Meshes::Grid< 3, MeshReal, Device, if( entity.getCoordinates().y() < 0.08 * std::sin( this->xYAngle ) * ( entity.getMesh().getDimensions().y() - 1 ) ) return (* this->compressibleConservativeVariables->getDensity())[neighborEntities.template getEntityIndex< 0, 0, 0 >()] * ( this->cavitySpeed * ( -1.0 ) this->horizontalThrottleSpeed * ( -1.0 ) * std::sin( this->xYAngle ) * std::cos( this->zAngle ) ); if ( entity.getCoordinates().y() > ( 1 - 0.08 * std::cos( this->xYAngle ) ) * ( entity.getMesh().getDimensions().y() - 1 ) ) return (* this->compressibleConservativeVariables->getDensity())[neighborEntities.template getEntityIndex< 0, 0, 0 >()] * ( this->cavitySpeed * ( -1.0 ) this->horizontalThrottleSpeed * ( -1.0 ) * std::cos( this->xYAngle ) * std::cos( this->zAngle ) ); Loading Loading @@ -707,14 +719,14 @@ class MomentumXBoundaryConditionsBoilerModel< Meshes::Grid< 3, MeshReal, Device, if( entity.getCoordinates().x() < 0.08 * std::sin( this->xYAngle ) * ( entity.getMesh().getDimensions().x() - 1 ) ) return (* this->compressibleConservativeVariables->getDensity())[neighborEntities.template getEntityIndex< 0, 0, 0 >()] * ( this->cavitySpeed this->horizontalThrottleSpeed * std::cos( this->xYAngle ) * std::cos( this->zAngle ) ); if ( entity.getCoordinates().x() > ( 1 - 0.08 * std::cos( this->xYAngle ) ) * ( entity.getMesh().getDimensions().x() - 1 ) ) return (* this->compressibleConservativeVariables->getDensity())[neighborEntities.template getEntityIndex< 0, 0, 0 >()] * ( this->cavitySpeed * ( -1.0 ) this->horizontalThrottleSpeed * ( -1.0 ) * std::sin( this->xYAngle ) * std::cos( this->zAngle ) ); Loading Loading @@ -767,14 +779,14 @@ class MomentumXBoundaryConditionsBoilerModel< Meshes::Grid< 3, MeshReal, Device, if( entity.getCoordinates().x() < 0.08 * std::cos( this->xYAngle ) * ( entity.getMesh().getDimensions().x() - 1 ) ) return (* this->compressibleConservativeVariables->getDensity())[neighborEntities.template getEntityIndex< 0, 0, 0 >()] * ( this->cavitySpeed this->horizontalThrottleSpeed * std::sin( this->xYAngle ) * std::cos( this->zAngle ) ); if ( entity.getCoordinates().x() > ( 1 - 0.08 * std::sin( this->xYAngle ) ) * ( entity.getMesh().getDimensions().x() - 1 ) ) return (* this->compressibleConservativeVariables->getDensity())[neighborEntities.template getEntityIndex< 0, 0, 0 >()] * ( this->cavitySpeed * ( -1.0 ) this->horizontalThrottleSpeed * ( -1.0 ) * std::cos( this->xYAngle ) * std::cos( this->zAngle ) ); Loading Loading @@ -882,9 +894,14 @@ class MomentumXBoundaryConditionsBoilerModel< Meshes::Grid< 3, MeshReal, Device, this->pressure = pressure; } void setCavitySpeed(const RealType cavitySpeed) void setHorizontalThrottleSpeed(const RealType horizontalThrottleSpeed) { this->horizontalThrottleSpeed = horizontalThrottleSpeed; } void setVerticalThrottleSpeed(const RealType verticalThrottleSpeed) { this->cavitySpeed = cavitySpeed; this->verticalThrottleSpeed = verticalThrottleSpeed; } void setZAngle(const RealType zAngle) Loading @@ -900,7 +917,8 @@ class MomentumXBoundaryConditionsBoilerModel< Meshes::Grid< 3, MeshReal, Device, private: CompressibleConservativeVariablesPointer compressibleConservativeVariables; RealType timestep; RealType cavitySpeed; RealType horizontalThrottleSpeed; RealType verticalThrottleSpeed; RealType gamma; MeshFunctionPointer pressure; RealType zAngle; Loading src/Examples/flows/BoundaryConditions/BoilerModel/MomentumYBoundaryConditionBoilerModel.h +38 −20 File changed.Preview size limit exceeded, changes collapsed. Show changes Loading
src/Examples/flows/BoundaryConditions/Boiler/BoundaryConditionsBoiler.h +16 −0 Original line number Diff line number Diff line Loading @@ -99,6 +99,22 @@ class BoundaryConditionsBoiler this->energyBoundaryConditionsPointer->setCavitySpeed(cavitySpeed); } void setHorizontalThrottleSpeed(const RealType startSpeed, const RealType finalSpeed, const RealType time, const RealType finalTime ) { } void setVerticalThrottleSpeed(const RealType startSpeed, const RealType finalSpeed, const RealType time, const RealType finalTime ) { } DensityBoundaryConditionsTypePointer& getDensityBoundaryCondition() { return this->densityBoundaryConditionsPointer; Loading
src/Examples/flows/BoundaryConditions/BoilerModel/BoundaryConditionsBoilerModel.h +39 −4 Original line number Diff line number Diff line Loading @@ -115,10 +115,45 @@ class BoundaryConditionsBoilerModel void setSpeed(const RealType cavitySpeed) { this->momentumXBoundaryConditionsPointer->setCavitySpeed(cavitySpeed); this->momentumYBoundaryConditionsPointer->setCavitySpeed(cavitySpeed); this->momentumZBoundaryConditionsPointer->setCavitySpeed(cavitySpeed); this->energyBoundaryConditionsPointer->setCavitySpeed(cavitySpeed); } void setHorizontalThrottleSpeed(const RealType startSpeed, const RealType finalSpeed, const RealType time, const RealType finalTime ) { RealType horizontalThrottleSpeed = 0; if(time <= finalTime) if( time != 0 || finalTime != 0 ) horizontalThrottleSpeed = startSpeed + ( finalSpeed - startSpeed ) / ( time / finalTime ); else horizontalThrottleSpeed = 0; else horizontalThrottleSpeed = finalSpeed; this->momentumXBoundaryConditionsPointer->setHorizontalThrottleSpeed(horizontalThrottleSpeed); this->momentumYBoundaryConditionsPointer->setHorizontalThrottleSpeed(horizontalThrottleSpeed); this->momentumZBoundaryConditionsPointer->setHorizontalThrottleSpeed(horizontalThrottleSpeed); this->energyBoundaryConditionsPointer->setHorizontalThrottleSpeed(horizontalThrottleSpeed); } void setVerticalThrottleSpeed(const RealType startSpeed, const RealType finalSpeed, const RealType time, const RealType finalTime ) { RealType verticalThrottleSpeed = 0; if(time <= finalTime) if( time != 0 || finalTime != 0 ) verticalThrottleSpeed = startSpeed + ( finalSpeed - startSpeed ) / ( time / finalTime ); else verticalThrottleSpeed = 0; else verticalThrottleSpeed = finalSpeed; this->momentumXBoundaryConditionsPointer->setVerticalThrottleSpeed(verticalThrottleSpeed); this->momentumYBoundaryConditionsPointer->setVerticalThrottleSpeed(verticalThrottleSpeed); this->momentumZBoundaryConditionsPointer->setVerticalThrottleSpeed(verticalThrottleSpeed); this->energyBoundaryConditionsPointer->setVerticalThrottleSpeed(verticalThrottleSpeed); } DensityBoundaryConditionsTypePointer& getDensityBoundaryCondition() Loading
src/Examples/flows/BoundaryConditions/BoilerModel/EnergyBoundaryConditionBoilerModel.h +79 −35 Original line number Diff line number Diff line Loading @@ -208,9 +208,14 @@ class EnergyBoundaryConditionsBoilerModel< Meshes::Grid< 1, MeshReal, Device, Me this->pressure = pressure; } void setCavitySpeed(const RealType cavitySpeed) void setHorizontalThrottleSpeed(const RealType horizontalThrottleSpeed) { this->cavitySpeed = cavitySpeed; this->horizontalThrottleSpeed = horizontalThrottleSpeed; } void setVerticalThrottleSpeed(const RealType verticalThrottleSpeed) { this->verticalThrottleSpeed = verticalThrottleSpeed; } void setZAngle(const RealType zAngle) Loading @@ -226,7 +231,8 @@ class EnergyBoundaryConditionsBoilerModel< Meshes::Grid< 1, MeshReal, Device, Me private: CompressibleConservativeVariablesPointer compressibleConservativeVariables; RealType timestep; RealType cavitySpeed; RealType horizontalThrottleSpeed; RealType verticalThrottleSpeed; RealType gamma; MeshFunctionPointer pressure; RealType zAngle; Loading Loading @@ -328,9 +334,9 @@ class EnergyBoundaryConditionsBoilerModel< Meshes::Grid< 2, MeshReal, Device, Me + 0.5 * (* this->compressibleConservativeVariables->getDensity())[neighborEntities.template getEntityIndex< 0, 0 >()] * ( this->cavitySpeed this->horizontalThrottleSpeed * this->cavitySpeed this->horizontalThrottleSpeed ); } return u[ neighborEntities.template getEntityIndex< 0, 0 >() ]; Loading Loading @@ -383,14 +389,26 @@ class EnergyBoundaryConditionsBoilerModel< Meshes::Grid< 2, MeshReal, Device, Me + 0.5 * (* this->compressibleConservativeVariables->getDensity())[neighborEntities.template getEntityIndex< 0, 0 >()] * ( this->cavitySpeed this->horizontalThrottleSpeed * this->cavitySpeed this->horizontalThrottleSpeed ); } // if for chimney exit if( entity.getCoordinates().y() > 0.835 * ( entity.getMesh().getDimensions().y() - 1 ) ) return u[ neighborEntities.template getEntityIndex< -1, 0 >() ]; if( (* this->compressibleConservativeVariables->getDensity())[neighborEntities.template getEntityIndex< 0, 0 >()] != 0 ) return ( (* this->pressure)[ neighborEntities.template getEntityIndex< 0, 0 >() ] / ( this->gamma - 1 ) ) + 0.5 * ( ( (* ( *this->compressibleConservativeVariables->getMomentum() )[ 0 ] )[neighborEntities.template getEntityIndex< 0, 0 >()] * (* ( *this->compressibleConservativeVariables->getMomentum() )[ 0 ] )[neighborEntities.template getEntityIndex< 0, 0 >()] + (* ( *this->compressibleConservativeVariables->getMomentum() )[ 1 ] )[neighborEntities.template getEntityIndex< 0, 0 >()] * (* ( *this->compressibleConservativeVariables->getMomentum() )[ 1 ] )[neighborEntities.template getEntityIndex< 0, 0 >()] ) / (* this->compressibleConservativeVariables->getDensity())[neighborEntities.template getEntityIndex< 0, 0 >()] ); else return u[ neighborEntities.template getEntityIndex< -1, 0 >() ]; return u[ neighborEntities.template getEntityIndex< 0, 0 >() ]; } if( entity.getCoordinates().y() == 0 ) Loading @@ -404,9 +422,9 @@ class EnergyBoundaryConditionsBoilerModel< Meshes::Grid< 2, MeshReal, Device, Me + 0.5 * (* this->compressibleConservativeVariables->getDensity())[neighborEntities.template getEntityIndex< 0, 0 >()] * ( this->cavitySpeed this->verticalThrottleSpeed * this->cavitySpeed this->verticalThrottleSpeed ); return u[ neighborEntities.template getEntityIndex< 0, 0 >() ]; } Loading Loading @@ -491,9 +509,14 @@ class EnergyBoundaryConditionsBoilerModel< Meshes::Grid< 2, MeshReal, Device, Me this->pressure = pressure; } void setCavitySpeed(const RealType cavitySpeed) void setHorizontalThrottleSpeed(const RealType horizontalThrottleSpeed) { this->horizontalThrottleSpeed = horizontalThrottleSpeed; } void setVerticalThrottleSpeed(const RealType verticalThrottleSpeed) { this->cavitySpeed = cavitySpeed; this->verticalThrottleSpeed = verticalThrottleSpeed; } void setZAngle(const RealType zAngle) Loading @@ -509,7 +532,8 @@ class EnergyBoundaryConditionsBoilerModel< Meshes::Grid< 2, MeshReal, Device, Me private: CompressibleConservativeVariablesPointer compressibleConservativeVariables; RealType timestep; RealType cavitySpeed; RealType horizontalThrottleSpeed; RealType verticalThrottleSpeed; RealType gamma; MeshFunctionPointer pressure; RealType zAngle; Loading Loading @@ -610,9 +634,9 @@ const RealType operator()( const MeshFunction& u, + 0.5 * (* this->compressibleConservativeVariables->getDensity())[neighborEntities.template getEntityIndex< 0, 0, 0 >()] * ( this->cavitySpeed this->horizontalThrottleSpeed * this->cavitySpeed this->horizontalThrottleSpeed ); if ( entity.getCoordinates().y() > ( 1 - 0.08 * std::sin( this->xYAngle ) ) * ( entity.getMesh().getDimensions().y() - 1 ) ) return ( (* this->pressure)[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ] Loading @@ -621,9 +645,9 @@ const RealType operator()( const MeshFunction& u, + 0.5 * (* this->compressibleConservativeVariables->getDensity())[neighborEntities.template getEntityIndex< 0, 0, 0 >()] * ( this->cavitySpeed this->horizontalThrottleSpeed * this->cavitySpeed this->horizontalThrottleSpeed ); return u[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ]; } Loading Loading @@ -678,9 +702,9 @@ const RealType operator()( const MeshFunction& u, + 0.5 * (* this->compressibleConservativeVariables->getDensity())[neighborEntities.template getEntityIndex< 0, 0, 0 >()] * ( this->cavitySpeed this->horizontalThrottleSpeed * this->cavitySpeed this->horizontalThrottleSpeed ); if ( entity.getCoordinates().y() > ( 1 - 0.08 * std::cos( this->xYAngle ) ) * ( entity.getMesh().getDimensions().y() - 1 ) ) return ( (* this->pressure)[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ] Loading @@ -689,16 +713,30 @@ const RealType operator()( const MeshFunction& u, + 0.5 * (* this->compressibleConservativeVariables->getDensity())[neighborEntities.template getEntityIndex< 0, 0, 0 >()] * ( this->cavitySpeed this->horizontalThrottleSpeed * this->cavitySpeed this->horizontalThrottleSpeed ); return u[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ]; // if for chimney exit } if( entity.getCoordinates().z() > 0.835 * ( entity.getMesh().getDimensions().z() - 1 ) ) return u[ neighborEntities.template getEntityIndex< -1, 0, 0 >() ]; if( (* this->compressibleConservativeVariables->getDensity())[neighborEntities.template getEntityIndex< 0, 0, 0 >()] != 0 ) return ( (* this->pressure)[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ] / ( this->gamma - 1 ) ) + 0.5 * ( ( (* ( *this->compressibleConservativeVariables->getMomentum() )[ 0 ] )[neighborEntities.template getEntityIndex< 0, 0, 0 >()] * (* ( *this->compressibleConservativeVariables->getMomentum() )[ 0 ] )[neighborEntities.template getEntityIndex< 0, 0, 0 >()] + (* ( *this->compressibleConservativeVariables->getMomentum() )[ 1 ] )[neighborEntities.template getEntityIndex< 0, 0, 0 >()] * (* ( *this->compressibleConservativeVariables->getMomentum() )[ 1 ] )[neighborEntities.template getEntityIndex< 0, 0, 0 >()] + (* ( *this->compressibleConservativeVariables->getMomentum() )[ 2 ] )[neighborEntities.template getEntityIndex< 0, 0, 0 >()] * (* ( *this->compressibleConservativeVariables->getMomentum() )[ 2 ] )[neighborEntities.template getEntityIndex< 0, 0, 0 >()] ) / (* this->compressibleConservativeVariables->getDensity())[neighborEntities.template getEntityIndex< 0, 0, 0 >()] ); else return u[ neighborEntities.template getEntityIndex< -1, 0, 0 >() ]; return u[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ]; } if( entity.getCoordinates().y() == 0 ) Loading Loading @@ -750,9 +788,9 @@ const RealType operator()( const MeshFunction& u, + 0.5 * (* this->compressibleConservativeVariables->getDensity())[neighborEntities.template getEntityIndex< 0, 0, 0 >()] * ( this->cavitySpeed this->horizontalThrottleSpeed * this->cavitySpeed this->horizontalThrottleSpeed ); if ( entity.getCoordinates().x() > ( 1 - 0.08 * std::cos( this->xYAngle ) ) * ( entity.getMesh().getDimensions().x() - 1 ) ) return ( (* this->pressure)[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ] Loading @@ -761,9 +799,9 @@ const RealType operator()( const MeshFunction& u, + 0.5 * (* this->compressibleConservativeVariables->getDensity())[neighborEntities.template getEntityIndex< 0, 0, 0 >()] * ( this->cavitySpeed this->horizontalThrottleSpeed * this->cavitySpeed this->horizontalThrottleSpeed ); return u[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ]; Loading Loading @@ -819,9 +857,9 @@ const RealType operator()( const MeshFunction& u, + 0.5 * (* this->compressibleConservativeVariables->getDensity())[neighborEntities.template getEntityIndex< 0, 0, 0 >()] * ( this->cavitySpeed this->horizontalThrottleSpeed * this->cavitySpeed this->horizontalThrottleSpeed ); if ( entity.getCoordinates().x() > ( 1 - 0.08 * std::sin( this->xYAngle ) ) * ( entity.getMesh().getDimensions().x() - 1 ) ) return ( (* this->pressure)[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ] Loading @@ -830,9 +868,9 @@ const RealType operator()( const MeshFunction& u, + 0.5 * (* this->compressibleConservativeVariables->getDensity())[neighborEntities.template getEntityIndex< 0, 0, 0 >()] * ( this->cavitySpeed this->horizontalThrottleSpeed * this->cavitySpeed this->horizontalThrottleSpeed ); return u[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ]; } Loading @@ -848,9 +886,9 @@ const RealType operator()( const MeshFunction& u, + 0.5 * (* this->compressibleConservativeVariables->getDensity())[neighborEntities.template getEntityIndex< 0, 0, 0 >()] * ( this->cavitySpeed this->verticalThrottleSpeed * this->cavitySpeed this->verticalThrottleSpeed ); return u[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ]; } Loading Loading @@ -878,9 +916,14 @@ const RealType operator()( const MeshFunction& u, this->pressure = pressure; } void setCavitySpeed(const RealType cavitySpeed) void setHorizontalThrottleSpeed(const RealType horizontalThrottleSpeed) { this->horizontalThrottleSpeed = horizontalThrottleSpeed; } void setVerticalThrottleSpeed(const RealType verticalThrottleSpeed) { this->cavitySpeed = cavitySpeed; this->verticalThrottleSpeed = verticalThrottleSpeed; } void setZAngle(const RealType zAngle) Loading @@ -896,7 +939,8 @@ const RealType operator()( const MeshFunction& u, private: CompressibleConservativeVariablesPointer compressibleConservativeVariables; RealType timestep; RealType cavitySpeed; RealType horizontalThrottleSpeed; RealType verticalThrottleSpeed; RealType gamma; MeshFunctionPointer pressure; RealType zAngle; Loading
src/Examples/flows/BoundaryConditions/BoilerModel/MomentumXBoundaryConditionBoilerModel.h +37 −19 Original line number Diff line number Diff line Loading @@ -199,9 +199,14 @@ class MomentumXBoundaryConditionsBoilerModel< Meshes::Grid< 1, MeshReal, Device, this->pressure = pressure; } void setCavitySpeed(const RealType cavitySpeed) void setHorizontalThrottleSpeed(const RealType horizontalThrottleSpeed) { this->cavitySpeed = cavitySpeed; this->horizontalThrottleSpeed = horizontalThrottleSpeed; } void setVerticalThrottleSpeed(const RealType verticalThrottleSpeed) { this->verticalThrottleSpeed = verticalThrottleSpeed; } void setZAngle(const RealType zAngle) Loading @@ -217,7 +222,8 @@ class MomentumXBoundaryConditionsBoilerModel< Meshes::Grid< 1, MeshReal, Device, private: CompressibleConservativeVariablesPointer compressibleConservativeVariables; RealType timestep; RealType cavitySpeed; RealType horizontalThrottleSpeed; RealType verticalThrottleSpeed; RealType gamma; MeshFunctionPointer pressure; RealType zAngle; Loading Loading @@ -315,7 +321,7 @@ class MomentumXBoundaryConditionsBoilerModel< Meshes::Grid< 2, MeshReal, Device, { return (* this->compressibleConservativeVariables->getDensity())[neighborEntities.template getEntityIndex< 0, 0 >()] * ( this->cavitySpeed this->horizontalThrottleSpeed * std::cos( this->zAngle ) ); } Loading Loading @@ -365,7 +371,7 @@ class MomentumXBoundaryConditionsBoilerModel< Meshes::Grid< 2, MeshReal, Device, { return (* this->compressibleConservativeVariables->getDensity())[neighborEntities.template getEntityIndex< 0, 0 >()] * ( this->cavitySpeed * ( -1.0 ) this->horizontalThrottleSpeed * ( -1.0 ) * std::cos( this->zAngle ) ); } Loading Loading @@ -469,9 +475,14 @@ class MomentumXBoundaryConditionsBoilerModel< Meshes::Grid< 2, MeshReal, Device, this->pressure = pressure; } void setCavitySpeed(const RealType cavitySpeed) void setHorizontalThrottleSpeed(const RealType horizontalThrottleSpeed) { this->cavitySpeed = cavitySpeed; this->horizontalThrottleSpeed = horizontalThrottleSpeed; } void setVerticalThrottleSpeed(const RealType verticalThrottleSpeed) { this->verticalThrottleSpeed = verticalThrottleSpeed; } void setZAngle(const RealType zAngle) Loading @@ -487,7 +498,8 @@ class MomentumXBoundaryConditionsBoilerModel< Meshes::Grid< 2, MeshReal, Device, private: CompressibleConservativeVariablesPointer compressibleConservativeVariables; RealType timestep; RealType cavitySpeed; RealType horizontalThrottleSpeed; RealType verticalThrottleSpeed; RealType gamma; MeshFunctionPointer pressure; RealType zAngle; Loading Loading @@ -584,14 +596,14 @@ class MomentumXBoundaryConditionsBoilerModel< Meshes::Grid< 3, MeshReal, Device, if( entity.getCoordinates().y() < 0.08 * std::cos( this->xYAngle ) * ( entity.getMesh().getDimensions().y() - 1 ) ) return (* this->compressibleConservativeVariables->getDensity())[neighborEntities.template getEntityIndex< 0, 0, 0 >()] * ( this->cavitySpeed this->horizontalThrottleSpeed * std::cos( this->xYAngle ) * std::cos( this->zAngle ) ); if ( entity.getCoordinates().y() > ( 1 - 0.08 * std::sin( this->xYAngle ) ) * ( entity.getMesh().getDimensions().y() - 1 ) ) return (* this->compressibleConservativeVariables->getDensity())[neighborEntities.template getEntityIndex< 0, 0, 0 >()] * ( this->cavitySpeed this->horizontalThrottleSpeed * std::sin( this->xYAngle ) * std::cos( this->zAngle ) ); Loading Loading @@ -644,14 +656,14 @@ class MomentumXBoundaryConditionsBoilerModel< Meshes::Grid< 3, MeshReal, Device, if( entity.getCoordinates().y() < 0.08 * std::sin( this->xYAngle ) * ( entity.getMesh().getDimensions().y() - 1 ) ) return (* this->compressibleConservativeVariables->getDensity())[neighborEntities.template getEntityIndex< 0, 0, 0 >()] * ( this->cavitySpeed * ( -1.0 ) this->horizontalThrottleSpeed * ( -1.0 ) * std::sin( this->xYAngle ) * std::cos( this->zAngle ) ); if ( entity.getCoordinates().y() > ( 1 - 0.08 * std::cos( this->xYAngle ) ) * ( entity.getMesh().getDimensions().y() - 1 ) ) return (* this->compressibleConservativeVariables->getDensity())[neighborEntities.template getEntityIndex< 0, 0, 0 >()] * ( this->cavitySpeed * ( -1.0 ) this->horizontalThrottleSpeed * ( -1.0 ) * std::cos( this->xYAngle ) * std::cos( this->zAngle ) ); Loading Loading @@ -707,14 +719,14 @@ class MomentumXBoundaryConditionsBoilerModel< Meshes::Grid< 3, MeshReal, Device, if( entity.getCoordinates().x() < 0.08 * std::sin( this->xYAngle ) * ( entity.getMesh().getDimensions().x() - 1 ) ) return (* this->compressibleConservativeVariables->getDensity())[neighborEntities.template getEntityIndex< 0, 0, 0 >()] * ( this->cavitySpeed this->horizontalThrottleSpeed * std::cos( this->xYAngle ) * std::cos( this->zAngle ) ); if ( entity.getCoordinates().x() > ( 1 - 0.08 * std::cos( this->xYAngle ) ) * ( entity.getMesh().getDimensions().x() - 1 ) ) return (* this->compressibleConservativeVariables->getDensity())[neighborEntities.template getEntityIndex< 0, 0, 0 >()] * ( this->cavitySpeed * ( -1.0 ) this->horizontalThrottleSpeed * ( -1.0 ) * std::sin( this->xYAngle ) * std::cos( this->zAngle ) ); Loading Loading @@ -767,14 +779,14 @@ class MomentumXBoundaryConditionsBoilerModel< Meshes::Grid< 3, MeshReal, Device, if( entity.getCoordinates().x() < 0.08 * std::cos( this->xYAngle ) * ( entity.getMesh().getDimensions().x() - 1 ) ) return (* this->compressibleConservativeVariables->getDensity())[neighborEntities.template getEntityIndex< 0, 0, 0 >()] * ( this->cavitySpeed this->horizontalThrottleSpeed * std::sin( this->xYAngle ) * std::cos( this->zAngle ) ); if ( entity.getCoordinates().x() > ( 1 - 0.08 * std::sin( this->xYAngle ) ) * ( entity.getMesh().getDimensions().x() - 1 ) ) return (* this->compressibleConservativeVariables->getDensity())[neighborEntities.template getEntityIndex< 0, 0, 0 >()] * ( this->cavitySpeed * ( -1.0 ) this->horizontalThrottleSpeed * ( -1.0 ) * std::cos( this->xYAngle ) * std::cos( this->zAngle ) ); Loading Loading @@ -882,9 +894,14 @@ class MomentumXBoundaryConditionsBoilerModel< Meshes::Grid< 3, MeshReal, Device, this->pressure = pressure; } void setCavitySpeed(const RealType cavitySpeed) void setHorizontalThrottleSpeed(const RealType horizontalThrottleSpeed) { this->horizontalThrottleSpeed = horizontalThrottleSpeed; } void setVerticalThrottleSpeed(const RealType verticalThrottleSpeed) { this->cavitySpeed = cavitySpeed; this->verticalThrottleSpeed = verticalThrottleSpeed; } void setZAngle(const RealType zAngle) Loading @@ -900,7 +917,8 @@ class MomentumXBoundaryConditionsBoilerModel< Meshes::Grid< 3, MeshReal, Device, private: CompressibleConservativeVariablesPointer compressibleConservativeVariables; RealType timestep; RealType cavitySpeed; RealType horizontalThrottleSpeed; RealType verticalThrottleSpeed; RealType gamma; MeshFunctionPointer pressure; RealType zAngle; Loading
src/Examples/flows/BoundaryConditions/BoilerModel/MomentumYBoundaryConditionBoilerModel.h +38 −20 File changed.Preview size limit exceeded, changes collapsed. Show changes