SpectraSim Documentation
Parameter · 03 Model

Analysis type

model.analysis_type Step 03 · Model

Incompressible: the gas density is a constant and only velocity and pressure are solved (the incompressible solvers). Compressible: density, pressure, velocity and the energy equation are solved together with the ideal-gas law (the compressible solver, or the transient compressible solver for the pseudo-transient option).

Last updated

Theory

In an incompressible solve the density is the constant ρ\rho of the Material step, equation (1), at the gas temperature and the ambient pressure (or a typed manual value). OpenFOAM's incompressible solvers work with the kinematic pressure p/ρp/\rho; the program converts it back to pascals with that same ρ\rho for every reported pressure. The temperature does not change in the domain.

In a compressible solve the density follows the solved absolute pressure and temperature, equation (2), at every cell; the specific heat is constant or a function of temperature (Material step). The pressure is limited by the solver to 0.1 patm≤p≤2 patm0.1\,p_{atm} \le p \le 2\,p_{atm} (pMinFactor 0.1, pMaxFactor 2) (OpenFOAM user guide, 2026).

The two give the same pressure drop when the density barely changes through the muffler. The program measures that after an incompressible run with the ratio of the static pressure drop to the ambient pressure, equation (3), as a proxy of the density change, and checks the inlet Mach number before the run, equation (4).

Equations

ρ=pabsMRuT,pabs=patm+pref\rho = \frac{p_{abs} M}{R_u T}, \qquad p_{abs} = p_{atm} + p_{ref}
(1)
ρ(x)=p(x)RsT(x),Rs=RuM\rho(\mathbf{x}) = \frac{p(\mathbf{x})}{R_s T(\mathbf{x})}, \qquad R_s = \frac{R_u}{M}
(2)
ερ=∣Δps∣patm\varepsilon_\rho = \frac{\lvert\Delta p_s\rvert}{p_{atm}}
(3)
Ma=Uc(T),c=γRsTMa = \frac{U}{c(T)}, \qquad c = \sqrt{\gamma R_s T}
(4)
wheremeaningunit
ρ\rhoGas densitykg/m³
patmp_{atm}Ambient pressure (Material step)Pa
prefp_{ref}Reference gauge pressure: 0 (density reference "ambient") or half the static drop of the previous run ("mean")Pa
MMMolar mass of the gaskg/kmol
RuR_uUniversal gas constant, 8314.47J/(kmol K)
RsR_sSpecific gas constantJ/(kg K)
TTGas temperatureK
ερ\varepsilon_\rhoDensity-variation indicator-
Δps\Delta p_sMass-flow-weighted static pressure dropPa
MaMaInlet Mach number-
UUInlet velocity from the entered flow rate and the port aream/s
γ\gammaRatio of specific heats-

Default and rule

Default
incompressible
Rule

Incompressible. Heat transfer and the acoustic medium "From CFD fields" lock it to compressible.

Source

The 0.3 Mach rule is the usual limit of the constant-density assumption. The density-variation thresholds of 5 % (warning) and 15 % (failure of quality gate 2) are the program's own choice. The 0.6 Mach limit for the compressible solver is a conservative margin chosen from validation runs on case V1 (a 2.0 m multi-chamber muffler with a perforated pipe and three absorptive packings): the steady compressible solver ran at inlet Mach 0.15 and aborted in its third iteration at Mach 0.74 on every mesh tested; no Mach number in between has been tested.

Valid range incompressible | compressible; inlet Mach above 0.3 warns for incompressible, above 0.6 asks for confirmation for compressible

Incompressible above Mach 0.3

The pre-run setup check warns when an inlet exceeds Mach 0.3 with the incompressible analysis.

Density variation

After an incompressible run, quality gate 2 warns when ερ\varepsilon_\rho exceeds 5 % and fails above 15 %: the constant density is then not a valid assumption; run compressible, or set the density reference to "mean" on the Material step.

Compressible above Mach 0.6

Saving the boundary conditions of a compressible case with an inlet above Mach 0.6 asks for confirmation: the steady solver is subsonic and its pressure is limited to twice the ambient pressure.

Transient

A transient run is incompressible only.

References 1

  1. OpenCFD Ltd. (2026). OpenFOAM user guide. openfoam.com. Web page