SurfaceBuilder¶
Builder for creating surface definitions with a fluent API.
SurfaceBuilder
¶
Bases: Builder[Surface]
Builder for creating SURF namelists.
Provides a fluent API for constructing surfaces with thermal properties, burning behavior, flow conditions, and material layers.
The builder groups the 150+ SURF parameters into logical method categories:
- Identification: .id(), .color(), .rgb()
- Temperature: .temperature(), .adiabatic()
- Heat transfer: .heat_transfer()
- Burning/Fire: .burning(), .fire_spread()
- Flow/HVAC: .flow()
- Material layers: .layer()
- Radiation: .emissivity()
Examples:
>>> # Simple fire surface
>>> fire = SurfaceBuilder() \
... .id("FIRE") \
... .burning(hrrpua=1000.0) \
... .color("RED") \
... .build()
>>> # Thermal boundary with fixed temperature
>>> hot_wall = SurfaceBuilder() \
... .id("HOT_WALL") \
... .temperature(tmp_front=200.0) \
... .build()
>>> # Multi-layer wall
>>> wall = SurfaceBuilder() \
... .id("INSULATED_WALL") \
... .layer("CONCRETE", thickness=0.2) \
... .layer("INSULATION", thickness=0.05) \
... .layer("GYPSUM", thickness=0.013) \
... .backing("EXPOSED") \
... .build()
>>> # HVAC supply vent
>>> supply = SurfaceBuilder() \
... .id("SUPPLY") \
... .flow(volume_flow=0.5) \
... .temperature(tmp_front=20.0) \
... .build()
>>> # Ramped fire growth
>>> fire = SurfaceBuilder() \
... .id("GROWING_FIRE") \
... .burning(hrrpua=2500.0, ramp_q="FIRE_RAMP") \
... .build()
Initialize the SurfaceBuilder.
Source code in src/pyfds/builders/surface.py
Functions¶
id
¶
Set surface identifier (required).
| PARAMETER | DESCRIPTION |
|---|---|
surface_id
|
Unique surface identifier
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
SurfaceBuilder
|
Self for method chaining |
Examples:
Source code in src/pyfds/builders/surface.py
color
¶
Set named color for visualization.
| PARAMETER | DESCRIPTION |
|---|---|
color
|
Color name (e.g., 'RED', 'BLUE', 'GREEN', 'GRAY')
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
SurfaceBuilder
|
Self for method chaining |
Examples:
Source code in src/pyfds/builders/surface.py
rgb
¶
Set RGB color for visualization.
| PARAMETER | DESCRIPTION |
|---|---|
r
|
Red component (0-255)
TYPE:
|
g
|
Green component (0-255)
TYPE:
|
b
|
Blue component (0-255)
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
SurfaceBuilder
|
Self for method chaining |
Examples:
Source code in src/pyfds/builders/surface.py
transparency
¶
Set surface transparency.
| PARAMETER | DESCRIPTION |
|---|---|
value
|
Transparency value (0.0 = opaque, 1.0 = fully transparent)
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
SurfaceBuilder
|
Self for method chaining |
Source code in src/pyfds/builders/surface.py
temperature
¶
Set temperature boundary conditions.
| PARAMETER | DESCRIPTION |
|---|---|
tmp_front
|
Front surface temperature [°C]
TYPE:
|
tmp_back
|
Back surface temperature [°C]
TYPE:
|
tmp_inner
|
Initial solid interior temperature [°C]
TYPE:
|
ramp_t
|
Temperature ramp ID for time-varying front temperature
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
SurfaceBuilder
|
Self for method chaining |
Examples:
>>> # Fixed temperature wall
>>> wall = SurfaceBuilder().id("HOT").temperature(tmp_front=100.0).build()
>>> # Temperature ramp
>>> wall = SurfaceBuilder().id("HEATING").temperature(
... tmp_front=500.0, ramp_t="TEMP_RAMP"
... ).build()
Source code in src/pyfds/builders/surface.py
adiabatic
¶
Set surface as adiabatic (no heat transfer).
| RETURNS | DESCRIPTION |
|---|---|
SurfaceBuilder
|
Self for method chaining |
Examples:
Source code in src/pyfds/builders/surface.py
heat_transfer
¶
Set heat transfer parameters.
| PARAMETER | DESCRIPTION |
|---|---|
coefficient
|
Heat transfer coefficient [W/(m²·K)]
TYPE:
|
coefficient_back
|
Back side heat transfer coefficient [W/(m²·K)]
TYPE:
|
model
|
Heat transfer model: 'LOGLAW' or 'IMPINGING JET'
TYPE:
|
convection_length_scale
|
Characteristic length for convection [m]
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
SurfaceBuilder
|
Self for method chaining |
Examples:
Source code in src/pyfds/builders/surface.py
burning
¶
burning(
hrrpua=None,
mlrpua=None,
heat_of_combustion=None,
ignition_temperature=None,
ramp_q=None,
tau_q=None,
burn_away=None,
)
Set burning/fire properties.
| PARAMETER | DESCRIPTION |
|---|---|
hrrpua
|
Heat release rate per unit area [kW/m²]
TYPE:
|
mlrpua
|
Mass loss rate per unit area [kg/(s·m²)]
TYPE:
|
heat_of_combustion
|
Heat of combustion [kJ/kg]
TYPE:
|
ignition_temperature
|
Ignition temperature [°C]
TYPE:
|
ramp_q
|
RAMP ID for heat release rate time history
TYPE:
|
tau_q
|
Time constant for t² fire growth [s]
TYPE:
|
burn_away
|
Allow surface to burn away when fuel depleted
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
SurfaceBuilder
|
Self for method chaining |
Examples:
>>> # Constant HRR fire
>>> fire = SurfaceBuilder().id("FIRE") \
... .burning(hrrpua=1000.0) \
... .build()
>>> # Ramped fire
>>> fire = SurfaceBuilder().id("FIRE") \
... .burning(hrrpua=2500.0, ramp_q="FIRE_RAMP") \
... .build()
>>> # t² fire growth
>>> fire = SurfaceBuilder().id("FIRE") \
... .burning(hrrpua=1000.0, tau_q=300.0) \
... .build()
Source code in src/pyfds/builders/surface.py
fire_spread
¶
Set fire spread parameters.
| PARAMETER | DESCRIPTION |
|---|---|
spread_rate
|
Radial fire spread rate [m/s]
TYPE:
|
ignition_point
|
Ignition point (x, y, z) coordinates
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
SurfaceBuilder
|
Self for method chaining |
Examples:
>>> fire = SurfaceBuilder().id("SPREADING_FIRE") \
... .burning(hrrpua=500.0) \
... .fire_spread(spread_rate=0.01, ignition_point=(5.0, 5.0, 0.0)) \
... .build()
Source code in src/pyfds/builders/surface.py
external_flux
¶
Set external radiative flux (e.g., for cone calorimeter).
| PARAMETER | DESCRIPTION |
|---|---|
flux
|
External heat flux [kW/m²]
TYPE:
|
ramp_ef
|
Ramp ID for external flux time history
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
SurfaceBuilder
|
Self for method chaining |
Source code in src/pyfds/builders/surface.py
flow
¶
Set flow properties for HVAC surfaces.
| PARAMETER | DESCRIPTION |
|---|---|
vel
|
Velocity magnitude [m/s] (negative = into domain)
TYPE:
|
volume_flow
|
Volume flow rate [m³/s]
TYPE:
|
mass_flow
|
Mass flow rate [kg/s]
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
SurfaceBuilder
|
Self for method chaining |
Notes
Only one of vel, volume_flow, or mass_flow should be specified.
Examples:
>>> # Exhaust at 0.5 m³/s
>>> exhaust = SurfaceBuilder().id("EXHAUST").flow(volume_flow=-0.5).build()
Source code in src/pyfds/builders/surface.py
layer
¶
Add a material layer.
Call multiple times for multi-layer surfaces. Layers are ordered from front (exposed) to back.
| PARAMETER | DESCRIPTION |
|---|---|
matl_id
|
Material ID (must be defined in simulation)
TYPE:
|
thickness
|
Layer thickness [m]
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
SurfaceBuilder
|
Self for method chaining |
Examples:
>>> # Single layer wall
>>> wall = SurfaceBuilder().id("WALL") \
... .layer("CONCRETE", thickness=0.2) \
... .build()
>>> # Multi-layer wall (front to back)
>>> wall = SurfaceBuilder().id("COMPOSITE_WALL") \
... .layer("GYPSUM", thickness=0.013) \
... .layer("INSULATION", thickness=0.1) \
... .layer("CONCRETE", thickness=0.2) \
... .build()
Source code in src/pyfds/builders/surface.py
backing
¶
Set backing condition for solid.
| PARAMETER | DESCRIPTION |
|---|---|
condition
|
Backing condition: - 'VOID': Back surface at ambient - 'INSULATED': Adiabatic back surface - 'EXPOSED': Back surface exposed to gas phase
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
SurfaceBuilder
|
Self for method chaining |
Examples:
>>> wall = SurfaceBuilder().id("WALL") \
... .layer("CONCRETE", 0.2) \
... .backing("INSULATED") \
... .build()
Source code in src/pyfds/builders/surface.py
emissivity
¶
Set surface emissivity.
| PARAMETER | DESCRIPTION |
|---|---|
front
|
Front surface emissivity (0-1)
TYPE:
|
back
|
Back surface emissivity (0-1)
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
SurfaceBuilder
|
Self for method chaining |
Examples:
Source code in src/pyfds/builders/surface.py
default
¶
Mark as default surface for unmarked boundaries.
| RETURNS | DESCRIPTION |
|---|---|
SurfaceBuilder
|
Self for method chaining |
ht3d
¶
Enable 3D heat conduction.
| RETURNS | DESCRIPTION |
|---|---|
SurfaceBuilder
|
Self for method chaining |
tga_analysis
¶
Configure for TGA (Thermogravimetric Analysis) mode.
| PARAMETER | DESCRIPTION |
|---|---|
heating_rate
|
Heating rate [K/min], default: 5.0
TYPE:
|
final_temperature
|
Final temperature [°C], default: 800.0
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
SurfaceBuilder
|
Self for method chaining |
Source code in src/pyfds/builders/surface.py
geometry
¶
Set solid phase geometry.
| PARAMETER | DESCRIPTION |
|---|---|
shape
|
Geometry type: 'CARTESIAN', 'CYLINDRICAL', 'SPHERICAL', 'INNER CYLINDRICAL'
TYPE:
|
radius
|
Radius for cylindrical/spherical geometry [m]
TYPE:
|
length
|
Length for cylindrical geometry [m]
TYPE:
|
inner_radius
|
Inner radius for hollow cylinder [m]
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
SurfaceBuilder
|
Self for method chaining |
Source code in src/pyfds/builders/surface.py
Overview¶
SurfaceBuilder creates surface definitions (&SURF namelists) with support for burning surfaces, flow surfaces, and layered materials.
Quick Examples¶
Fire Surface¶
from pyfds.builders import SurfaceBuilder
# Simple burner surface
burner = (
SurfaceBuilder("BURNER")
.with_hrrpua(1000.0) # kW/m²
.with_color("RED")
.build()
)
Wall with Material Layer¶
# Concrete wall
wall = (
SurfaceBuilder("CONCRETE_WALL")
.with_material("CONCRETE")
.with_thickness(0.2) # 20 cm
.with_color("GRAY")
.build()
)
Ventilation Surface¶
# Supply vent
supply = (
SurfaceBuilder("SUPPLY")
.with_volume_flux(-1.0) # m³/s/m² (negative = inflow)
.with_temperature(20.0)
.build()
)
See Also¶
- Materials & Surfaces Guide - Surface configuration
- Fire Sources Guide - Fire surface setup
- MaterialBuilder - Material definitions