Commit 36801887 authored by Jan Schäfer's avatar Jan Schäfer
Browse files

yprovoyneno euler2d

parent e46b224a
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -40,7 +40,8 @@ class EulerPressureGetter
      __cuda_callable__
      Real operator[]( const IndexType& idx ) const
      {
         return ( this->gamma - 1.0 ) * ( this->energy[ idx ] - 0.5 * this->rho[ idx ] * 
         if (this->rho[ idx ]==0) return 0; 
         else return ( this->gamma - 1.0 ) * ( this->energy[ idx ] - 0.5 * this->rho[ idx ] * 
         ( this->rhoVelX[ idx ] / this->rho[ idx ] + this->rhoVelY[ idx ] / this->rho[ idx ]) );
      }

+2 −1
Original line number Diff line number Diff line
@@ -37,7 +37,8 @@ class EulerVelGetter
      __cuda_callable__
      Real operator[]( const IndexType& idx ) const
      {
         return sqrt( pow( this->rhoVelX[ idx ] / this->rho[ idx ], 2) + pow( this->rhoVelY[ idx ] / this->rho[ idx ], 2) ) ;
cout << idx << endl;
         if (this->rho[ idx ]==0) return 0; else return sqrt( pow( this->rhoVelX[ idx ] / this->rho[ idx ], 2) + pow( this->rhoVelY[ idx ] / this->rho[ idx ], 2) ) ;
      }

      
+1 −1
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@ class EulerVelXGetter
      __cuda_callable__
      Real operator[]( const IndexType& idx ) const
      {
         return this->rhoVel[ idx ] / this->rho[ idx ];
         if (this->rho[ idx ]==0) return 0; else return this->rhoVel[ idx ] / this->rho[ idx ];
      }

      
+12 −12
Original line number Diff line number Diff line
@@ -37,14 +37,14 @@ class LaxFridrichsContinuity< tnlGrid< 1,MeshReal, Device, MeshIndex >, Real, In
          this->tau = tau;
      };

      void setVelocityX(const MeshFunctionType& velocityX)
      void setVelocityX(MeshFunctionType& velocityX)
      {
          this->velocityX = velocityX;
          this->velocityX.bind(velocityX);
      };

      void setVelocityY(const MeshFunctionType& velocityY)
      void setVelocityY(MeshFunctionType& velocityY)
      {
          this->velocityY = velocityY;
          this->velocityY.bind(velocityY);
      };


@@ -98,14 +98,14 @@ class LaxFridrichsContinuity< tnlGrid< 2,MeshReal, Device, MeshIndex >, Real, In
          this->tau = tau;
      };

      void setVelocityX(const MeshFunctionType& velocityX)
      void setVelocityX(MeshFunctionType& velocityX)
      {
          this->velocityX = velocityX;
          this->velocityX.bind(velocityX);
      };

      void setVelocityY(const MeshFunctionType& velocityY)
      void setVelocityY(MeshFunctionType& velocityY)
      {
          this->velocityY = velocityY;
          this->velocityY.bind(velocityY);
      };


@@ -159,14 +159,14 @@ class LaxFridrichsContinuity< tnlGrid< 3,MeshReal, Device, MeshIndex >, Real, In
          this->tau = tau;
      };

      void setVelocityX(const MeshFunctionType& velocityX)
      void setVelocityX(MeshFunctionType& velocityX)
      {
          this->velocityX = velocityX;
          this->velocityX.bind(velocityX);
      };

      void setVelocityY(const MeshFunctionType& velocityY)
      void setVelocityY(MeshFunctionType& velocityY)
      {
          this->velocityY = velocityY;
          this->velocityY.bind(velocityY);
      };


+2 −2
Original line number Diff line number Diff line
@@ -152,9 +152,9 @@ operator()( const MeshFunction& u,
   const IndexType& west  = neighbourEntities.template getEntityIndex< -1,  0 >(); 
   const IndexType& north = neighbourEntities.template getEntityIndex<  0,  1 >(); 
   const IndexType& south = neighbourEntities.template getEntityIndex<  0, -1 >(); 
   return (0.5 * this->tau) * ( u[ west ] + u[ east ] + u[ south ] + u[ north ] - 4.0 * u[ center ] ) 
   return (0.25 / this->tau) * ( u[ west ] + u[ east ] + u[ south ] + u[ north ] - 4.0 * u[ center ] ) 
          - 0.5 * hxInverse * ( u[ west ] * this->velocityX[ west ] - u[ east ] * this->velocityX[ east ] )
          - 0.5 * hyInverse * ( u[ north ] * this->velocityY[ north ] - u[ south ] * this->velocityY[ east ] );
          - 0.5 * hyInverse * ( u[ south ] * this->velocityY[ south ] - u[ north ] * this->velocityY[ north ] );
}

template< typename MeshReal,
Loading