Commit a0f9de1b authored by Jan Schäfer's avatar Jan Schäfer Committed by Jakub Klinkovský
Browse files

minor changes

parent 9759c6ab
Loading
Loading
Loading
Loading
+9 −18
Original line number Diff line number Diff line
@@ -129,8 +129,7 @@ class DisipationBoundaryConditionsBoiler< Meshes::Grid< 1, MeshReal, Device, Mes
      const auto& neighborEntities = entity.getNeighborEntities();
      const IndexType& index = entity.getIndex();
      if( entity.getCoordinates().x() == 0 )
         return this->turbulenceConstant 
                * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ), ( 3.0 / 2.0 ) )
         return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ) )
                / this->lengthScale;
      else
         return u[ neighborEntities.template getEntityIndex< -1 >() ];   
@@ -279,8 +278,7 @@ class DisipationBoundaryConditionsBoiler< Meshes::Grid< 2, MeshReal, Device, Mes
         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 ) ) )
               return this->turbulenceConstant 
                      * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ), ( 3.0 / 2.0 ) )
               return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ) )
                      / this->lengthScale;
            else 
               return u[ neighborEntities.template getEntityIndex< 0, 0 >() ];
@@ -304,8 +302,7 @@ class DisipationBoundaryConditionsBoiler< Meshes::Grid< 2, MeshReal, Device, Mes
         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 ) ) ) 
               return this->turbulenceConstant 
                      * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ), ( 3.0 / 2.0 ) )
               return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ) )
                      / this->lengthScale;
            else if( entity.getCoordinates().y() > 0.8 * ( entity.getMesh().getDimensions().y() - 1 ) && false )
               return u[ neighborEntities.template getEntityIndex< 0, 0 >() ];
@@ -330,8 +327,7 @@ class DisipationBoundaryConditionsBoiler< Meshes::Grid< 2, MeshReal, Device, Mes
         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 ) ) ) 
               return this->turbulenceConstant 
                      * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ), ( 3.0 / 2.0 ) )
               return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ) )
                      / this->lengthScale;
            else 
               return u[ neighborEntities.template getEntityIndex< 0, 0 >() ];
@@ -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 ) )
              &&( entity.getCoordinates().z() < 0.59 * ( entity.getMesh().getDimensions().z() - 1 ) ) && ( entity.getCoordinates().z() > 0.39 * ( entity.getMesh().getDimensions().z() - 1 ) ) )
               return this->turbulenceConstant 
                      * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ), ( 3.0 / 2.0 ) )
               return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ) )
                      / this->lengthScale;
            else 
               return u[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ];
@@ -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 ) )
              &&( entity.getCoordinates().z() < 0.59 * ( entity.getMesh().getDimensions().z() - 1 ) ) && ( entity.getCoordinates().z() > 0.39 * ( entity.getMesh().getDimensions().z() - 1 ) ) )
               return this->turbulenceConstant 
                      * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ), ( 3.0 / 2.0 ) )
               return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ) )
                      / this->lengthScale;
            else if( entity.getCoordinates().y() >0.8 * ( entity.getMesh().getDimensions().y() - 1 ) )
               return u[ neighborEntities.template getEntityIndex< -1, 0, 0 >() ];
@@ -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 ) )
              &&( entity.getCoordinates().z() < 0.59 * ( entity.getMesh().getDimensions().z() - 1 ) ) && ( entity.getCoordinates().z() > 0.39 * ( entity.getMesh().getDimensions().z() - 1 ) ) )
               return this->turbulenceConstant 
                      * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ), ( 3.0 / 2.0 ) )
               return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ) )
                      / this->lengthScale;
            else 
               return u[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ];
@@ -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 ) )
              &&( entity.getCoordinates().z() < 0.59 * ( entity.getMesh().getDimensions().z() - 1 ) ) && ( entity.getCoordinates().z() > 0.39 * ( entity.getMesh().getDimensions().z() - 1 ) ) )
               return this->turbulenceConstant 
                      * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ), ( 3.0 / 2.0 ) )
               return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ) )
                      / this->lengthScale;
            else 
               return u[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ];
@@ -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 ) )
              &&( entity.getCoordinates().y() < 0.6 * ( entity.getMesh().getDimensions().z() - 1 ) ) && ( entity.getCoordinates().z() > 0.4 * ( entity.getMesh().getDimensions().z() - 1 ) ) )
               return this->turbulenceConstant 
                      * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ), ( 3.0 / 2.0 ) )
               return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ) )
                      / this->lengthScale;
               
            else 
+15 −26
Original line number Diff line number Diff line
@@ -129,8 +129,7 @@ class DisipationBoundaryConditionsBoilerModel< Meshes::Grid< 1, MeshReal, Device
      const auto& neighborEntities = entity.getNeighborEntities();
      const IndexType& index = entity.getIndex();
      if( entity.getCoordinates().x() == 0 )
         return this->turbulenceConstant 
                * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ), ( 3.0 / 2.0 ) )
         return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ) )
                / this->lengthScale;
      else
         return u[ neighborEntities.template getEntityIndex< -1 >() ];   
@@ -337,8 +336,7 @@ class DisipationBoundaryConditionsBoilerModel< Meshes::Grid< 2, MeshReal, Device
              )
// throttle Disipation
               {
                  return this->turbulenceConstant 
                         * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ), ( 3.0 / 2.0 ) )
                  return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ) )
                         / this->lengthScale;
               }
            return u[ neighborEntities.template getEntityIndex< 0, 0 >() ];
@@ -385,8 +383,7 @@ class DisipationBoundaryConditionsBoilerModel< Meshes::Grid< 2, MeshReal, Device
              )
// throttle Disipation
               {
               return this->turbulenceConstant 
                      * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ), ( 3.0 / 2.0 ) )
               return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ) )
                      / this->lengthScale;
               }
// if for chimney exit     
@@ -397,7 +394,8 @@ class DisipationBoundaryConditionsBoilerModel< Meshes::Grid< 2, MeshReal, Device
            if( ( entity.getCoordinates().x() < 0.592 * ( 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 >() ];
         }
         // The following line is commented to avoid compiler warning
@@ -619,12 +617,10 @@ const RealType operator()( const MeshFunction& u,
// if for y axis
               {
               if( entity.getCoordinates().y() < 0.08 * std::cos( this->xYAngle ) * ( entity.getMesh().getDimensions().y() - 1 ) )
                  return this->turbulenceConstant 
                         * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ), ( 3.0 / 2.0 ) )
                  return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ) )
                         / this->lengthScale;
               if ( entity.getCoordinates().y() > ( 1 - 0.08 * std::sin( this->xYAngle ) ) * ( entity.getMesh().getDimensions().y() - 1 ) )
                  return this->turbulenceConstant 
                         * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ), ( 3.0 / 2.0 ) )
                  return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ) )
                         / this->lengthScale;
               return u[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ];
               }
@@ -673,12 +669,10 @@ const RealType operator()( const MeshFunction& u,
// if for y axis
               {
               if( entity.getCoordinates().y() < 0.08 * std::sin( this->xYAngle ) * ( entity.getMesh().getDimensions().y() - 1 ) )
                  return this->turbulenceConstant 
                         * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ), ( 3.0 / 2.0 ) )
                  return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ) )
                         / this->lengthScale;
               if ( entity.getCoordinates().y() > ( 1 - 0.08 * std::cos( this->xYAngle ) ) * ( entity.getMesh().getDimensions().y() - 1 ) )
                  return this->turbulenceConstant 
                         * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ), ( 3.0 / 2.0 ) )
                  return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ) )
                         / this->lengthScale;
               return u[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ];
// if for chimney exit
@@ -728,12 +722,10 @@ const RealType operator()( const MeshFunction& u,
// if for x axis
               {
               if( entity.getCoordinates().x() < 0.08 * std::sin( this->xYAngle ) * ( entity.getMesh().getDimensions().x() - 1 ) )
                  return this->turbulenceConstant 
                         * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ), ( 3.0 / 2.0 ) )
                  return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ) )
                         / this->lengthScale;
               if ( entity.getCoordinates().x() > ( 1 - 0.08 * std::cos( this->xYAngle ) ) * ( entity.getMesh().getDimensions().x() - 1 ) )
                  return this->turbulenceConstant 
                         * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ), ( 3.0 / 2.0 ) )
                  return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ) )
                         / this->lengthScale;
               
               return u[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ];
@@ -783,12 +775,10 @@ const RealType operator()( const MeshFunction& u,
// if for x axis
              {
               if( entity.getCoordinates().x() < 0.08 * std::cos( this->xYAngle ) * ( entity.getMesh().getDimensions().x() - 1 ) )
                  return this->turbulenceConstant 
                         * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ), ( 3.0 / 2.0 ) )
                  return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ) )
                         / this->lengthScale;
               if ( entity.getCoordinates().x() > ( 1 - 0.08 * std::sin( this->xYAngle ) ) * ( entity.getMesh().getDimensions().x() - 1 ) )
                  return this->turbulenceConstant 
                         * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ), ( 3.0 / 2.0 ) )
                  return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ) )
                         / this->lengthScale;
               return u[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ];
              }
@@ -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 ) ) )
//              &&( entity.getCoordinates().y() < 0.6 * ( entity.getMesh().getDimensions().z() - 1 ) ) && ( entity.getCoordinates().z() > 0.4 * ( entity.getMesh().getDimensions().z() - 1 ) ) )
               return this->turbulenceConstant 
                         * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->horizontalThrottleSpeed * this->horizontalThrottleSpeed ), ( 3.0 / 2.0 ) )
               return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->verticalThrottleSpeed * this->verticalThrottleSpeed ) )
                      / this->lengthScale;
            return u[ neighborEntities.template getEntityIndex< 0, 0, 0 >() ];
         }
+4 −7
Original line number Diff line number Diff line
@@ -128,8 +128,7 @@ class DisipationBoundaryConditionsCavity< Meshes::Grid< 1, MeshReal, Device, Mes
      const auto& neighborEntities = entity.getNeighborEntities();
      const IndexType& index = entity.getIndex();
      if( entity.getCoordinates().x() == 0 )
         return this->turbulenceConstant 
                * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ), ( 3.0 / 2.0 ) )
         return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ) )
                / this->lengthScale;
      else
         return u[ neighborEntities.template getEntityIndex< -1 >() ];   
@@ -290,8 +289,7 @@ class DisipationBoundaryConditionsCavity< Meshes::Grid< 2, MeshReal, Device, Mes
         // The following line is commented to avoid compiler warning
         //if( entity.getCoordinates().y() == entity.getMesh().getDimensions().y() - 1 )
         {
            return this->turbulenceConstant 
                   * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ), ( 3.0 / 2.0 ) )
            return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ) )
                      / this->lengthScale;
         }         
      }
@@ -469,8 +467,7 @@ class DisipationBoundaryConditionsCavity< Meshes::Grid< 3, MeshReal, Device, Mes
         // The following line is commented to avoid compiler warning
         //if( entity.getCoordinates().z() == entity.getMesh().getDimensions().z() - 1 )
         {
            return this->turbulenceConstant 
                   * std::pow( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ), ( 3.0 / 2.0 ) )
            return std::sqrt( ( 2.0/3.0 * this->intensity * this->intensity * this->cavitySpeed * this->cavitySpeed ) )
                   / this->lengthScale;
         }   
      }
+7 −16
Original line number Diff line number Diff line
@@ -147,11 +147,9 @@ class PhysicalVariablesGetter
         public:
            typedef typename MeshType::RealType RealType;
            
            TurbulentViscosityGetter( MeshFunctionPointer density,
                                      MeshFunctionPointer turbulentEnergy,
                                      RealType turbulenceConstant,
            TurbulentViscosityGetter( MeshFunctionPointer turbulentEnergy,
                                      MeshFunctionPointer disipation )
            : density( density ), turbulentEnergy( turbulentEnergy ), turbulenceConstant( turbulenceConstant ), disipation( disipation ) {}
            :turbulentEnergy( turbulentEnergy ), disipation( disipation ) {}
            
            template< typename EntityType >
            __cuda_callable__
@@ -161,15 +159,12 @@ class PhysicalVariablesGetter
               if( disipation.template getData< DeviceType >()( meshEntity ) == 0.0 )
                  return 0;
               else
                  return density.template getData< DeviceType >()( meshEntity ) * turbulenceConstant 
                       * turbulentEnergy.template getData< DeviceType >()( meshEntity )
                       * turbulentEnergy.template getData< DeviceType >()( meshEntity )
                  return turbulentEnergy.template getData< DeviceType >()( meshEntity )
                       / disipation.template getData< DeviceType >()( meshEntity );
            }
            
         protected:
            const MeshFunctionPointer density, turbulentEnergy, disipation;
            const RealType turbulenceConstant;
            const MeshFunctionPointer disipation, turbulentEnergy;
      };      

      
@@ -221,18 +216,14 @@ class PhysicalVariablesGetter
         }
      }

      void getTurbulentViscosity( const ConservativeVariablesPointer& conservativeVariables,
                                        MeshFunctionPointer& turbulentEnergy_no_rho,
      void getTurbulentViscosity(       MeshFunctionPointer& turbulentEnergy_no_rho,
                                        MeshFunctionPointer& disipation_no_rho,
                                  const RealType& turbulenceConstant,
                                        MeshFunctionPointer& turbulentViscosity )
      {
         Functions::MeshFunctionEvaluator< MeshFunctionType, TurbulentViscosityGetter > evaluator;
         for( int i = 0; i < Dimensions; i++ )
         {
            Pointers::SharedPointer< TurbulentViscosityGetter, DeviceType > turbulentViscosityGetter( conservativeVariables->getDensity(),
                                                                                                      turbulentEnergy_no_rho,
                                                                                                      turbulenceConstant,
            Pointers::SharedPointer< TurbulentViscosityGetter, DeviceType > turbulentViscosityGetter( turbulentEnergy_no_rho,
                                                                                                      disipation_no_rho);
            evaluator.evaluate( turbulentViscosity, turbulentViscosityGetter );
         }
+16 −16

File changed.

Preview size limit exceeded, changes collapsed.

Loading