Welcome to AE Resources
Converted document ROOT FINDING EXAMPLES

ROOT FINDING EXAMPLES

Example: Determination of Mach number from Prandtl-Mayer Expansion equation.
The Prandtl-Meyer expansion fan is the isentropic relation between a turning angle and the increase in Mach number. The ν parameter is the Prandtl-Meyer function, and it is the only quantity that is typically expressed in degrees.
ν(M) = (γ + 1)/(γ − 1)1 ⁄ 2tan − 1(M2 − 1)/((γ + 1)/(γ − 1) − M2)1 ⁄ 2 − tan − 1(M2 − 1)/(1 − (γ − 1)/(γ + 1)M2)1 ⁄ 2
This code works for turning angles up to approximately 100 degrees.
PROGRAM prandtl_meyer
IMPLICIT NONE
REAL, PARAMETER :: pi=4.0*ATAN(1.0)
REAL :: nu, nr, ml, mr, mm, nm, gam_rat, mach
​
! what P-M number is to be solved?
WRITE(*,*) ’ What Prandtl-Meyer number (in degrees) is to be solved?’
READ (*,*) nu
​
! Convert to Radians - Intrinsic functions assume radians
nu = nu * pi/180.
​
! set up the starting parameters
nr = nu
ml = 1.   ! Left Mach limit; lower limit for supersonic flow
mr = 10.  ! Right Mach limit; assumption - be careful!
​
! Assume calorically perfect gas
gam_rat = SQRT(2.4/0.4) ! (gamma+1)/(gamma-1)
DO WHILE ((mr-ml) > 0.01)
   mm = (ml+mr)*0.5
   nm = gam_rat*ATAN(1./gam_rat*SQRT(mm*mm-1.0)) &
        -ATAN(SQRT(mm*mm-1.0))
​
   IF (nr > nm) THEN
       ml = mm
   ELSE IF (nr < nm) THEN
       mr = mm;
   ENDIF
​
END DO
​
mach=(mr+ml)*0.5
​
! Convert back to degrees
nu = nu * 180./pi
WRITE(6,*) ’For a turning angle = ’,nu,’degrees, the Mach = ’, mach
​
END PROGRAM prandtl_meyer