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

opraveny chyby, 1D a 2D ozkouseno

parent 65d2e07c
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -42,8 +42,8 @@ class EulerPressureGetter
      __cuda_callable__
      Real operator[]( const IndexType& idx ) const
      {
          //if (this->rho[ idx ]==0) return 0; else return ( this->gamma - 1.0 ) * ( this->energy[ idx ] - 0.5 * this->rhoVel[ idx ] * this->rhoVel[ idx ] / this->rho[ idx ]);
          return ( this->gamma - 1.0 ) * this->energy[ idx ] * this->rho[ idx ];
          if (this->rho[ idx ]==0) return 0; else return ( this->gamma - 1.0 ) * ( this->energy[ idx ] - 0.5 * this->rhoVel[ idx ] * this->rhoVel[ idx ] / this->rho[ idx ]);
          //return ( this->gamma - 1.0 ) * this->energy[ idx ] * this->rho[ idx ];

      }

+2 −0
Original line number Diff line number Diff line
@@ -45,6 +45,8 @@ operator()( const MeshFunction& u,
    const IndexType& west = neighbourEntities.template getEntityIndex< -1 >();
    return (0.5 / this->tau) * ( u[ west ] - 2.0 * u[ center ]  + u[ east ] ) 
          - 0.5 * hxInverse * ( u[ east ] * this->velocity[ east ] - u[ west ] * this->velocity[ west ] );
	  /*(0.5) * ( u[ west ]  + u[ east ] ) 
          - 0.5 * hxInverse * this->tau * ( u[ east ] * this->velocity[ east ] - u[ west ] * this->velocity[ west ] );*/
}

template< typename MeshReal,
+4 −0
Original line number Diff line number Diff line
@@ -47,6 +47,10 @@ operator()( const MeshFunction& u,
          - 0.5 * hxInverse * 
          (( u[ east ] * this -> velocity[ east ] + this -> pressure [ east ] ) 
          -( u[ west ] * this -> velocity[ west ] + this -> pressure [ west ] ));
	  /*(0.5) * ( u[ west ] + u[ east ] ) 
          - 0.5 * hxInverse * this->tau *
          (( u[ east ] * this -> velocity[ east ] + this -> pressure [ east ] ) 
          -( u[ west ] * this -> velocity[ west ] + this -> pressure [ west ] ));*/
}

template< typename MeshReal,
+10 −10
Original line number Diff line number Diff line
@@ -60,7 +60,7 @@ setup( const MeshPointer& meshPointer,
       const Config::ParameterContainer& parameters,
       const String& prefix )
{
   if( ! this->boundaryConditionsPointer->setup( meshPointer, parameters, prefix + "boundary-conditions-" ) ||
   if( //! this->boundaryConditionsPointer->setup( meshPointer, parameters, prefix + "boundary-conditions-" ) ||
       ! this->rightHandSidePointer->setup( parameters, prefix + "right-hand-side-" ) )
      return false;
   return true;
@@ -103,19 +103,19 @@ setInitialCondition( const Config::ParameterContainer& parameters,
                     DofVectorPointer& dofs,
                     MeshDependentDataPointer& meshDependentData )
{
  std::cout << std::endl << "get conditions from CML";
  std::cout << std::endl << "get conditions from CMD";
   typedef typename MeshType::Cell Cell;
   this->gamma = parameters.getParameter< RealType >( "gamma" );
   RealType rhoL = parameters.getParameter< RealType >( "left-density" );
   RealType velL = parameters.getParameter< RealType >( "left-velocity" );
   RealType preL = parameters.getParameter< RealType >( "left-pressure" );
   RealType eL = ( preL / ( rhoL * (gamma - 1) ) );
   //RealType eL = ( preL / (gamma - 1) ) + 0.5 * rhoL * velL * velL;
   //RealType eL = ( preL / ( rhoL * (gamma - 1) ) );
   RealType eL = ( preL / (gamma - 1) ) + 0.5 * rhoL * velL * velL;
   RealType rhoR = parameters.getParameter< RealType >( "right-density" );
   RealType velR = parameters.getParameter< RealType >( "right-velocity" );
   RealType preR = parameters.getParameter< RealType >( "right-pressure" );
   RealType eR = ( preR / ( rhoR * (gamma - 1) ) );
   //RealType eR = ( preR / (gamma - 1) ) + 0.5 * rhoR * velR * velR;
   //RealType eR = ( preR / ( rhoR * (gamma - 1) ) );
   RealType eR = ( preR / (gamma - 1) ) + 0.5 * rhoR * velR * velR;
   RealType x0 = parameters.getParameter< RealType >( "riemann-border" );
   int count = mesh->template getEntitiesCount< Cell >();
   uRho->bind( mesh, *dofs, 0);
@@ -125,7 +125,7 @@ setInitialCondition( const Config::ParameterContainer& parameters,
   data.setSize(2*count);
   velocity->bind( mesh, data, 0);
   pressure->bind( mesh, data, count );
   std::cout << std::endl << "set conditions from CML"<< std::endl;   
   std::cout << std::endl << "set conditions from CMD"<< std::endl;   
   for(IndexType i = 0; i < count; i++)
      if (i < x0 * count )
         {
@@ -230,9 +230,9 @@ getExplicitRHS( const RealType& time,
    typedef typename MeshType::Cell Cell;
    int count = mesh->template getEntitiesCount< Cell >();
	//bind _fu
    this->fuRho->bind(mesh, _u, 0);
    this->fuRhoVelocity->bind(mesh, _u, count);
    this->fuEnergy->bind(mesh, _u, 2 * count);
    this->fuRho->bind(mesh, _fu, 0);
    this->fuRhoVelocity->bind(mesh, _fu, count);
    this->fuEnergy->bind(mesh, _fu, 2 * count);

   //generating Differential operator object
   SharedPointer< Continuity > lF1DContinuity;
+3 −3
Original line number Diff line number Diff line
@@ -43,10 +43,10 @@ class EulerPressureGetter
      __cuda_callable__
      Real operator[]( const IndexType& idx ) const
            {
/*         if (this->rho[ idx ]==0) return 0; 
         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 ]) );
*/       return ( this->gamma - 1.0 ) * ( this->energy[ idx ] * this->rho[ idx ] );
         ( std::pow(this->rhoVelX[ idx ] / this->rho[ idx ],2) + std::pow(this->rhoVelY[ idx ] / this->rho[ idx ],2) ) );
//*/       return ( this->gamma - 1.0 ) * ( this->energy[ idx ] * this->rho[ idx ] );
      }

      
Loading