# Documentation

### This is machine translation

Translated by
Mouseover text to see original. Click the button below to return to the English verison of the page.

To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

# flowrayleigh

Rayleigh line flow relations

## Syntax

```[mach, T, P, rho, velocity, T0, P0] = flowrayleigh(gamma, rayleigh_flow, mtype)```

## Description

```[mach, T, P, rho, velocity, T0, P0] = flowrayleigh(gamma, rayleigh_flow, mtype)``` returns an array for each Rayleigh line flow relation. This function calculates these arrays for a given set of specific heat ratios (`gamma`), and any one of the Rayleigh line flow types. You select the Rayleigh flow type with `mtype`.

This function assumes that the medium is a calorically perfect gas in a constant area duct. It assumes that the flow is steady, frictionless, and one dimensional. It also assumes that the main mechanism for the change of flow variables is heat transfer.

This function assumes that the environment is a perfect gas. In the following instances, it cannot assume a perfect gas environment. If there is a large change in either temperature or pressure without a proportionally large change in the other, it cannot assume a perfect gas environment. If the stagnation temperature is above 1500 K, do not assume constant specific heats. In this case, the medium ceases to be a calorically perfect gas; you must then consider it a thermally perfect gas. See 2 for thermally perfect gas correction factors. The local static temperature might be so high that molecules dissociate and ionize (static temperature 5000 K for air). In this case, you cannot assume a calorically or thermally perfect gas.

## Input Arguments

`gamma`

Array of `N` specific heat ratios. `gamma` must be either a scalar or an array of `N` real numbers greater than 1. `gamma` must be a real, finite scalar greater than 1 for the following input modes: low speed temperature ratio, high speed temperature ratio, subsonic total temperature, supersonic total temperature, subsonic total pressure, and supersonic total pressure.

`rayleigh_flow`

Array of real numerical values for one Rayleigh line flow. This argument can be one of the following:

• Array of Mach numbers. This array must be a scalar or an array of `N` real numbers greater than or equal to 0. If `rayleigh_flow` and `gamma` are arrays, they must be the same size.

Use `rayleigh_flow` with `mtype` value `'mach'`. Because `'mach'` is the default of `mtype`, `mtype` is optional when this array is the input mode.

• Scalar value of temperature ratio. The temperature ratio is the local static temperature over the reference static temperature for sonic flow. `rayleigh_flow` must be a real scalar:

• Greater than or equal to 0 (at the Mach number equal 0 for low speeds or as Mach number approaches infinity for high speeds)

• Less than or equal to 1/4*(`gamma`+1/`gamma`)+1/2 (at `mach` = 1/sqrt(`gamma`))

Use `rayleigh_flow` with `mtype` values `'templo'` and `'temphi'`.

• Array of pressure ratios. The pressure ratio is the local static pressure over the reference static pressure for sonic flow. `rayleigh_flow` must be a scalar or array of real numbers less than or equal to `gamma`+1 (at the Mach number equal 0). If `rayleigh_flow` and `gamma` are arrays, they must be the same size.

Use `rayleigh_flow` with `mtype` value `'pres'`.

• Array of density ratios. The density ratio is the local density over the reference density for sonic flow. `rayleigh_flow` must be a scalar or array of real numbers. These numbers must be greater than or equal to:

`gamma`/(`gamma`+1) (as Mach number approaches infinity)

If `rayleigh_flow` and `gamma` are arrays, they must be the same size.

Use `rayleigh_flow` with `mtype` value `'dens'`.

• Array of velocity ratios. The velocity ratio is the local velocity over the reference velocity for sonic flow. `rayleigh_flow` must be a scalar or an array of `N` real numbers:

• Greater than or equal to 0

• Less than or equal to (`gamma`+1)/`gamma` (as Mach number approaches infinity)

If `rayleigh_flow` and `gamma` are both arrays, they must be the same size.

Use `rayleigh_flow` with `mtype` value `'velo'`.

• Scalar value of total temperature ratio. The total temperature ratio is the local stagnation temperature over the reference stagnation temperature for sonic flow. In subsonic mode, `rayleigh_flow` must be a real scalar:

• Greater than or equal to 0 (at the Mach number equal 0)

• Less than or equal to 1 (at the Mach number equal 1)

In supersonic mode, `rayleigh_flow` must be a real scalar:

• Greater than or equal to (`gamma`+1)^2*(`gamma`-1)/2/(`gamma`^2*(1+(`gamma`-1)/2))) (as Mach number approaches infinity)

• Less than or equal to 1 (at the Mach number equal 1)

Use `rayleigh_flow` with the `mtype` values `'totaltsub'` and `'totaltsup'`.

• Scalar value of total pressure ratio. The total pressure ratio is the local stagnation pressure over the reference stagnation pressure for sonic flow. In subsonic mode, `rayleigh_flow` must be a real scalar.

• Greater than or equal to 1 (at the Mach number equal 1)

• Less than or equal to (1+`gamma`)*(1+(`gamma`-1)/2)^(-`gamma`/(`gamma`-1)) (at Mach number equal 0)

In supersonic mode, `rayleigh_flow` must be a real scalar greater than or equal to 1.

Use `rayleigh_flow` with `mtype` values `'totalpsub'` and `'totalpsup'`.

`mtype`

Input mode for the Rayleigh flow in `rayleigh_flow`.

TypeDescription
`'mach'`Default. Mach number.
`'templo'`Low speed static temperature ratio. The low speed temperature ratio is the local static temperature over the reference sonic temperature. This ratio for when the Mach number of the upstream flow is less than the critical Mach number of 1/sqrt(`gamma`).
`'temphi'`High speed static temperature ratio. The high speed temperature ratio is the local static temperature over the reference sonic temperature. This ratio is for when the Mach number of the upstream flow is greater than the critical Mach number of 1/sqrt(`gamma`).
`'pres' `Pressure ratio.
`'dens'`Density ratio.
`'velo'`Velocity ratio.
`'totaltsub'`Subsonic total temperature ratio.
`'totaltsup'`Supersonic total temperature ratio.
`'totalpsub'`Subsonic total pressure ratio.
`'totalpsup'`Supersonic total pressure ratio.

## Output Arguments

All output ratios are static conditions over the sonic conditions. All outputs are the same size as the array inputs. If there are no array inputs, all outputs are scalars.

 `mach` Array of Mach numbers. `T` Array of temperature ratios. The temperature ratio is the local static temperature over the reference static temperature for sonic flow. `P` Array of pressure ratios. The pressure ratio is the local static pressure over the reference static pressure for sonic flow. `rho` Array of density ratio. The density ratio is the local density over the reference density for sonic flow. `velocity` Array of velocity ratios. The velocity ratio is the local velocity over the reference velocity for sonic flow. `T0` Array of total temperature ratios. The temperature ratio is the local stagnation temperature over the reference stagnation temperature for sonic flow. `P0` Array of total pressure ratios. The total pressure ratio is the local stagnation pressure over the reference stagnation pressure for sonic flow.

## Examples

collapse all

Calculate the Rayleigh line flow relations for air (`gamma` = 1.4) for supersonic total pressure ratio 1.2.

`[mach,T,P,rho,velocity,T0,P0] = flowrayleigh(1.4,1.2,'totalpsup')`
```mach = 1.6397 T = 0.6823 P = 0.5038 rho = 0.7383 velocity = 1.3545 T0 = 0.8744 P0 = 1.2000 ```

This example returns scalar values for `mach`, `T`, `P`, `rho`, `velocity`, `T0`, and `P0`.

Calculate the Rayleigh line flow relations for gases with specific heat ratios given in the following 1 x 4 row array for the Mach number 0.5.

```gamma = [1.3,1.33,1.4,1.67]; [mach,T,P,rho,velocity,T0,P0] = flowrayleigh(gamma,0.5)```
```mach = 0.5000 0.5000 0.5000 0.5000 T = 0.7533 0.7644 0.7901 0.8870 P = 1.7358 1.7486 1.7778 1.8836 rho = 2.3043 2.2876 2.2500 2.1236 velocity = 0.4340 0.4371 0.4444 0.4709 T0 = 0.6796 0.6832 0.6914 0.7201 P0 = 1.1111 1.1121 1.1141 1.1202 ```

This example returns a 1 x 4 row array for `mach`, `T`, `P`, `rho`, `velocity`, `T0`, and `P0`.

Calculate the Rayleigh line flow relations for a specific heat ratio of 1.4 and high speed temperature ratio 0.70.

`[mach,T,P,rho,velocity,T0,P0] = flowrayleigh(1.4,0.70,'temphi')`
```mach = 1.6035 T = 0.7000 P = 0.5218 rho = 0.7454 velocity = 1.3416 T0 = 0.8833 P0 = 1.1777 ```

This example returns scalar values for `mach`, `T`, `P`, `rho`, `velocity`, `T0`, and `P0`.

Calculate the Rayleigh line flow relations for gases with specific heat ratio and static pressure ratio combinations as shown.

```gamma = [1.3,1.4]; P = [0.13,1.7778]; [mach,T,P,rho,velocity,T0,P0] = flowrayleigh(gamma,P,'pres')```
```mach = 3.5833 0.5000 T = 0.2170 0.7901 P = 0.1300 1.7778 rho = 0.5991 2.2501 velocity = 1.6692 0.4444 T0 = 0.5521 0.6913 P0 = 7.4381 1.1141```

This example returns a 1 x 2 array for `mach`, `T`, `P`, `rho`, `velocity`, `T0`, and `P0` each. The elements of each array correspond to the inputs element-wise.

## References

1. James, J. E. A., Gas Dynamics, Second Edition, Allyn and Bacon, Inc, Boston, 1984.

2. NACA Technical Report 1135, 1953, National Advisory Committee on Aeronautics, Ames Research Staff, Moffett Field, Calif. Pages 667–671.