From ba470d5ec95d46a66888b4b9c64d67d4f7862c86 Mon Sep 17 00:00:00 2001 From: Grzegorz Kowal Date: Sun, 15 Feb 2015 08:17:51 -0200 Subject: [PATCH] EQUATIONS: Simplify the W guess and pressure in cons2prim_srhd_adi(). The initia guess for enthalphy can be estimated from the total energy and minimum pressure. In the similar way, the pressure can be obtained by subtracting the energy from enthalphy. Signed-off-by: Grzegorz Kowal --- src/equations.F90 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/equations.F90 b/src/equations.F90 index 4443029..092c100 100644 --- a/src/equations.F90 +++ b/src/equations.F90 @@ -3110,11 +3110,11 @@ module equations ! get the lower bound for W updated by the minimum pressure with assumed Γ = 1 ! - wm = sqrt(dn * dn + mm) + pmin / gammaxi + wm = en + pmin ! set the initial W to the minimum value ! - w = wm + w = wm ! find the exact W using an Newton-Ralphson interative method ! @@ -3131,7 +3131,7 @@ module equations q(ivx,i) = u(imx,i) / w q(ivy,i) = u(imy,i) / w q(ivz,i) = u(imz,i) / w - q(ipr,i) = gammaxi * (w * vs - dn) * vs + q(ipr,i) = w - en end do ! i = 1, n