SpectraSim Documentation
Parameter · 04 Material

Material (custom gas)

material.custom Step 04 · Material

The gas of the material library (Tools > Material library) that flows through the muffler when Fluid is "Custom gas". The project keeps a copy of its values, so it runs the same on a computer whose library does not have it.

Last updated

Theory

A custom gas is an ideal gas described by five things the user enters in the library: the molar mass Molar mass (custom gas), the heat capacity Heat capacity model (custom gas) (a constant Specific heat cp (custom gas) or a polynomial cp(T) coefficients (custom gas) over a temperature range Polynomial temperature range (custom gas)), the viscosity law Viscosity (custom gas) and the Prandtl number Prandtl number (custom gas). From them the program derives everything the air and exhaust-gas choices give: the density of the incompressible solve, the thermophysical model of the compressible solver (perfectGas equation of state, hConst or janaf thermodynamics, sutherland transport (OpenFOAM user guide, 2026)), the heat-transfer correlations and the speed of sound and density of the acoustics, equations (1) to (3).

Choosing a material copies its values into the case file. Later edits in the library affect an open project only while its Material step is open and shows that material; other projects keep their copy.

When an opened project's gas is not in the library, or differs from the library material of the same name, the Material step reports it and offers two actions: add the gas to the library, or take the library's values.

The Material step's table shows the gas next to dry air at the step's temperature and ambient pressure.

The program also has five standard gases: nitrogen, oxygen, carbon dioxide, argon and water vapour. They are choices of the Fluid list itself (Fluid), not of this list, which holds only the user's own gases. They come with the program, cannot be changed and are not exported; "Start from a standard gas" in the library window makes an editable copy. Their values are derived from NASA data in the library's own form, over 200 to 1500 K (water vapour from 373.2 K, where NASA's transport data begin and below which steam condenses at atmospheric pressure):

  • Heat capacity. The cp polynomial of degree four is fitted by least squares on the relative error to the NASA Glenn coefficients (McBride et al., 2002).
  • Viscosity. The NASA transport data (Svehla, 1995) give the viscosity and the thermal conductivity by equation (4). Sutherland's law, equation (5), is fitted to that viscosity: written as equation (6), it is linear in the two constants, which are found by one weighted least-squares fit on the relative error. The reference viscosity is the law's value at 273.15 K (373.15 K for water vapour).
  • Prandtl number. Held at the mean of equation (7) over the range.

Each standard gas's description gives the largest deviation of its cp, viscosity and Prandtl number from the NASA data over its range: cp within 0.5 %, viscosity within 2.6 %, Prandtl number within 5.5 % (water vapour; 3 to 4 % for the diatomic gases and carbon dioxide, 0.1 % for argon).

Equations

ρ=p MR T\rho = \frac{p\,M}{\mathcal{R}\,T}
(1)
γ(T)=cp(T)cp(T)−R/M\gamma(T) = \frac{c_p(T)}{c_p(T) - \mathcal{R}/M}
(2)
c=γ RM Tc = \sqrt{\gamma\,\frac{\mathcal{R}}{M}\,T}
(3)
wheremeaningunit
ρ\rhoDensitykg/m³
ppAbsolute pressurePa
MMMolar mass of the gaskg/kmol
R\mathcal{R}Universal gas constant, 8314.47J/(kmol K)
TTTemperatureK
cpc_pSpecific heat capacity at constant pressureJ/(kg K)
γ\gammaRatio of heat capacities-
ccSpeed of soundm/s
ln⁡η=Aln⁡T+BT+CT2+D\ln \eta = A \ln T + \frac{B}{T} + \frac{C}{T^2} + D
(4)
μ=As T3/2T+S\mu = \frac{A_s\,T^{3/2}}{T + S}
(5)
T3/2μ=1As T+SAs\frac{T^{3/2}}{\mu} = \frac{1}{A_s}\,T + \frac{S}{A_s}
(6)
Pr(T)=μ(T) cp(T)k(T)\mathrm{Pr}(T) = \frac{\mu(T)\,c_p(T)}{k(T)}
(7)
wheremeaningunit
η\etaViscosity in micropoise (10⁻⁷ Pa s), or thermal conductivity in µW/(cm K) with its own coefficients-
A,B,C,DA, B, C, DCoefficients of the NASA transport data, per gas and temperature range-
μ\muDynamic viscosityPa s
AsA_sSutherland coefficientPa s/K^0.5
SSSutherland temperatureK
kkThermal conductivityW/(m K)
Pr\mathrm{Pr}Prandtl number-

Default and rule

Default
none (choose one)
Rule

None: a custom gas must be chosen (or added to the library) before the step can be saved.

Source

Ideal-gas relations, equations (1) to (3); the solver models are OpenFOAM's (OpenFOAM user guide, 2026). A constant heat capacity is written as hConst thermodynamics, a polynomial as janaf. The standard gases are derived from the NASA Glenn coefficients (McBride et al., 2002) and the NASA transport data (Svehla, 1995), equations (4) to (7). The library is stored per user in %LOCALAPPDATA%\<program>\materials\materials.json.

Valid range a gas of the material library

Ideal gas only

Liquids and real-gas equations of state are not available; a muffler carries a gas at near-atmospheric pressure, where the ideal-gas law holds.

Standard gases

Valid from 200 K (water vapour 373.2 K) to 1500 K. Outside that range the solver holds cp at the end value and the Material step warns.

Library

Kept on this computer for the user, in every project. Export and Import in the library window copy it to another computer; the uninstaller offers to save a copy.

References 3

  1. McBride, B. J., Zehe, M. J. and Gordon, S. (2002). NASA Glenn coefficients for calculating thermodynamic properties of individual species. NASA/TP-2002-211556, NASA Glenn Research Center. Web page
  2. OpenCFD Ltd. (2026). OpenFOAM user guide. openfoam.com. Web page
  3. Svehla, R. A. (1995). Transport coefficients for the NASA Lewis chemical equilibrium program. NASA TM-4647, NASA Lewis Research Center. Web page