From 888f2a4d725b630e51d5c509677a055844d47619 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20Sch=C3=A4fer?= <schafjan@fjfi.cvut.cz>
Date: Wed, 9 May 2018 22:56:01 +0200
Subject: [PATCH] dodelanz tokz pro jednotlive rovnice, neyasayedo do rovnic,
 jen hustota.

---
 .../inviscid-flow-sw/UpwindMomentumBase.h     | 24 +++++++++----------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/examples/inviscid-flow-sw/UpwindMomentumBase.h b/examples/inviscid-flow-sw/UpwindMomentumBase.h
index 8bbc9015a9..dd33e3a978 100644
--- a/examples/inviscid-flow-sw/UpwindMomentumBase.h
+++ b/examples/inviscid-flow-sw/UpwindMomentumBase.h
@@ -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:
-- 
GitLab