Solver Guide

OpenFOAM rhoSimpleFoam: the transonic Switch, Pressure Limits and Required Schemes

rhoSimpleFoam is the steady compressible solver: SIMPLE, with an energy equation and a density that follows the thermophysical model. It asks for a few things simpleFoam never asks for: a transonic switch, limits on the pressure, and extra divergence schemes for the energy equation. This page goes through them in the order the solver uses them, and says where the ESI and Foundation versions differ.

Read from rhoSimpleFoam.C, pEqn.H, EEqn.H and pressureControl.C in OpenFOAM v2506 (ESI, openfoam.com), from the same solver in OpenFOAM 9 (Foundation, openfoam.org), and from the squareBend tutorial of OpenFOAM 8, 9 and 10. No case was run for this page.

By Rayan Bhar, CFD Engineer ยท Updated November 2026

1. What one iteration does

Each SIMPLE iteration runs in the same order in both forks:

The ESI version has two pressure files: pEqn.H, and pcEqn.H when consistent yes; (SIMPLEC) is set. In OpenFOAM 9 one file handles both.

rhoSimpleFoam exists in the ESI version and in Foundation versions up to 10. Its source file is gone from OpenFOAM 11, where compressible flow runs through the solver modules.

2. The transonic switch

// system/fvSolution
SIMPLE
{
    nNonOrthogonalCorrectors 0;
    transonic       yes;
    consistent      yes;
}

Without transonic, the pressure equation is the usual one: a Laplacian of pressure balancing the divergence of the predicted mass flux. With transonic yes; the solver adds a convection term for pressure:

phid = ( interpolate(psi) / interpolate(rho) ) * phiHbyA

div(phiHbyA) + div(phid, p) - laplacian(rhorAUf, p) = sources

psi is the compressibility, the ratio of density to pressure for a perfect gas. The new term lets the equation see that density changes with pressure, which matters once the Mach number is high. Three things change with it:

3. Limiting the pressure

During the first iterations a compressible case can produce pressures far outside the physical range, and the density follows. Both forks let you bound the pressure. Where you write it depends on the version.

VersionWhereEntries
ESI (v2506), Foundation 8SIMPLE dictionary of fvSolutionpMinFactor, pMaxFactor, or pMin, pMax
Foundation 9 and 10system/fvConstraintstype limitPressure; with minFactor, maxFactor
// ESI and Foundation 8: system/fvSolution
SIMPLE
{
    pMinFactor      0.1;
    pMaxFactor      2;
}

// Foundation 9 and 10: system/fvConstraints
limitp
{
    type            limitPressure;
    minFactor       0.1;
    maxFactor       2;
}

The values 0.1 and 2 are those of the squareBend tutorial. In the ESI code the factors multiply a reference taken from the boundary conditions: the lowest and the highest pressure found on the patches where the pressure value is fixed.

Stuck on this in your own case?

CFDpilot is an AI agent for OpenFOAM that runs in your terminal. It reads the case files and the solver log on your machine, and shows every change as a diff before it edits a file.

Diagnose my case →

Start free · 200 credits · nothing charged

4. The energy equation and the schemes it needs

The energy equation is written for the variable of the thermophysical model, and it carries the kinetic energy with it:

// energy variable e (internal energy)
div(phi, e) + div(phi, Ekp) + heat flux = sources      Ekp = 0.5*|U|^2 + p/rho

// energy variable h (enthalpy)
div(phi, h) + div(phi, K)   + heat flux = sources      K   = 0.5*|U|^2

So the list of divergence schemes depends on your thermoType. With default none; the solver stops on the first missing entry and names it. The squareBend tutorial of OpenFOAM 9, which uses internal energy and transonic, has:

divSchemes
{
    default             none;
    div(phi,U)          bounded Gauss upwind;
    div(phi,e)          bounded Gauss upwind;
    div(phi,Ekp)        bounded Gauss upwind;
    div(phi,k)          bounded Gauss upwind;
    div(phi,epsilon)    bounded Gauss upwind;
    div(phid,p)         Gauss upwind;
    div(((rho*nuEff)*dev2(T(grad(U)))))  Gauss linear;
}

With enthalpy, replace the e and Ekp lines by div(phi,h) and div(phi,K). Upwind everywhere is a starting point to get a case running. It is not a setting for final results.

5. Relaxation

// squareBend tutorial, OpenFOAM 9: transonic and consistent both on
relaxationFactors
{
    fields
    {
        p               1;
    }
    equations
    {
        p               1;
        U               0.9;
        e               0.8;
        k               0.9;
        epsilon         0.9;
    }
}

These values go with consistent yes;. SIMPLEC tolerates factors close to 1. Without it, expect to need lower values.

Three relaxation entries matter, and the source shows when each one is used:

6. What to look at when a run goes wrong

Stuck on this in your own case?

CFDpilot is an AI agent for OpenFOAM that runs in your terminal. It reads the case files and the solver log on your machine, and shows every change as a diff before it edits a file.

Diagnose my case →

Start free · 200 credits · nothing charged

Source and documentation

Frequently Asked Questions

What does transonic do in rhoSimpleFoam?

It adds a convection term for pressure to the pressure equation, written div(phid,p), so that the equation accounts for the change of density with pressure. It is meant for flows that reach high subsonic or supersonic Mach numbers. With transonic on, the pressure equation is relaxed and the density is not, and fvSchemes needs an entry for div(phid,p).

How do I limit the pressure in rhoSimpleFoam?

In the ESI version and in Foundation 8, put pMinFactor and pMaxFactor, or absolute pMin and pMax, in the SIMPLE dictionary of fvSolution. In Foundation 9 and 10, use a limitPressure constraint with minFactor and maxFactor in system/fvConstraints. The factors multiply the lowest and highest pressure found on the patches where pressure is fixed.

Why does rhoSimpleFoam ask for pMax rather than pMaxFactor?

The factor needs a reference pressure, which the ESI code takes from the patches where the pressure value is fixed. If no patch fixes the pressure, there is no reference and the solver stops with a message asking for pMax instead of pMaxFactor. Give absolute values with pMin and pMax.

Which divergence schemes does rhoSimpleFoam need?

div(phi,U) for momentum, div(phi,e) with div(phi,Ekp) when the energy variable is internal energy, or div(phi,h) with div(phi,K) when it is enthalpy, the schemes of the turbulence fields, and the viscous term div(((rho*nuEff)*dev2(T(grad(U))))). With transonic on, div(phid,p) is required as well.

Does rhoSimpleFoam exist in OpenFOAM 11?

Not in the Foundation version. rhoSimpleFoam.C is in OpenFOAM 8, 9 and 10 and is absent from the OpenFOAM 11 source, where compressible flow is run through the solver modules. The ESI version still ships rhoSimpleFoam.