Skip to content
Snippets Groups Projects
Commit 888f2a4d authored by Jan Schäfer's avatar Jan Schäfer
Browse files

dodelanz tokz pro jednotlive rovnice, neyasayedo do rovnic, jen hustota.

parent 3008a6e7
No related branches found
No related tags found
No related merge requests found
......@@ -77,35 +77,35 @@ class UpwindMomentumBase
else if ( machNumber <= 1.0 )
return density * speedOfSound * speedOfSound / ( 2 * this->gamma ) * ( ( machNumber - 1.0 ) * machNumber + ( - machNumber + 1.0 );
else
return density * velocity * velocity * pressure;
return density * velocity * velocity + pressure;
}
const RealType& positiveOtherMomentumFlux( const RealType& density, const RealType& velocity, const RealType& pressure )
const RealType& positiveOtherMomentumFlux( const RealType& density, const RealType& velocity_main, const RealType& velocity_other, const RealType& pressure )
{
const RealType& speedOfSound = std::sqrt( this->gamma * pressure / density );
const RealType& machNumber = velocity / speedOfSound;
const RealType& machNumber = velocity_main / speedOfSound;
if ( machNumber <= -1.0 )
return 0;
else if ( machNumber <= 0.0 )
return density * speedOfSound / ( 2 * this->gamma ) * ( machNumber + 1.0 );
return density * speedOfSound * speedOfSound / ( 2 * this->gamma ) * ( machNumber + 1.0 ) * velocity_other / speedOfSound;
else if ( machNumber <= 1.0 )
return density * speedOfSound / ( 2 * this->gamma ) * ( ( 2.0 * this->gamma - 1.0 ) * machNumber + 1.0 );
return density * speedOfSound * speedOfSound / ( 2 * this->gamma ) * ( ( 2.0 * this->gamma - 1.0 ) * machNumber + 1.0 ) * velocity_other / speedOfSound;
else
return density * velocity;
return density * velocity_main * velocity_other;
}
const RealType& negativeOtherMomentumFlux( const RealType& density, const RealType& velocity, const RealType& pressure )
const RealType& negativeOtherMomentumFlux( const RealType& density, const RealType& velocity_main, const RealType& velocity_other, const RealType& pressure )
{
const RealType& speedOfSound = std::sqrt( this->gamma * pressure / density );
const RealType& machNumber = velocity / speedOfSound;
const RealType& machNumber = velocity_main / speedOfSound;
if ( machNumber <= -1.0 )
return density * velocity;
return density * velocity_main * velocity_other;
else if ( machNumber <= 0.0 )
return density * speedOfSound / ( 2 * this->gamma ) * ( ( 2.0 * this->gamma - 1.0 ) * machNumber - 1.0 );
return density * speedOfSound * speedOfSound / ( 2 * this->gamma ) * ( ( 2.0 * this->gamma - 1.0 ) * machNumber + 1.0 ) * velocity_other / speedOfSound;
else if ( machNumber <= 1.0 )
return density * speedOfSound / ( 2 * this->gamma ) * ( machNumber - 1.0 );
return density * speedOfSound * speedOfSound / ( 2 * this->gamma ) * ( machNumber + 1.0 ) * velocity_other / speedOfSound;
else
return density * velocity;
return 0;
}
protected:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment