Gas Calculations
Gas calculations used with TASOPT.jl propulsion systems.
Ideal gas with variable $c_p$
TASOPT.engine.gas_tset
— Methodgas_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..nn
: number of constituents presenthspec
: specified enthalpytguess
: first guess for temperature
Output:
t
: temperature
TASOPT.engine.gas_tsetd
— Methodgas_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..nn
: number of constituents presenthspec
: specified enthalpytguess
: first guess for temperature
Outputs:
t
: temperaturet_hspec
: ?t_al
: ?
TASOPT.engine.gasfun
— Functiongasfun(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/dTh
: complete enthalpy function h[T]h_t
: dh/dTcp
: 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
TASOPT.engine.gaschem
— Methodgaschem(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
TASOPT.engine.gassum
— Methodgassum(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..nn
: number of gas constituentst
: temperature T, Kelvin
Outputs:
s
: entropy-complement function s[T]s_t
: ds/dTh
: complete enthalpy function h[T]h_t
: dh/dTcp
: specific heat cp[T]r
: ideal-gas constant R
TASOPT.engine.gassumd
— Methodgassumd(alpha, n, t)
Same as gassum, but also returns cp_t
🔃 Inputs and Outputs
Inputs:
alpha(.)
: mass fractions for gas constituents i = 1..nn
: number of gas constituentst
: temperature T, Kelvin
Outputs:
s
: entropy-complement function s[T]s_t
: ds/dTh
: complete enthalpy function h[T]h_t
: dh/dTcp
: specific heat cp[T]r
: ideal-gas constant Rcp_t
: dcp / dT
TASOPT.engine.gas_prat
— Methodgas_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..nn
: number of gas constituentspo
: starting pressureto
: starting temperatureho
: starting enthalpyso
: starting entropy-complementcpo
: starting specific heatro
: starting gas constantpratio
: pressure ratioepol
: polytropic efficiency of change process , if compressionepol
: 1/(polytropic efficiency of change process) , if expansion
Outputs:
p
: ending pressuret
: ending temperatureh
: ending enthalpys
: ending entropy-complementcp
: ending specific heatr
: ending gas constant (this will be the same as starting ro)
TASOPT.engine.gas_pratd
— Methodgas_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..nn
: number of gas constituentspo
: starting pressureto
: starting temperatureho
: starting enthalpyso
: starting entropy-complementcpo
: starting specific heatro
: starting gas constantpratio
: pressure ratioepol
: polytropic efficiency of change process , if compressionepol
: 1/(polytropic efficiency of change process) , if expansion
Outputs:
p
: ending pressuret
: ending temperatureh
: ending enthalpys
: ending entropy-complementcp
: ending specific heatr
: ending gas constant (this will be the same as starting ro)
TASOPT.engine.gas_delh
— Methodgas_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..nn
: number of constituents presentpo
: starting pressureto
: starting temperatureho
: starting enthalpyso
: starting entropy-complementcpo
: starting specific heatro
: starting gas constantdelh
: enthalpy changeepol
: polytropic efficiency of change process, if compression and 1/(polytropic efficiency of change process) , if expansion
Output:
p
: ending pressuret
: ending temperatureh
: ending enthalpys
: ending entropy-complementcp
: ending specific heatr
: ending gas constant (this will be the same as starting ro)
TASOPT.engine.gas_delhd
— Methodgas_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..nn
: number of constituents presentpo
: starting pressureto
: starting temperatureho
: starting enthalpyso
: starting entropy-complementcpo
: starting specific heatro
: starting gas constantdelh
: enthalpy changeepol
: polytropic efficiency of change process, if compression and 1/(polytropic efficiency of change process) , if expansion
Output:
p
: ending pressuret
: ending temperatureh
: ending enthalpys
: ending entropy-complementcp
: ending specific heatr
: 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
:
TASOPT.engine.gas_burn
— Methodgas_burn(alpha, beta, gamma, n, ifuel, to, tf, t, hvap)
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..ngamma(.)
: mass fraction changes of air constituents due to combustionn
: number of constituents present, air is 1..n-1, fuel is nifuel
: index specifying fuel moleculeto
: starting air temperaturtf
: starting fuel temperaturet
: temperature of combustion productshvap
: fuel enthalpy of vaporization
Output: f
: fuel/air mass fraction lambda(.)
: mass fractions for combustion product constituents
TASOPT.engine.gas_burnd
— Methodgas_burnd(alpha, beta, gamma, n, ifuel, to, tf, t, hvap)
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..ngamma(.)
: mass fraction changes of air constituents due to combustionn
: number of constituents present, air is 1..n-1, fuel is nifuel
: index specifying fuel moleculeto
: starting air temperaturtf
: starting fuel temperaturet
: temperature of combustion productshvap
: fuel enthalpy of vaporization
Output: f
: fuel/air mass fraction lambda(.)
: mass fractions for combustion product constituents f_t
: l_to
: l_tf
: l_t
:
TASOPT.engine.gas_mach
— Methodgas_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)
TASOPT.engine.gas_machd
— Methodgas_machd(alpha, n, po, to, ho, so, cpo, ro, mo, m, epol)
Same as gas_mach, but also returns derivatives
TASOPT.engine.gas_mass
— Methodgas_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..n
n number of constituents present po total pressure
to total temperature ho total enthalpy
so total entropy-complement cpo total specific heat
ro total gas constant mflux specified mass flux = rho u = mdot/A
Mguess specifies the initial guess for the static quantities
Output: p static pressure
t static temperature h static enthalpy
s static entropy-complement cp static specific heat
r static gas constant (this will be the same as total ro)
TASOPT.engine.gasfuel
— Methodgasfuel(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
TASOPT.engine.gasPr
— MethodgasPr(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 nameT::Float64
: temperature (K)
Outputs:
R::Float64
: gas constant (J/kg/K)Pr::Float64
: Prandtl numberγ::Float64
: ratio of specific heatscp::Float64
: specific heat at constant pressure (J/kg/K)μ::Float64
: dynamic viscosity (Pa s)k::Float64
: thermal conductivity (W/m/K)