Setup Guide

OpenFOAM Heat Transfer: buoyantSimpleFoam and chtMultiRegionFoam Setup

Heat transfer simulations in OpenFOAM require careful solver selection, correct thermophysical property definitions, and thermal boundary conditions that are consistent with both fluid and solid regions. This guide covers buoyantSimpleFoam for single-region convection, chtMultiRegionFoam for conjugate heat transfer, and the most common configuration mistakes that cause divergence or incorrect temperature fields.

By CFDpilot · Updated April 2026

1. Choosing the right solver

OpenFOAM offers multiple solvers for heat transfer. The choice depends on whether you need conjugate heat transfer (fluid + solid coupling), whether the flow is buoyancy-driven, and whether the simulation is steady-state or transient.

buoyantSimpleFoam

Use buoyantSimpleFoam for steady-state, single-fluid cases with natural or forced convection. The solver uses a pressure-velocity coupling based on SIMPLE, augmented with a buoyancy term in the momentum equation (Boussinesq approximation or full compressible treatment depending on thermophysicalProperties). Typical applications: room airflow with heat sources, cooling of electronics in a single-fluid domain, HVAC analysis.

The solver solves for pressure as p_rgh (pressure minus the hydrostatic component) rather than absolute pressure. This is important for boundary condition setup.

buoyantPimpleFoam

The transient equivalent of buoyantSimpleFoam. Use this when you need time-accurate results — oscillating plumes, startup transients, or unsteady natural convection. Configuration is nearly identical but uses the PIMPLE algorithm with nCorrectors and nOuterCorrectors.

chtMultiRegionFoam

Use chtMultiRegionFoam for conjugate heat transfer — cases where the solid structure is included in the domain and heat conduction through it matters. The solver handles multiple mesh regions (one per fluid or solid) and couples them at shared interfaces. Typical applications: electronics cooling with PCB and components, heat exchangers, turbine blade cooling.

The setup is significantly more complex: each region has its own 0/, constant/, and system/ subdirectories, and interface boundary conditions must be defined consistently on both sides.

2. thermophysicalProperties for buoyantSimpleFoam

The constant/thermophysicalProperties file defines the fluid model. This is the most common source of incorrect results and divergence in heat transfer cases.

Air at moderate temperatures (up to ~400K)

thermoType
{
    type            heRhoThermo;
    mixture         pureMixture;
    transport       const;
    thermo          hConst;
    equationOfState perfectGas;
    specie          specie;
    energy          sensibleEnthalpy;
}

mixture
{
    specie
    {
        molWeight   28.9;
    }
    thermodynamics
    {
        Cp          1005;
        Hf          0;
    }
    transport
    {
        mu          1.84e-05;
        Pr          0.713;
    }
}

Water as working fluid

thermoType
{
    type            heRhoThermo;
    mixture         pureMixture;
    transport       const;
    thermo          hConst;
    equationOfState Boussinesq;
    specie          specie;
    energy          sensibleEnthalpy;
}

mixture
{
    specie   { molWeight 18.0; }
    equationOfState
    {
        rho0    998.2;
        T0      293.15;
        beta    2.1e-04;
    }
    thermodynamics { Cp 4182; Hf 0; }
    transport      { mu 1.002e-03; Pr 6.99; }
}

The Boussinesq equation of state is valid only when temperature differences are small (deltaT < 20–30 K relative to the reference temperature T0). For larger temperature differences, use perfectGas with heRhoThermo.

3. Thermal boundary conditions

Heat transfer cases require BCs on the temperature field T and, for compressible solvers, on the enthalpy or energy field as well.

Fixed wall temperature

hotWall
{
    type            fixedValue;
    value           uniform 350;  // Kelvin
}

Adiabatic wall (zero heat flux)

insulatedWall
{
    type            zeroGradient;
}

Fixed heat flux

heatedSurface
{
    type            externalWallHeatFluxTemperature;
    mode            flux;
    q               uniform 5000;  // W/m^2
    kappaMethod     fluidThermo;
    value           uniform 300;
}

Convective heat transfer (external convection coefficient)

outerSurface
{
    type            externalWallHeatFluxTemperature;
    mode            coefficient;
    h               uniform 25;    // W/(m^2 K)
    Ta              uniform 300;   // ambient temperature
    kappaMethod     fluidThermo;
    value           uniform 300;
}

p_rgh boundary conditions

buoyantSimpleFoam uses p_rgh instead of p. The BCs must reflect this:

// Inlet
inlet { type fixedFluxPressure; value uniform 0; }

// Outlet
outlet { type fixedValue; value uniform 0; }

// Walls
walls { type fixedFluxPressure; value uniform 0; }

fixedFluxPressure adjusts the pressure gradient at walls to be consistent with the buoyancy term — using zeroGradient on p_rgh at walls produces incorrect buoyancy-driven flows.

4. chtMultiRegionFoam: multi-region setup

chtMultiRegionFoam requires that the mesh be split into regions before running. Each region is a subdirectory of constant/.

Splitting the mesh into regions

Define regions in constant/regionProperties:

regions
(
    fluid  ( air )
    solid  ( heatsink )
);

Then use splitMeshRegions -cellZones -overwrite to partition the mesh. This reads cell zones defined in blockMesh or snappyHexMesh and creates the regional subdirectory structure.

Solid region thermophysicalProperties

// constant/heatsink/thermophysicalProperties
thermoType
{
    type    heSolidThermo;
    mixture pureMixture;
    transport constIso;
    thermo  hConst;
    equationOfState rhoConst;
    specie  specie;
    energy  sensibleEnthalpy;
}

mixture
{
    specie          { molWeight 26.98; }  // aluminium
    equationOfState { rho 2700; }
    thermodynamics  { Cp 900; Hf 0; }
    transport       { kappa 205; }       // W/(m K)
}

Interface boundary conditions

At fluid-solid interfaces, both sides must use coupled boundary conditions. OpenFOAM handles this through the compressible::turbulentTemperatureCoupledBaffleMixed type:

// In 0/air/T for the fluid-solid interface patch
fluid_to_solid
{
    type           compressible::turbulentTemperatureCoupledBaffleMixed;
    Tnbr           T;
    kappaMethod    fluidThermo;
    value          uniform 300;
}

// In 0/heatsink/T for the same patch (opposite side)
solid_to_fluid
{
    type           compressible::turbulentTemperatureCoupledBaffleMixed;
    Tnbr           T;
    kappaMethod    solidThermo;
    value          uniform 300;
}

5. fvSolution for heat transfer cases

The temperature/enthalpy equation needs its own solver settings. In buoyantSimpleFoam, the energy equation is solved for h or e:

solvers
{
    p_rgh
    {
        solver          GAMG;
        smoother        GaussSeidel;
        tolerance       1e-7;
        relTol          0.01;
    }
    "(U|h|k|epsilon)"
    {
        solver          smoothSolver;
        smoother        symGaussSeidel;
        tolerance       1e-7;
        relTol          0.1;
    }
}

SIMPLE
{
    momentumPredictor     on;
    nNonOrthogonalCorrectors 0;
    consistent            yes;

    residualControl
    {
        p_rgh     1e-4;
        U         1e-4;
        h         1e-4;
        k         1e-4;
        epsilon   1e-4;
    }
}

relaxationFactors
{
    equations
    {
        U         0.7;
        h         0.5;
        k         0.5;
        epsilon   0.5;
    }
    fields
    {
        p_rgh     0.3;
        rho       0.05;
    }
}

Note the rho relaxation factor — for compressible heat transfer with significant density variation, relaxing density updates prevents oscillations in the pressure-density coupling.

6. Monitoring temperature convergence

Temperature residuals in heat transfer simulations behave differently from velocity and pressure residuals. The enthalpy equation is typically solved last in each SIMPLE iteration, after the velocity and pressure are already updated. This means:

Add a probe at the expected maximum temperature location using function objects to track convergence in time without inspecting the full field.

FAQ

When should I use buoyantSimpleFoam vs chtMultiRegionFoam?

Use buoyantSimpleFoam for single-fluid natural or forced convection where the solid structure is not part of the domain. Use chtMultiRegionFoam when you need coupled heat conduction through solid regions — electronics cooling, heat exchangers, engine components. The extra complexity of chtMultiRegionFoam is only justified when the solid thermal resistance significantly affects the flow.

What thermophysicalProperties model should I use for air in OpenFOAM?

For air at moderate temperatures, use heRhoThermo with pureMixture, perfectGas equation of state, sensibleEnthalpy, and const transport. For high-temperature flows above 800K, use janafThermo for temperature-dependent Cp. For incompressible flow with small temperature differences, Boussinesq with heRhoThermo is appropriate.

How do I set a fixed temperature boundary condition in OpenFOAM?

For the T field, use fixedValue with the temperature in Kelvin. For enthalpy-based solvers (buoyantSimpleFoam), also set the enthalpy field consistently using the fixedValue BC with value computed as Cp * T.

What residual tolerance should I use for temperature in OpenFOAM?

Temperature residuals typically converge more slowly than velocity and pressure. A tolerance of 1e-6 for the linear solver is standard. The outer residual (monitored in the SIMPLE loop) should drop by at least 3 orders of magnitude for a well-configured case. Set residualControl h 1e-4 or tighter in SIMPLE.

How do I apply a heat flux boundary condition in OpenFOAM?

Use externalWallHeatFluxTemperature in mode flux with the desired heat flux in W/m². This BC handles the conversion from flux to gradient internally and is more robust than specifying fixedGradient on T directly.

Why does my buoyantSimpleFoam case diverge?

Common causes: wrong thermophysicalProperties (incorrect Cp or Pr), using the Boussinesq approximation with deltaT > 20K, missing or wrong p_rgh BCs (not using fixedFluxPressure at walls), or relaxation factors too high for h. Start with h relaxation = 0.3 if the case is unstable.

Official documentation

Get your heat transfer setup diagnosed — free

Upload your buoyantPimpleFoam or chtMultiRegion case and CFDpilot checks thermophysical properties, energy BCs, and solver settings.

Diagnose my case →