Skip to content

Eurocode fire analysis: 500 °C isotherm method — Part 1: Analysis

This script runs the transient heat-transfer analysis for the EN 1992-1-2 simplified assessment workflow:

  1. Define a concrete slab with temperature-dependent thermal properties per EN 1992-1-2 §3.3 (conductivity, specific heat, density).
  2. Apply the ISO 834 standard fire curve on the exposed face via convection (h = 25 W/m²K) and radiation (ε = 0.7) as per EN 1991-1-2.
  3. Run a transient heat-transfer analysis for R120 (120 min).
  4. Visualise the temperature field with the 500 °C isotherm highlighted and generate cross-section plots.

The mesh is checkpointed after meshing (mesh.pkl) so that re-runs skip the expensive meshing step. Delete it to force a re-mesh. BCs and problem definition are always re-applied (cheap, change often).

The companion script fire_isotherm_500_postprocess.py imports the converged results and builds the reduced cross-section geometry.

The model before it is solved: parts, supports and loads

The model before it is solved: its parts, supports (red) and loads (blue).

The result: the model coloured by temperature (T [K])

The model, coloured by temperature (T [K]), in xfea’s 3D viewer.

Open in 3D turn it, cut it, pick any field: in xfea's viewer, in your browser

examples/scripts/02_core_concepts/thermal_analysis/fire_isotherm_500.py. Run it from the repository with uv run python examples/scripts/02_core_concepts/thermal_analysis/fire_isotherm_500.py, or, with xfea-examples installed, xfea-examples run 02_core_concepts/thermal_analysis/fire_isotherm_500.py.

import os
import matplotlib.pyplot as plt
import numpy as np
from xfea.meshing import MeshingSettings
from xfea.model import BoundaryInterface
from xfea.model import Convection
from xfea.model import Model
from xfea.model import Part
from xfea.model import Radiation
from xfea.model import SolidSection
from xfea.model import ThermalElasticIsotropic
from xfea.problem import HeatTransferStep
from xfea.problem import Problem
from xfea.results import TemperatureFieldResults
from xfea_examples import show_viewer
from xfea_examples import out_dir
from xfea_examples.step import box_step
from xfea_tools import iso834
from xfea_tools import on_bbox
from xfea_tools import faces_to_mesh_object
OUTPUT_DIR = out_dir("fire_isotherm_500")
MESH_PKL = os.path.join(OUTPUT_DIR, "mesh.pkl")
MODEL_PKL = os.path.join(OUTPUT_DIR, "model.pkl")
FIRE_DURATION = 7200 # [s] fire exposure duration (120 min = R120)
T_INITIAL = 293.15 # [K] initial uniform temperature (20 °C)
# Geometry
width = 1000 # [mm] slab width
depth = 1000 # [mm] slab depth
height = 120 # [mm] slab height (thickness)
mesh_min = 10 # [mm] target min element size
mesh_max = 25 # [mm] target max element size
# Stage 1: Geometry + Material + Mesh (checkpointed → mesh.pkl)
print("=" * 60)
print("Stage 1: Geometry + Material + Mesh")
print("=" * 60)
if os.path.exists(MESH_PKL):
print(f" Loading mesh checkpoint: {MESH_PKL}")
model = Model.from_pickle(MESH_PKL)
else:
# The column's geometry, written as a STEP file next to the results
step_path = box_step(os.path.join(OUTPUT_DIR, "fire_column.stp"), width, depth, height)
# -- Material: concrete with temperature-dependent properties (EN 1992-1-2 §3.3) --
def _ec2_conductivity(T_celsius):
"""EN 1992-1-2 Eq. 3.5 — lower limit of thermal conductivity [W/(m·K)]."""
T100 = T_celsius / 100.0
return max(1.36 - 0.136 * T100 + 0.0057 * T100**2, 0.5)
def _ec2_specific_heat(T_celsius):
"""EN 1992-1-2 §3.3.2 — specific heat of siliceous concrete [J/(kg·K)]."""
if T_celsius <= 100:
return 900.0
elif T_celsius <= 200:
return 900.0 + (T_celsius - 100)
elif T_celsius <= 400:
return 1000.0 + (T_celsius - 200) / 2.0
else:
return 1100.0
_temps_C = list(range(20, 1201, 50))
k_table = [(_ec2_conductivity(T), T + 273.15) for T in _temps_C]
# SI-mm: energy = mJ, mass = tonne → c [mJ/(tonne·K)] = c [J/(kg·K)] × 1e6
c_table = [(_ec2_specific_heat(T) * 1e6, T + 273.15) for T in _temps_C]
# Concrete structural properties (SI-mm) — present but unused in pure heat transfer
E_conc = 30_000 # [MPa] Young's modulus
v_conc = 0.2 # [-] Poisson's ratio
rho_conc = 2.3e-9 # [t/mm^3] mass density (2300 kg/m^3)
mat = ThermalElasticIsotropic(
k=k_table,
c=c_table,
E=E_conc,
v=v_conc,
density=rho_conc,
)
sec = SolidSection(material=mat)
model = Model(name="fire_isotherm_500")
part = model.add_part(Part(name="column"))
part.base_geometry = step_path
part.mesh(settings=MeshingSettings(min=mesh_min, max=mesh_max), section=sec)
# Save mesh checkpoint (no BCs, no Problem — just the expensive bit)
model.to_pickle(MESH_PKL, summary=False)
print(f" Mesh checkpoint saved: {MESH_PKL}")
part = list(model.parts)[0]
print(f" Mesh: {len(list(part.nodes))} nodes, {len(list(part.elements))} elements")
# Stage 2: Boundary conditions (always re-applied — cheap, change often)
print(f"\n{'=' * 60}")
print("Stage 2: Boundary conditions (fire exposure)")
print("=" * 60)
# ISO 834 fire curve amplitude
fire_curve = iso834(FIRE_DURATION, dt=60, name="ISO834")
# Select exposed faces (bottom face, z=0)
boundary_faces = part.find_boundary_faces()
fire_faces = boundary_faces.subgroup(lambda f: on_bbox(f, "zmin"))
fire_surface = part.add_group(fire_faces)
fire_surface.name = "fire_exposed"
print(f" Fire-exposed surface: {len(list(fire_faces.faces))} faces")
# Convection: α_c = 25 W/(m²·K) per EN 1991-1-2 §3.1
h_conv = 25.0e-3 # [mW/(mm^2*K)] convection coefficient (= 25 W/(m^2*K))
convection = Convection(
h=h_conv,
temperature_value=1.0,
temperature_amplitude=fire_curve,
)
model.add_interface(BoundaryInterface(master=fire_surface, behavior=convection))
# Radiation: ε = 0.7 (ε_m × ε_f, EN 1991-1-2 §3.1)
emissivity = 0.7 # [-] combined surface/flame emissivity
radiation = Radiation(
eps=emissivity,
temperature_value=1.0,
temperature_amplitude=fire_curve,
)
model.add_interface(BoundaryInterface(master=fire_surface, behavior=radiation))
# Initial temperature
model.add_uniform_thermal_ics_field(T0=T_INITIAL, nodes=part.nodes)
# Stage 3: Problem definition + Analysis
print(f"\n{'=' * 60}")
print("Stage 3: Transient heat transfer analysis")
print("=" * 60)
problem = model.add_problem(Problem(name="fire_R120"))
step = problem.add_step(
HeatTransferStep(
name="fire_exposure",
time=FIRE_DURATION,
initial_inc_size=2,
min_inc_size=0.1,
max_inc_size=60,
max_increments=10000,
max_temp_delta=50,
steady_state=False,
)
)
temp = TemperatureFieldResults()
step.add_field_outputs([temp])
print(" Running transient heat transfer analysis...")
problem.analyse_and_extract(path=OUTPUT_DIR, verbose=True)
# Query the final time step only
min_T = temp.get_min_result("T", time=FIRE_DURATION)
max_T = temp.get_max_result("T", time=FIRE_DURATION)
print(f"\n Final temperatures: min = {float(min_T.T):.1f} K ({float(min_T.T) - 273.15:.1f} °C), "
f"max = {float(max_T.T):.1f} K ({float(max_T.T) - 273.15:.1f} °C)")
# Save the full model (mesh + BCs + Problem with path to results DB).
# summary.json is auto-generated alongside — human-readable record of
# what is inside the pickle.
model.to_pickle(MODEL_PKL)
print(f" Model saved: {MODEL_PKL}")
print(f" Summary: {MODEL_PKL.replace('.pkl', '.json')}")
# 500 °C isotherm — count elements above/below threshold
T_ISOTHERM = 773.15 # [K] 500 °C isotherm threshold
print(f"\n{'=' * 60}")
print(f"500 °C isotherm: identifying elements where T > {T_ISOTHERM} K")
print("=" * 60)
# Build a node-temperature lookup from the FINAL time step only
final_results = temp.get_results(time=FIRE_DURATION)
node_temps = {}
for r in final_results:
loc = r.location
if loc is not None:
node_temps[loc.key] = float(r.T)
# Classify elements by averaging their nodal temperatures
n_orig = 0
n_hot = 0
hot_element_keys = set()
for element in part.elements:
n_orig += 1
vals = [node_temps.get(n.key) for n in element.nodes if n.key in node_temps]
if vals and (sum(vals) / len(vals)) > T_ISOTHERM:
n_hot += 1
hot_element_keys.add(element.key)
n_cold = n_orig - n_hot
print(f" Original: {n_orig} elements")
print(f" T > 500 C: {n_hot} elements ({n_hot/n_orig:.1%})")
print(f" T < 500 C: {n_cold} elements ({n_cold/n_orig:.1%})")
# Viewer — colour elements above 500 °C
hot_faces = boundary_faces.subgroup(
lambda f: f.element.key in hot_element_keys
)
hot_highlight = faces_to_mesh_object(
hot_faces,
color=(1.0, 0.15, 0.0),
opacity=0.85,
name="hot_zone_T>500C",
offset=0.3,
)
# Opens the viewer when asked to (XFEA_EXAMPLES_SHOW_VIEWER=1); in an unattended run it would wait for ever.
show_viewer(model, results={temp: "T"}, units="K", highlights=[hot_highlight])
# Cross-section plots
print(f"\n{'=' * 60}")
print("Generating cross-section plots")
print("=" * 60)
fig, axes = plt.subplots(1, 2, figsize=(14, 6))
xs = np.array([r.location._x for r in final_results])
ys = np.array([r.location._y for r in final_results])
zs = np.array([r.location._z for r in final_results])
ts = np.array([float(r.T) - 273.15 for r in final_results])
# --- Panel 1: Temperature field at mid-section (y = depth/2) ---
mask_y = np.abs(ys - depth / 2) < 30
tri = axes[0].tricontourf(xs[mask_y], zs[mask_y], ts[mask_y], levels=32, cmap="hot_r")
fig.colorbar(tri, ax=axes[0], label="Temperature [°C]")
try:
axes[0].tricontour(xs[mask_y], zs[mask_y], ts[mask_y],
levels=[500], colors="cyan", linewidths=2)
except Exception:
pass
axes[0].set_xlabel("x [mm]")
axes[0].set_ylabel("z [mm] (distance from fire face)")
axes[0].set_title(f"Temperature at y = {depth/2:.0f} mm (t = {FIRE_DURATION/60:.0f} min)")
axes[0].set_aspect("equal")
# --- Panel 2: Temperature profile through depth ---
centre_mask = (np.abs(xs - width / 2) < 20) & (np.abs(ys - depth / 2) < 20)
z_line = zs[centre_mask]
t_line = ts[centre_mask]
sort_idx = np.argsort(z_line)
axes[1].plot(z_line[sort_idx], t_line[sort_idx], "r-o", markersize=3, label="FEA")
axes[1].axhline(y=500, color="cyan", linestyle="--", linewidth=2, label="500 °C isotherm")
axes[1].set_xlabel("z [mm] (distance from fire face)")
axes[1].set_ylabel("Temperature [°C]")
axes[1].set_title("Temperature Profile Through Depth")
axes[1].legend()
axes[1].grid(True, alpha=0.3)
fig.suptitle(
f"EN 1992-1-2 — ISO 834 Fire Exposure (R{FIRE_DURATION//60})",
fontsize=14, fontweight="bold",
)
fig.tight_layout()
plot_path = os.path.join(OUTPUT_DIR, "fire_isotherm_500.png")
fig.savefig(plot_path, dpi=150)
print(f" Plot saved: {plot_path}")
plt.close(fig)
# Summary
print(f"\n{'=' * 60}")
print("EN 1992-1-2 — 500 °C Isotherm Method Summary")
print("=" * 60)
print(f" Fire curve: ISO 834")
print(f" Exposure: {FIRE_DURATION/60:.0f} min (R{FIRE_DURATION//60})")
print(f" Section: {width} x {depth} x {height} mm")
print(f" Concrete: EN 1992-1-2 properties (lower-limit conductivity)")
print(f" Convection: h = 25 W/(m^2 K)")
print(f" Radiation: eps = 0.7")
print(f" Max temperature: {float(max_T.T) - 273.15:.0f} C")
print(f" Min temperature: {float(min_T.T) - 273.15:.0f} C")
print(f" Original elements: {n_orig}")
print(f" T > 500 C: {n_hot} elements ({n_hot/n_orig:.1%})")
print(f" T < 500 C: {n_cold} elements ({n_cold/n_orig:.1%})")
print(f" Output directory: {OUTPUT_DIR}")

© 2026 Francesco Ranaudo · Text and pictures CC BY 4.0 · Code Elastic License 2.0 · how to reuse them