Gas Calculations

Gas calculations used with TASOPT.jl propulsion systems.

Ideal gas with variable $c_p$

TASOPT.engine.gas_tsetMethod
gas_tset(alpha, n, hspec, tguess)

Calculates temperature for a specified enthalpy. The constant-cp equivalent is

          t = (hspec - hf) /cp  

 where hf is the heat of formation included in h[t]
🔃 Inputs and Outputs

Input:

  • alpha(.): mass fractions for gas constituents i = 1..n
  • n: number of constituents present
  • hspec: specified enthalpy
  • tguess: first guess for temperature

Output:

  • t: temperature
source
TASOPT.engine.gas_tsetdMethod
gas_tsetd(alpha, n, hspec, tguess)

Same as gas_tset, but also returns derivative

🔃 Inputs and Outputs

Inputs:

  • alpha(.): mass fractions for gas constituents i = 1..n
  • n: number of constituents present
  • hspec: specified enthalpy
  • tguess: first guess for temperature

Outputs:

  • t: temperature
  • t_hspec: ?
  • t_al: ?
source
TASOPT.engine.gasfunFunction
gasfun(igas, t)

Computes properties of a thermally-perfect gas with some variable specific heat cp[T].

🔃 Inputs and Outputs

Input:

  • igas: index specifying the gas (see if blocks below for list)
  • t: temperature T in Kelvin

Output:

  • s: entropy-complement function s[T]
  • s_t: ds/dT
  • h: complete enthalpy function h[T]
  • h_t: dh/dT
  • cp: specific heat cp[T]
  • r: ideal-gas constant R

The adiabatic pressure change over a process 1->2 with some polytropic efficiency epol is:

$\ p2 = \ p1 exp [ epol (s2-s1)/R ]$ compression

$\ p2 = \ p1 exp [ (1/epol) (s2-s1)/R ]$ expansion

source
TASOPT.engine.gaschemMethod
gaschem(igas)

Returns number of C,H,O,N atoms in gas molecule, for the gases implemented in function gasfun above.

🔃 Inputs and Outputs

Input:

  • igas: index specifying the gas (see if blocks below for list)

Output:

  • nchon(.): number of C,H,O,N atoms in gas molecule
source
TASOPT.engine.gassumMethod
gassum(alpha, n, t)

Calculates all gas-mixture properties at specified temperature T, and mixing fractions alpha(.)

🔃 Inputs and Outputs

Inputs:

  • alpha(.): mass fractions for gas constituents i = 1..n
  • n: number of gas constituents
  • t: temperature T, Kelvin

Outputs:

  • s: entropy-complement function s[T]
  • s_t: ds/dT
  • h: complete enthalpy function h[T]
  • h_t: dh/dT
  • cp: specific heat cp[T]
  • r: ideal-gas constant R
source
TASOPT.engine.gassumdMethod
gassumd(alpha, n, t)

Same as gassum, but also returns cp_t

🔃 Inputs and Outputs

Inputs:

  • alpha(.): mass fractions for gas constituents i = 1..n
  • n: number of gas constituents
  • t: temperature T, Kelvin

Outputs:

  • s: entropy-complement function s[T]
  • s_t: ds/dT
  • h: complete enthalpy function h[T]
  • h_t: dh/dT
  • cp: specific heat cp[T]
  • r: ideal-gas constant R
  • cp_t: dcp / dT
source
TASOPT.engine.gas_pratMethod
gas_prat(alpha, n, po, to, ho, so, cpo, ro, pratio, epol)

Calculates state change for a specified pressure ratio. The constant-cp equivalent is the usual isentropic relations, but with epol included.

g = cp/(cp-r)
gexp = (g-1)/(g*epol)
tau = pratio^gexp
p = po * pratio
t = to * tau
(h-hf) = (ho-hf) * tau
🔃 Inputs and Outputs

Inputs:

  • alpha(.): mass fractions for gas constituents i = 1..n
  • n: number of gas constituents
  • po: starting pressure
  • to: starting temperature
  • ho: starting enthalpy
  • so: starting entropy-complement
  • cpo: starting specific heat
  • ro: starting gas constant
  • pratio: pressure ratio
  • epol: polytropic efficiency of change process , if compression
  • epol: 1/(polytropic efficiency of change process) , if expansion

Outputs:

  • p: ending pressure
  • t: ending temperature
  • h: ending enthalpy
  • s: ending entropy-complement
  • cp: ending specific heat
  • r: ending gas constant (this will be the same as starting ro)
source
TASOPT.engine.gas_pratdMethod
gas_pratd(alpha, n, po, to, ho, so, cpo, ro, pratio, epol)

Same as gas_prat, but also returns Jacobians w.r.t. po,to,pratio,epol

🔃 Inputs and Outputs

Inputs:

  • alpha(.): mass fractions for gas constituents i = 1..n
  • n: number of gas constituents
  • po: starting pressure
  • to: starting temperature
  • ho: starting enthalpy
  • so: starting entropy-complement
  • cpo: starting specific heat
  • ro: starting gas constant
  • pratio: pressure ratio
  • epol: polytropic efficiency of change process , if compression
  • epol: 1/(polytropic efficiency of change process) , if expansion

Outputs:

  • p: ending pressure
  • t: ending temperature
  • h: ending enthalpy
  • s: ending entropy-complement
  • cp: ending specific heat
  • r: ending gas constant (this will be the same as starting ro)
source
TASOPT.engine.gas_delhMethod
gas_delh(alpha, n, po, to, ho, so, cpo, ro, delh, epol)

Calculates state change for a specified enthalpy change. The constant-cp equivalent is the usual isentropic relations, but with epol included.

  t - to = delh/cp
  g = cp/(cp-r)
  gexp = (g-1)/(g*epol)
  tau = t/to
  pi = tau^(1/gexp)
  p = po * pi
  (h-hf) = (ho-hf) * tau
🔃 Inputs and Outputs

Inputs:

  • alpha(.): mass fractions for gas constituents i = 1..n
  • n: number of constituents present
  • po: starting pressure
  • to: starting temperature
  • ho: starting enthalpy
  • so: starting entropy-complement
  • cpo: starting specific heat
  • ro: starting gas constant
  • delh: enthalpy change
  • epol: polytropic efficiency of change process, if compression and 1/(polytropic efficiency of change process) , if expansion

Output:

  • p: ending pressure
  • t: ending temperature
  • h: ending enthalpy
  • s: ending entropy-complement
  • cp: ending specific heat
  • r: ending gas constant (this will be the same as starting ro)
source
TASOPT.engine.gas_delhdMethod
gas_delhd(alpha, n, po, to, ho, so, cpo, ro, delh, epol)

Same as gas_delh, but also returns Jacobians w.r.t. po,to,delh

🔃 Inputs and Outputs

Inputs:

  • alpha(.): mass fractions for gas constituents i = 1..n
  • n: number of constituents present
  • po: starting pressure
  • to: starting temperature
  • ho: starting enthalpy
  • so: starting entropy-complement
  • cpo: starting specific heat
  • ro: starting gas constant
  • delh: enthalpy change
  • epol: polytropic efficiency of change process, if compression and 1/(polytropic efficiency of change process) , if expansion

Output:

  • p: ending pressure
  • t: ending temperature
  • h: ending enthalpy
  • s: ending entropy-complement
  • cp: ending specific heat
  • r: ending gas constant (this will be the same as starting ro)
  • p_so:
  • p_po:
  • p_ep:
  • p_ho:
  • t_ho:
  • h_ho:
  • s_ho:
  • p_dh:
  • t_dh:
  • h_dh:
  • s_dh:
  • p_al:
  • t_al:
  • h_al:
  • s_al:
  • cp_al:
  • r_al:
source
TASOPT.engine.gas_burnMethod
gas_burn(alpha, beta, gamma, n, ifuel, to, tf, t)

Calculates fuel/air mass fraction in combustion with specified start and end temperatures to,t . Calculates mass fractions of post-combustion constituents

🔃 Inputs and Outputs

Input: alpha(.): mass fractions for air constituents i = 1..n

  • beta(.): mass fractions for fuel constituents i = 1..n
  • gamma(.): mass fraction changes of air constituents due to combustion
  • n: number of constituents present, air is 1..n-1, fuel is n
  • ifuel: index specifying fuel molecule
  • to: starting air temperatur
  • tf: starting fuel temperature
  • t: temperature of combustion products

Output: f: fuel/air mass fraction lambda(.): mass fractions for combustion product constituents

source
TASOPT.engine.gas_burndMethod
gas_burnd(alpha, beta, gamma, n, ifuel, to, tf, t)

Same as gas_burn, but also returns derivatives.

🔃 Inputs and Outputs

Input: alpha(.): mass fractions for air constituents i = 1..n

  • beta(.): mass fractions for fuel constituents i = 1..n
  • gamma(.): mass fraction changes of air constituents due to combustion
  • n: number of constituents present, air is 1..n-1, fuel is n
  • ifuel: index specifying fuel molecule
  • to: starting air temperatur
  • tf: starting fuel temperature
  • t: temperature of combustion products

Output: f: fuel/air mass fraction lambda(.): mass fractions for combustion product constituents f_t: l_to: l_tf: l_t:

source
TASOPT.engine.gas_machMethod
gas_mach(alpha, n, po, to, ho, so, cpo, ro, mo, m, epol)

Calculates state change for a specified Mach number change. The constant-cp equivalent is the usual isentropic relations, but with epol included.

g = cp/(cp-r)
gexp = (g-1)/(g*epol)
tau = (1 + 0.5*(g-1)*mo^2) / (1 + 0.5*(g-1)*m^2)
pi = tau^(1/gexp)
p = po * pi
t = to * tau
(h-hf) = (ho-hf) * tau
  
!!! details "🔃 Inputs and Outputs"     
**Input:**
`alpha(.)`: mass fractions for gas constituents i = 1..n
`n`: number of constituents present
`po`: starting pressure
`to`: starting temperature
`ho`: starting enthalpy
`so`: starting entropy-complement
`cpo`: starting specific heat
`ro`: starting gas constant
`mo`: starting Mach number
`m`: ending Mach number
`epol`: polytropic efficiency of change process  , if compression
`epol`: 1/(polytropic efficiency of change process) , if expansion
  
**Output:**
`p`: ending pressure
`t`: ending temperature
`h`: ending enthalpy
`s`: ending entropy-complement
`cp`: ending specific heat
`r`: ending gas constant (this will be the same as starting ro)
source
TASOPT.engine.gas_massMethod
gas_mass(alpha, n, po, to, ho, so, cpo, ro, mflux, Mguess)

Calculates state a specified mass flux. Mguess specifies the initial guess, and also selects either the subsonic or the supersonic branch.

🔃 Inputs and Outputs

Input: alpha(.) mass fractions for gas constituents i = 1..nn number of constituents present po total pressureto total temperature ho total enthalpyso total entropy-complement cpo total specific heatro total gas constant mflux specified mass flux = rho u = mdot/AMguess specifies the initial guess for the static quantities

Output: p static pressuret static temperature h static enthalpys static entropy-complement cp static specific heatr static gas constant (this will be the same as total ro)

source
TASOPT.engine.gasfuelMethod
gasfuel(ifuel, n)

Returns mass fraction of constituent changes as a result of combustion with atmospheric oxygen

🔃 Inputs and Outputs

Input:

  • `ifuel index of fuel (see function gasfun)
  • `n number of constituents in reaction

Output:

  • `gamma(.) mass fraction changes due to reaction for i = 1..n
source
TASOPT.engine.gasPrMethod
gasPr(gas, T)

This function calculates some gas thermodynamic properties of different species, including viscosity, thermal conductivity, specific heat, and Prandtl number.

🔃 Inputs and Outputs

Inputs:

  • gas::char: gas name
  • T::Float64: temperature (K)

Outputs:

  • R::Float64: gas constant (J/kg/K)
  • Pr::Float64: Prandtl number
  • γ::Float64: ratio of specific heats
  • cp::Float64: specific heat at constant pressure (J/kg/K)
  • μ::Float64: dynamic viscosity (Pa s)
  • k::Float64: thermal conductivity (W/m/K)
source