Builder Libraries¶
libraries
¶
Predefined libraries for common materials, fuels, species, and device properties.
Classes¶
CommonHoles
¶
Library of predefined hole configurations.
Provides factory methods for common openings like doors and windows with sensible visualization defaults.
Examples:
>>> door = CommonHoles.door(xb=(5, 5, 2, 4, 0, 2.1))
>>> window = CommonHoles.window(xb=(0, 0, 2, 3, 1, 2))
Functions¶
door
staticmethod
¶
Create a standard door opening.
| PARAMETER | DESCRIPTION |
|---|---|
xb
|
Door bounds (xmin, xmax, ymin, ymax, zmin, zmax). One dimension should have zero thickness (planar opening).
TYPE:
|
id
|
Hole identifier
TYPE:
|
ctrl_id
|
Control ID for door operation (e.g., open/close logic)
TYPE:
|
devc_id
|
Device ID for door operation
TYPE:
|
color
|
Visualization color (default: 'BROWN')
TYPE:
|
mult_id
|
Multiplier ID for creating arrays of doors
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Hole
|
Door hole object |
Examples:
>>> # Door with control logic
>>> door = CommonHoles.door(
... xb=(5, 5, 2, 4, 0, 2.1),
... id="MAIN_DOOR",
... ctrl_id="DOOR_OPEN_CTRL"
... )
Notes
Standard door dimensions are typically: - Width: 0.9-1.2 m - Height: 2.0-2.1 m
Source code in src/pyfds/builders/libraries/holes.py
window
staticmethod
¶
Create a standard window opening.
| PARAMETER | DESCRIPTION |
|---|---|
xb
|
Window bounds (xmin, xmax, ymin, ymax, zmin, zmax). One dimension should have zero thickness (planar opening).
TYPE:
|
id
|
Hole identifier
TYPE:
|
ctrl_id
|
Control ID for window operation (e.g., breakage logic)
TYPE:
|
devc_id
|
Device ID for window operation
TYPE:
|
color
|
Visualization color (default: 'CYAN')
TYPE:
|
transparency
|
Visualization transparency 0-1 (default: 0.5)
TYPE:
|
mult_id
|
Multiplier ID for creating arrays of windows
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Hole
|
Window hole object |
Examples:
>>> # Window with breakage control
>>> window = CommonHoles.window(
... xb=(0, 0, 2, 3, 1, 2),
... id="WINDOW_1",
... ctrl_id="GLASS_BREAK_CTRL"
... )
Notes
Windows are typically placed 0.9-1.0 m above floor level. Standard window heights are 1.0-1.5 m.
Source code in src/pyfds/builders/libraries/holes.py
CommonMaterials
¶
Library of predefined common materials.
Provides easy access to standard building and structural materials with typical thermal properties.
Examples:
>>> concrete = CommonMaterials.concrete()
>>> steel = CommonMaterials.steel()
>>> wood = CommonMaterials.wood()
Functions¶
concrete
staticmethod
¶
Standard concrete.
Properties
- Density: 2400 kg/m³
- Thermal conductivity: 1.6 W/(m·K)
- Specific heat: 0.88 kJ/(kg·K)
- Emissivity: 0.9
| RETURNS | DESCRIPTION |
|---|---|
Material
|
Concrete material object |
Source code in src/pyfds/builders/libraries/materials.py
gypsum
staticmethod
¶
Gypsum board (drywall).
Properties
- Density: 930 kg/m³
- Thermal conductivity: 0.48 W/(m·K)
- Specific heat: 0.84 kJ/(kg·K)
- Emissivity: 0.9
| RETURNS | DESCRIPTION |
|---|---|
Material
|
Gypsum board material object |
Source code in src/pyfds/builders/libraries/materials.py
steel
staticmethod
¶
Structural steel.
Properties
- Density: 7850 kg/m³
- Thermal conductivity: 45.8 W/(m·K)
- Specific heat: 0.46 kJ/(kg·K)
- Emissivity: 0.7
| RETURNS | DESCRIPTION |
|---|---|
Material
|
Steel material object |
Source code in src/pyfds/builders/libraries/materials.py
aluminum
staticmethod
¶
Aluminum.
Properties
- Density: 2700 kg/m³
- Thermal conductivity: 237 W/(m·K)
- Specific heat: 0.90 kJ/(kg·K)
- Emissivity: 0.2
| RETURNS | DESCRIPTION |
|---|---|
Material
|
Aluminum material object |
Source code in src/pyfds/builders/libraries/materials.py
brick
staticmethod
¶
Standard brick.
Properties
- Density: 1920 kg/m³
- Thermal conductivity: 0.69 W/(m·K)
- Specific heat: 0.84 kJ/(kg·K)
- Emissivity: 0.9
| RETURNS | DESCRIPTION |
|---|---|
Material
|
Brick material object |
Source code in src/pyfds/builders/libraries/materials.py
wood
staticmethod
¶
Wood (pine).
Properties
- Density: 500 kg/m³
- Thermal conductivity: 0.13 W/(m·K)
- Specific heat: 2.5 kJ/(kg·K)
- Emissivity: 0.9
| RETURNS | DESCRIPTION |
|---|---|
Material
|
Wood material object |
Source code in src/pyfds/builders/libraries/materials.py
fiberglass_insulation
staticmethod
¶
Fiberglass insulation.
Properties
- Density: 12 kg/m³
- Thermal conductivity: 0.04 W/(m·K)
- Specific heat: 0.84 kJ/(kg·K)
- Emissivity: 0.9
| RETURNS | DESCRIPTION |
|---|---|
Material
|
Fiberglass insulation material object |
Source code in src/pyfds/builders/libraries/materials.py
ceramic
staticmethod
¶
Ceramic.
Properties
- Density: 2300 kg/m³
- Thermal conductivity: 1.5 W/(m·K)
- Specific heat: 0.90 kJ/(kg·K)
- Emissivity: 0.9
| RETURNS | DESCRIPTION |
|---|---|
Material
|
Ceramic material object |
Source code in src/pyfds/builders/libraries/materials.py
glass
staticmethod
¶
Glass.
Properties
- Density: 2500 kg/m³
- Thermal conductivity: 0.80 W/(m·K)
- Specific heat: 0.84 kJ/(kg·K)
- Emissivity: 0.9
| RETURNS | DESCRIPTION |
|---|---|
Material
|
Glass material object |
Source code in src/pyfds/builders/libraries/materials.py
copper
staticmethod
¶
Copper.
Properties
- Density: 8930 kg/m³
- Thermal conductivity: 401 W/(m·K)
- Specific heat: 0.39 kJ/(kg·K)
- Emissivity: 0.03
| RETURNS | DESCRIPTION |
|---|---|
Material
|
Copper material object |
Source code in src/pyfds/builders/libraries/materials.py
CommonProps
¶
Library of predefined device properties.
Provides factory methods for common sprinklers, smoke detectors, heat detectors, and nozzles with typical configurations.
Examples:
>>> sprinkler = CommonProps.quick_response_sprinkler()
>>> detector = CommonProps.smoke_detector(id="SMOKE_DET")
>>> heat_det = CommonProps.heat_detector(id="HEAT_DET", activation_temp=74)
Functions¶
sprinkler
staticmethod
¶
sprinkler(
id,
activation_temp,
rti,
flow_rate=None,
k_factor=None,
spray_angle=None,
c_factor=None,
pressure=None,
orifice_diameter=None,
)
Create a sprinkler property.
| PARAMETER | DESCRIPTION |
|---|---|
id
|
Unique property identifier
TYPE:
|
activation_temp
|
Activation temperature in °C
TYPE:
|
rti
|
Response Time Index in (m·s)^0.5
TYPE:
|
flow_rate
|
Flow rate in L/min
TYPE:
|
k_factor
|
K-factor in (L/min)/bar^0.5
TYPE:
|
spray_angle
|
Spray angle limits in degrees
TYPE:
|
c_factor
|
Sprinkler C-factor
TYPE:
|
pressure
|
Operating pressure in Pa
TYPE:
|
orifice_diameter
|
Orifice diameter in m
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Property
|
Sprinkler property object |
Examples:
>>> # Quick response sprinkler
>>> sprinkler = CommonProps.sprinkler(
... id='QUICK_RESPONSE',
... activation_temp=68,
... rti=50,
... flow_rate=60
... )
>>> # Standard response sprinkler with pressure
>>> sprinkler = CommonProps.sprinkler(
... id='STANDARD',
... activation_temp=74,
... rti=100,
... k_factor=80,
... pressure=200000
... )
Source code in src/pyfds/builders/libraries/props.py
smoke_detector
staticmethod
¶
Create a smoke detector property.
| PARAMETER | DESCRIPTION |
|---|---|
id
|
Unique property identifier
TYPE:
|
activation_obscuration
|
Activation obscuration in %/m (default: 3.28, UL standard)
TYPE:
|
alpha_e
|
Extinction coefficient in 1/m
TYPE:
|
beta_e
|
Scattering coefficient in 1/m
TYPE:
|
smokeview_id
|
Smokeview object ID for visualization
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Property
|
Smoke detector property object |
Examples:
>>> # Basic smoke detector
>>> detector = CommonProps.smoke_detector(
... id='PHOTOELECTRIC',
... activation_obscuration=3.28
... )
>>> # Smoke detector with optical properties
>>> detector = CommonProps.smoke_detector(
... id='OPTICAL',
... activation_obscuration=3.28,
... alpha_e=0.5,
... beta_e=0.3
... )
Notes
Default value of 3.28 %/m is the UL listed smoke detector sensitivity.
Source code in src/pyfds/builders/libraries/props.py
heat_detector
staticmethod
¶
heat_detector(
id,
activation_temp,
rti=5.0,
bead_diameter=None,
bead_density=None,
bead_specific_heat=None,
)
Create a heat detector property.
| PARAMETER | DESCRIPTION |
|---|---|
id
|
Unique property identifier
TYPE:
|
activation_temp
|
Activation temperature in °C
TYPE:
|
rti
|
Response Time Index in (m·s)^0.5, default: 5.0
TYPE:
|
bead_diameter
|
Detector bead diameter in m
TYPE:
|
bead_density
|
Detector bead density in kg/m³
TYPE:
|
bead_specific_heat
|
Bead specific heat in kJ/kg/K
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Property
|
Heat detector property object |
Examples:
>>> # Basic heat detector
>>> heat_det = CommonProps.heat_detector(
... id='HEAT_DET',
... activation_temp=74
... )
>>> # Heat detector with bead properties
>>> heat_det = CommonProps.heat_detector(
... id='HEAT_DET_CUSTOM',
... activation_temp=74,
... rti=10.0,
... bead_diameter=0.001,
... bead_density=8000
... )
Notes
Default RTI of 5.0 represents a fast-response heat detector.
Source code in src/pyfds/builders/libraries/props.py
nozzle
staticmethod
¶
Create a nozzle/spray property.
| PARAMETER | DESCRIPTION |
|---|---|
id
|
Unique property identifier
TYPE:
|
flow_rate
|
Flow rate in L/min or kg/s
TYPE:
|
pressure
|
Operating pressure in Pa
TYPE:
|
orifice_diameter
|
Orifice diameter in m
TYPE:
|
k_factor
|
K-factor in (L/min)/bar^0.5
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Property
|
Nozzle property object |
Examples:
>>> # Nozzle with flow rate
>>> nozzle = CommonProps.nozzle(
... id='SPRAY_NOZZLE',
... flow_rate=50,
... pressure=300000
... )
>>> # Nozzle with k-factor
>>> nozzle = CommonProps.nozzle(
... id='K_NOZZLE',
... k_factor=80,
... orifice_diameter=0.01
... )
Source code in src/pyfds/builders/libraries/props.py
quick_response_sprinkler
staticmethod
¶
Create a standard quick-response sprinkler (68°C, RTI=50).
| PARAMETER | DESCRIPTION |
|---|---|
id
|
Unique property identifier, default: 'SPRINKLER_QR'
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Property
|
Quick-response sprinkler property |
Examples:
Source code in src/pyfds/builders/libraries/props.py
standard_response_sprinkler
staticmethod
¶
Create a standard-response sprinkler (74°C, RTI=100).
| PARAMETER | DESCRIPTION |
|---|---|
id
|
Unique property identifier, default: 'SPRINKLER_SR'
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Property
|
Standard-response sprinkler property |
Examples:
Source code in src/pyfds/builders/libraries/props.py
CommonRamps
¶
Library of common ramp function patterns.
Provides predefined ramps for common fire growth scenarios, HVAC schedules, and other time-varying functions.
Examples:
>>> fire_ramp = CommonRamps.t_squared_fast(peak_hrr=2500)
>>> step_ramp = CommonRamps.step_at(t=60, value=1.0)
Functions¶
t_squared_slow
staticmethod
¶
Slow t-squared fire growth (600s to 1055 kW).
| PARAMETER | DESCRIPTION |
|---|---|
peak_hrr
|
Peak heat release rate in kW
TYPE:
|
t_peak
|
Time to reach peak in seconds, default: 600
TYPE:
|
id
|
Ramp identifier, default: 'T2_SLOW'
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Ramp
|
Slow growth fire ramp |
Examples:
Source code in src/pyfds/builders/libraries/ramps.py
t_squared_medium
staticmethod
¶
Medium t-squared fire growth (300s to 1055 kW).
| PARAMETER | DESCRIPTION |
|---|---|
peak_hrr
|
Peak heat release rate in kW
TYPE:
|
t_peak
|
Time to reach peak in seconds, default: 300
TYPE:
|
id
|
Ramp identifier, default: 'T2_MEDIUM'
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Ramp
|
Medium growth fire ramp |
Examples:
Source code in src/pyfds/builders/libraries/ramps.py
t_squared_fast
staticmethod
¶
Fast t-squared fire growth (150s to 1055 kW).
| PARAMETER | DESCRIPTION |
|---|---|
peak_hrr
|
Peak heat release rate in kW
TYPE:
|
t_peak
|
Time to reach peak in seconds, default: 150
TYPE:
|
id
|
Ramp identifier, default: 'T2_FAST'
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Ramp
|
Fast growth fire ramp |
Examples:
Source code in src/pyfds/builders/libraries/ramps.py
t_squared_ultrafast
staticmethod
¶
Ultrafast t-squared fire growth (75s to 1055 kW).
| PARAMETER | DESCRIPTION |
|---|---|
peak_hrr
|
Peak heat release rate in kW
TYPE:
|
t_peak
|
Time to reach peak in seconds, default: 75
TYPE:
|
id
|
Ramp identifier, default: 'T2_ULTRAFAST'
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Ramp
|
Ultrafast growth fire ramp |
Examples:
Source code in src/pyfds/builders/libraries/ramps.py
step_at
staticmethod
¶
Step function at specified time.
| PARAMETER | DESCRIPTION |
|---|---|
t
|
Time at which step occurs in seconds
TYPE:
|
value
|
Value after step, default: 1.0
TYPE:
|
id
|
Ramp identifier, default: 'STEP'
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Ramp
|
Step function ramp |
Examples:
Source code in src/pyfds/builders/libraries/ramps.py
linear_growth
staticmethod
¶
Linear growth from 0 to specified value.
| PARAMETER | DESCRIPTION |
|---|---|
t_end
|
End time in seconds
TYPE:
|
f_end
|
Final value, default: 1.0
TYPE:
|
id
|
Ramp identifier, default: 'LINEAR'
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Ramp
|
Linear growth ramp |
Examples:
Source code in src/pyfds/builders/libraries/ramps.py
exponential_growth
staticmethod
¶
Exponential growth from 0 to specified value.
| PARAMETER | DESCRIPTION |
|---|---|
t_end
|
End time in seconds
TYPE:
|
f_end
|
Final value, default: 1.0
TYPE:
|
id
|
Ramp identifier, default: 'EXPONENTIAL'
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Ramp
|
Exponential growth ramp |
Examples:
Source code in src/pyfds/builders/libraries/ramps.py
hvac_schedule_24h
staticmethod
¶
24-hour HVAC on/off schedule.
| PARAMETER | DESCRIPTION |
|---|---|
on_time
|
Hour when HVAC turns on (0-24), default: 8.0 (8 AM)
TYPE:
|
off_time
|
Hour when HVAC turns off (0-24), default: 18.0 (6 PM)
TYPE:
|
id
|
Ramp identifier, default: 'HVAC_SCHEDULE'
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Ramp
|
HVAC schedule ramp (0=off, 1=on) |
Examples:
Source code in src/pyfds/builders/libraries/ramps.py
Functions¶
get_fuel_info
¶
Get detailed information about a fuel.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
Fuel name (case-insensitive)
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
FuelData
|
Dictionary with fuel composition and properties |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If fuel name is not in database |
Examples:
>>> info = get_fuel_info('PROPANE')
>>> print(f"Heat of combustion: {info['hoc']} kJ/kg")
Heat of combustion: 46000 kJ/kg
Source code in src/pyfds/builders/libraries/fuels.py
list_fuels
¶
create_standard_air
¶
Create standard air composition dictionary.
This function creates a dictionary suitable for creating a lumped Species object representing standard atmospheric air composition. The composition is adjusted for humidity.
| PARAMETER | DESCRIPTION |
|---|---|
humidity
|
Relative humidity percentage (default: 40.0) Valid range: 0-100
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
dict
|
Dictionary with species definition parameters suitable for creating a lumped Species with background=True |
Examples:
>>> air_dict = create_standard_air(humidity=50.0)
>>> print(air_dict['id'])
AIR
>>> print(f"Components: {len(air_dict['spec_id'])}")
Components: 4
Notes
Standard dry air composition (by volume): - Nitrogen: 78.084% - Oxygen: 20.946% - Argon: 0.934% - Carbon dioxide: 0.036%
Water vapor is added based on humidity, displacing nitrogen and oxygen.
Source code in src/pyfds/builders/libraries/species.py
288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 | |
get_species_formula
¶
Get the chemical formula of a predefined species.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
Species name (case-insensitive)
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
Chemical formula |
Examples:
>>> formula = get_species_formula('PROPANE')
>>> print(f"Propane formula: {formula}")
Propane formula: C3H8
Source code in src/pyfds/builders/libraries/species.py
get_species_info
¶
Get detailed information about a predefined species.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
Species name (case-insensitive)
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
dict
|
Dictionary with species properties including formula, molecular weight, and description |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If species name is not in database |
Examples:
>>> info = get_species_info('PROPANE')
>>> print(f"Formula: {info['formula']}, MW: {info['mw']} g/mol")
Formula: C3H8, MW: 44.0956 g/mol
>>> info = get_species_info('oxygen')
>>> print(f"Description: {info['description']}")
Description: Oxygen (air component)
Source code in src/pyfds/builders/libraries/species.py
get_species_molecular_weight
¶
Get the molecular weight of a predefined species.
This is a convenience function for quickly accessing molecular weights.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
Species name (case-insensitive)
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
float
|
Molecular weight in g/mol |
Examples:
>>> mw = get_species_molecular_weight('WATER_VAPOR')
>>> print(f"Water molecular weight: {mw} g/mol")
Water molecular weight: 18.0153 g/mol
Source code in src/pyfds/builders/libraries/species.py
is_predefined
¶
Check if a species name is in the predefined database.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
Species name to check (case-insensitive)
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if species is predefined, False otherwise |
Examples:
>>> is_predefined('METHANE')
True
>>> is_predefined('CUSTOM_FUEL')
False
>>> is_predefined('methane') # Case insensitive
True
Source code in src/pyfds/builders/libraries/species.py
list_predefined_species
¶
Get list of all available predefined species.
| RETURNS | DESCRIPTION |
|---|---|
list[str]
|
Sorted list of species names |
Examples:
>>> species = list_predefined_species()
>>> print(f"Available species: {len(species)}")
Available species: 35
>>> print(species[:5])
['ACETONE', 'ACETYLENE', 'AMMONIA', 'ARGON', 'BENZENE']
Source code in src/pyfds/builders/libraries/species.py
Overview¶
Builder libraries provide pre-configured objects for common scenarios. Instead of manually configuring every parameter, you can use factory functions to create standard materials, props, ramps, and more with sensible defaults.
Importing Libraries¶
from pyfds.builders.libraries import (
CommonMaterials,
CommonProps,
CommonHoles,
CommonRamps,
CommonSpecies,
CommonFuels,
)
Common Materials¶
Pre-configured material definitions.
materials
¶
Common building and structural materials library.
Classes¶
CommonMaterials
¶
Library of predefined common materials.
Provides easy access to standard building and structural materials with typical thermal properties.
Examples:
>>> concrete = CommonMaterials.concrete()
>>> steel = CommonMaterials.steel()
>>> wood = CommonMaterials.wood()
Functions¶
concrete
staticmethod
¶
Standard concrete.
Properties
- Density: 2400 kg/m³
- Thermal conductivity: 1.6 W/(m·K)
- Specific heat: 0.88 kJ/(kg·K)
- Emissivity: 0.9
| RETURNS | DESCRIPTION |
|---|---|
Material
|
Concrete material object |
Source code in src/pyfds/builders/libraries/materials.py
gypsum
staticmethod
¶
Gypsum board (drywall).
Properties
- Density: 930 kg/m³
- Thermal conductivity: 0.48 W/(m·K)
- Specific heat: 0.84 kJ/(kg·K)
- Emissivity: 0.9
| RETURNS | DESCRIPTION |
|---|---|
Material
|
Gypsum board material object |
Source code in src/pyfds/builders/libraries/materials.py
steel
staticmethod
¶
Structural steel.
Properties
- Density: 7850 kg/m³
- Thermal conductivity: 45.8 W/(m·K)
- Specific heat: 0.46 kJ/(kg·K)
- Emissivity: 0.7
| RETURNS | DESCRIPTION |
|---|---|
Material
|
Steel material object |
Source code in src/pyfds/builders/libraries/materials.py
aluminum
staticmethod
¶
Aluminum.
Properties
- Density: 2700 kg/m³
- Thermal conductivity: 237 W/(m·K)
- Specific heat: 0.90 kJ/(kg·K)
- Emissivity: 0.2
| RETURNS | DESCRIPTION |
|---|---|
Material
|
Aluminum material object |
Source code in src/pyfds/builders/libraries/materials.py
brick
staticmethod
¶
Standard brick.
Properties
- Density: 1920 kg/m³
- Thermal conductivity: 0.69 W/(m·K)
- Specific heat: 0.84 kJ/(kg·K)
- Emissivity: 0.9
| RETURNS | DESCRIPTION |
|---|---|
Material
|
Brick material object |
Source code in src/pyfds/builders/libraries/materials.py
wood
staticmethod
¶
Wood (pine).
Properties
- Density: 500 kg/m³
- Thermal conductivity: 0.13 W/(m·K)
- Specific heat: 2.5 kJ/(kg·K)
- Emissivity: 0.9
| RETURNS | DESCRIPTION |
|---|---|
Material
|
Wood material object |
Source code in src/pyfds/builders/libraries/materials.py
fiberglass_insulation
staticmethod
¶
Fiberglass insulation.
Properties
- Density: 12 kg/m³
- Thermal conductivity: 0.04 W/(m·K)
- Specific heat: 0.84 kJ/(kg·K)
- Emissivity: 0.9
| RETURNS | DESCRIPTION |
|---|---|
Material
|
Fiberglass insulation material object |
Source code in src/pyfds/builders/libraries/materials.py
ceramic
staticmethod
¶
Ceramic.
Properties
- Density: 2300 kg/m³
- Thermal conductivity: 1.5 W/(m·K)
- Specific heat: 0.90 kJ/(kg·K)
- Emissivity: 0.9
| RETURNS | DESCRIPTION |
|---|---|
Material
|
Ceramic material object |
Source code in src/pyfds/builders/libraries/materials.py
glass
staticmethod
¶
Glass.
Properties
- Density: 2500 kg/m³
- Thermal conductivity: 0.80 W/(m·K)
- Specific heat: 0.84 kJ/(kg·K)
- Emissivity: 0.9
| RETURNS | DESCRIPTION |
|---|---|
Material
|
Glass material object |
Source code in src/pyfds/builders/libraries/materials.py
copper
staticmethod
¶
Copper.
Properties
- Density: 8930 kg/m³
- Thermal conductivity: 401 W/(m·K)
- Specific heat: 0.39 kJ/(kg·K)
- Emissivity: 0.03
| RETURNS | DESCRIPTION |
|---|---|
Material
|
Copper material object |
Source code in src/pyfds/builders/libraries/materials.py
Usage Examples¶
from pyfds.builders.libraries import CommonMaterials
from pyfds import Simulation
sim = Simulation(chid="test")
# Add standard materials
sim.add(CommonMaterials.concrete())
sim.add(CommonMaterials.steel())
sim.add(CommonMaterials.gypsum())
sim.add(CommonMaterials.wood())
# Use in surfaces
sim.add(Surface(
id="CONCRETE_WALL",
matl_id="CONCRETE",
thickness=0.2
))
Available Materials¶
concrete(): Standard concrete- Density: 2400 kg/m³
- Conductivity: 1.8 W/(m·K)
-
Specific heat: 0.88 kJ/(kg·K)
-
steel(): Structural steel - Density: 7850 kg/m³
- Conductivity: 45 W/(m·K)
-
Specific heat: 0.46 kJ/(kg·K)
-
gypsum(): Gypsum board - Density: 790 kg/m³
- Conductivity: 0.48 W/(m·K)
-
Specific heat: 1.09 kJ/(kg·K)
-
wood(): Generic wood - Density: 500 kg/m³
- Conductivity: 0.13 W/(m·K)
-
Specific heat: 2.5 kJ/(kg·K)
-
glass(): Standard glass - Density: 2500 kg/m³
- Conductivity: 0.76 W/(m·K)
-
Specific heat: 0.84 kJ/(kg·K)
-
insulation(): Thermal insulation - Density: 65 kg/m³
- Conductivity: 0.04 W/(m·K)
- Specific heat: 1.0 kJ/(kg·K)
Common Properties¶
Pre-configured device properties (sprinklers, detectors, etc.).
props
¶
Common device property presets for sprinklers, detectors, and nozzles.
Classes¶
CommonProps
¶
Library of predefined device properties.
Provides factory methods for common sprinklers, smoke detectors, heat detectors, and nozzles with typical configurations.
Examples:
>>> sprinkler = CommonProps.quick_response_sprinkler()
>>> detector = CommonProps.smoke_detector(id="SMOKE_DET")
>>> heat_det = CommonProps.heat_detector(id="HEAT_DET", activation_temp=74)
Functions¶
sprinkler
staticmethod
¶
sprinkler(
id,
activation_temp,
rti,
flow_rate=None,
k_factor=None,
spray_angle=None,
c_factor=None,
pressure=None,
orifice_diameter=None,
)
Create a sprinkler property.
| PARAMETER | DESCRIPTION |
|---|---|
id
|
Unique property identifier
TYPE:
|
activation_temp
|
Activation temperature in °C
TYPE:
|
rti
|
Response Time Index in (m·s)^0.5
TYPE:
|
flow_rate
|
Flow rate in L/min
TYPE:
|
k_factor
|
K-factor in (L/min)/bar^0.5
TYPE:
|
spray_angle
|
Spray angle limits in degrees
TYPE:
|
c_factor
|
Sprinkler C-factor
TYPE:
|
pressure
|
Operating pressure in Pa
TYPE:
|
orifice_diameter
|
Orifice diameter in m
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Property
|
Sprinkler property object |
Examples:
>>> # Quick response sprinkler
>>> sprinkler = CommonProps.sprinkler(
... id='QUICK_RESPONSE',
... activation_temp=68,
... rti=50,
... flow_rate=60
... )
>>> # Standard response sprinkler with pressure
>>> sprinkler = CommonProps.sprinkler(
... id='STANDARD',
... activation_temp=74,
... rti=100,
... k_factor=80,
... pressure=200000
... )
Source code in src/pyfds/builders/libraries/props.py
smoke_detector
staticmethod
¶
Create a smoke detector property.
| PARAMETER | DESCRIPTION |
|---|---|
id
|
Unique property identifier
TYPE:
|
activation_obscuration
|
Activation obscuration in %/m (default: 3.28, UL standard)
TYPE:
|
alpha_e
|
Extinction coefficient in 1/m
TYPE:
|
beta_e
|
Scattering coefficient in 1/m
TYPE:
|
smokeview_id
|
Smokeview object ID for visualization
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Property
|
Smoke detector property object |
Examples:
>>> # Basic smoke detector
>>> detector = CommonProps.smoke_detector(
... id='PHOTOELECTRIC',
... activation_obscuration=3.28
... )
>>> # Smoke detector with optical properties
>>> detector = CommonProps.smoke_detector(
... id='OPTICAL',
... activation_obscuration=3.28,
... alpha_e=0.5,
... beta_e=0.3
... )
Notes
Default value of 3.28 %/m is the UL listed smoke detector sensitivity.
Source code in src/pyfds/builders/libraries/props.py
heat_detector
staticmethod
¶
heat_detector(
id,
activation_temp,
rti=5.0,
bead_diameter=None,
bead_density=None,
bead_specific_heat=None,
)
Create a heat detector property.
| PARAMETER | DESCRIPTION |
|---|---|
id
|
Unique property identifier
TYPE:
|
activation_temp
|
Activation temperature in °C
TYPE:
|
rti
|
Response Time Index in (m·s)^0.5, default: 5.0
TYPE:
|
bead_diameter
|
Detector bead diameter in m
TYPE:
|
bead_density
|
Detector bead density in kg/m³
TYPE:
|
bead_specific_heat
|
Bead specific heat in kJ/kg/K
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Property
|
Heat detector property object |
Examples:
>>> # Basic heat detector
>>> heat_det = CommonProps.heat_detector(
... id='HEAT_DET',
... activation_temp=74
... )
>>> # Heat detector with bead properties
>>> heat_det = CommonProps.heat_detector(
... id='HEAT_DET_CUSTOM',
... activation_temp=74,
... rti=10.0,
... bead_diameter=0.001,
... bead_density=8000
... )
Notes
Default RTI of 5.0 represents a fast-response heat detector.
Source code in src/pyfds/builders/libraries/props.py
nozzle
staticmethod
¶
Create a nozzle/spray property.
| PARAMETER | DESCRIPTION |
|---|---|
id
|
Unique property identifier
TYPE:
|
flow_rate
|
Flow rate in L/min or kg/s
TYPE:
|
pressure
|
Operating pressure in Pa
TYPE:
|
orifice_diameter
|
Orifice diameter in m
TYPE:
|
k_factor
|
K-factor in (L/min)/bar^0.5
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Property
|
Nozzle property object |
Examples:
>>> # Nozzle with flow rate
>>> nozzle = CommonProps.nozzle(
... id='SPRAY_NOZZLE',
... flow_rate=50,
... pressure=300000
... )
>>> # Nozzle with k-factor
>>> nozzle = CommonProps.nozzle(
... id='K_NOZZLE',
... k_factor=80,
... orifice_diameter=0.01
... )
Source code in src/pyfds/builders/libraries/props.py
quick_response_sprinkler
staticmethod
¶
Create a standard quick-response sprinkler (68°C, RTI=50).
| PARAMETER | DESCRIPTION |
|---|---|
id
|
Unique property identifier, default: 'SPRINKLER_QR'
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Property
|
Quick-response sprinkler property |
Examples:
Source code in src/pyfds/builders/libraries/props.py
standard_response_sprinkler
staticmethod
¶
Create a standard-response sprinkler (74°C, RTI=100).
| PARAMETER | DESCRIPTION |
|---|---|
id
|
Unique property identifier, default: 'SPRINKLER_SR'
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Property
|
Standard-response sprinkler property |
Examples:
Source code in src/pyfds/builders/libraries/props.py
Usage Examples¶
from pyfds.builders.libraries import CommonProps
from pyfds import Simulation
sim = Simulation(chid="test")
# Add standard sprinkler
sprinkler = CommonProps.quick_response_sprinkler()
sim.add(sprinkler)
# Add smoke detector
detector = CommonProps.smoke_detector()
sim.add(detector)
# Use in devices
sim.add(Device(
id="SPK_1",
prop_id="SPRINKLER_QR",
xyz=(5, 5, 2.5)
))
Available Properties¶
quick_response_sprinkler(): Quick-response sprinkler- RTI: 50 (m·s)^0.5
- Activation temp: 68°C
-
Spray angle: 60°
-
standard_sprinkler(): Standard sprinkler - RTI: 165 (m·s)^0.5
- Activation temp: 74°C
-
Spray angle: 60°
-
smoke_detector(): Photoelectric smoke detector - Activation obscuration: 3.28%/m
-
Beta: 1.8 (m/s)^-1
-
heat_detector(): Fixed-temperature heat detector - RTI: 100 (m·s)^0.5
-
Activation temp: 57°C
-
aspirating_detector(): Aspirating smoke detection - Activation obscuration: 0.5%/m
- Sampling rate: 0.05 m³/s
Common Holes¶
Pre-configured hole geometries (doors, windows, etc.).
holes
¶
Common hole presets for doors and windows.
Classes¶
CommonHoles
¶
Library of predefined hole configurations.
Provides factory methods for common openings like doors and windows with sensible visualization defaults.
Examples:
>>> door = CommonHoles.door(xb=(5, 5, 2, 4, 0, 2.1))
>>> window = CommonHoles.window(xb=(0, 0, 2, 3, 1, 2))
Functions¶
door
staticmethod
¶
Create a standard door opening.
| PARAMETER | DESCRIPTION |
|---|---|
xb
|
Door bounds (xmin, xmax, ymin, ymax, zmin, zmax). One dimension should have zero thickness (planar opening).
TYPE:
|
id
|
Hole identifier
TYPE:
|
ctrl_id
|
Control ID for door operation (e.g., open/close logic)
TYPE:
|
devc_id
|
Device ID for door operation
TYPE:
|
color
|
Visualization color (default: 'BROWN')
TYPE:
|
mult_id
|
Multiplier ID for creating arrays of doors
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Hole
|
Door hole object |
Examples:
>>> # Door with control logic
>>> door = CommonHoles.door(
... xb=(5, 5, 2, 4, 0, 2.1),
... id="MAIN_DOOR",
... ctrl_id="DOOR_OPEN_CTRL"
... )
Notes
Standard door dimensions are typically: - Width: 0.9-1.2 m - Height: 2.0-2.1 m
Source code in src/pyfds/builders/libraries/holes.py
window
staticmethod
¶
Create a standard window opening.
| PARAMETER | DESCRIPTION |
|---|---|
xb
|
Window bounds (xmin, xmax, ymin, ymax, zmin, zmax). One dimension should have zero thickness (planar opening).
TYPE:
|
id
|
Hole identifier
TYPE:
|
ctrl_id
|
Control ID for window operation (e.g., breakage logic)
TYPE:
|
devc_id
|
Device ID for window operation
TYPE:
|
color
|
Visualization color (default: 'CYAN')
TYPE:
|
transparency
|
Visualization transparency 0-1 (default: 0.5)
TYPE:
|
mult_id
|
Multiplier ID for creating arrays of windows
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Hole
|
Window hole object |
Examples:
>>> # Window with breakage control
>>> window = CommonHoles.window(
... xb=(0, 0, 2, 3, 1, 2),
... id="WINDOW_1",
... ctrl_id="GLASS_BREAK_CTRL"
... )
Notes
Windows are typically placed 0.9-1.0 m above floor level. Standard window heights are 1.0-1.5 m.
Source code in src/pyfds/builders/libraries/holes.py
Usage Examples¶
from pyfds.builders.libraries import CommonHoles
from pyfds import Simulation
sim = Simulation(chid="test")
# Single door at wall location
door = CommonHoles.door(location=(5, 0, 0), wall_normal="y")
sim.add(door)
# Window
window = CommonHoles.window(location=(3, 10, 1.2), wall_normal="y", width=1.2, height=1.0)
sim.add(window)
# Double door
double_door = CommonHoles.double_door(location=(8, 0, 0), wall_normal="y")
sim.add(double_door)
Available Holes¶
door(location, wall_normal, width=0.9, height=2.1): Standard door-
Default: 0.9m × 2.1m
-
double_door(location, wall_normal, width=1.8, height=2.1): Double door -
Default: 1.8m × 2.1m
-
window(location, wall_normal, width, height): Window opening -
Custom dimensions
-
vent_opening(location, wall_normal, width, height): Vent opening - Custom dimensions
Common Ramps¶
Pre-configured time-varying functions.
ramps
¶
Common ramp function patterns library.
Classes¶
CommonRamps
¶
Library of common ramp function patterns.
Provides predefined ramps for common fire growth scenarios, HVAC schedules, and other time-varying functions.
Examples:
>>> fire_ramp = CommonRamps.t_squared_fast(peak_hrr=2500)
>>> step_ramp = CommonRamps.step_at(t=60, value=1.0)
Functions¶
t_squared_slow
staticmethod
¶
Slow t-squared fire growth (600s to 1055 kW).
| PARAMETER | DESCRIPTION |
|---|---|
peak_hrr
|
Peak heat release rate in kW
TYPE:
|
t_peak
|
Time to reach peak in seconds, default: 600
TYPE:
|
id
|
Ramp identifier, default: 'T2_SLOW'
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Ramp
|
Slow growth fire ramp |
Examples:
Source code in src/pyfds/builders/libraries/ramps.py
t_squared_medium
staticmethod
¶
Medium t-squared fire growth (300s to 1055 kW).
| PARAMETER | DESCRIPTION |
|---|---|
peak_hrr
|
Peak heat release rate in kW
TYPE:
|
t_peak
|
Time to reach peak in seconds, default: 300
TYPE:
|
id
|
Ramp identifier, default: 'T2_MEDIUM'
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Ramp
|
Medium growth fire ramp |
Examples:
Source code in src/pyfds/builders/libraries/ramps.py
t_squared_fast
staticmethod
¶
Fast t-squared fire growth (150s to 1055 kW).
| PARAMETER | DESCRIPTION |
|---|---|
peak_hrr
|
Peak heat release rate in kW
TYPE:
|
t_peak
|
Time to reach peak in seconds, default: 150
TYPE:
|
id
|
Ramp identifier, default: 'T2_FAST'
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Ramp
|
Fast growth fire ramp |
Examples:
Source code in src/pyfds/builders/libraries/ramps.py
t_squared_ultrafast
staticmethod
¶
Ultrafast t-squared fire growth (75s to 1055 kW).
| PARAMETER | DESCRIPTION |
|---|---|
peak_hrr
|
Peak heat release rate in kW
TYPE:
|
t_peak
|
Time to reach peak in seconds, default: 75
TYPE:
|
id
|
Ramp identifier, default: 'T2_ULTRAFAST'
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Ramp
|
Ultrafast growth fire ramp |
Examples:
Source code in src/pyfds/builders/libraries/ramps.py
step_at
staticmethod
¶
Step function at specified time.
| PARAMETER | DESCRIPTION |
|---|---|
t
|
Time at which step occurs in seconds
TYPE:
|
value
|
Value after step, default: 1.0
TYPE:
|
id
|
Ramp identifier, default: 'STEP'
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Ramp
|
Step function ramp |
Examples:
Source code in src/pyfds/builders/libraries/ramps.py
linear_growth
staticmethod
¶
Linear growth from 0 to specified value.
| PARAMETER | DESCRIPTION |
|---|---|
t_end
|
End time in seconds
TYPE:
|
f_end
|
Final value, default: 1.0
TYPE:
|
id
|
Ramp identifier, default: 'LINEAR'
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Ramp
|
Linear growth ramp |
Examples:
Source code in src/pyfds/builders/libraries/ramps.py
exponential_growth
staticmethod
¶
Exponential growth from 0 to specified value.
| PARAMETER | DESCRIPTION |
|---|---|
t_end
|
End time in seconds
TYPE:
|
f_end
|
Final value, default: 1.0
TYPE:
|
id
|
Ramp identifier, default: 'EXPONENTIAL'
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Ramp
|
Exponential growth ramp |
Examples:
Source code in src/pyfds/builders/libraries/ramps.py
hvac_schedule_24h
staticmethod
¶
24-hour HVAC on/off schedule.
| PARAMETER | DESCRIPTION |
|---|---|
on_time
|
Hour when HVAC turns on (0-24), default: 8.0 (8 AM)
TYPE:
|
off_time
|
Hour when HVAC turns off (0-24), default: 18.0 (6 PM)
TYPE:
|
id
|
Ramp identifier, default: 'HVAC_SCHEDULE'
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Ramp
|
HVAC schedule ramp (0=off, 1=on) |
Examples:
Source code in src/pyfds/builders/libraries/ramps.py
Usage Examples¶
from pyfds.builders.libraries import CommonRamps
from pyfds import Simulation
sim = Simulation(chid="test")
# Fast t² fire growth to 2500 kW at 300s
fire_ramp = CommonRamps.t_squared_fast(peak_hrr=2500, t_peak=300)
sim.add(fire_ramp)
# HVAC schedule: on 8AM-6PM
hvac_ramp = CommonRamps.hvac_schedule_24h(on_time=8, off_time=18)
sim.add(hvac_ramp)
# Linear ramp
linear_ramp = CommonRamps.linear(t_start=0, t_end=100, f_start=0, f_end=1)
sim.add(linear_ramp)
Available Ramps¶
t_squared_fast(peak_hrr, t_peak): Fast t² fire growth-
Growth rate: α = 0.047 kW/s²
-
t_squared_medium(peak_hrr, t_peak): Medium t² fire growth -
Growth rate: α = 0.012 kW/s²
-
t_squared_slow(peak_hrr, t_peak): Slow t² fire growth -
Growth rate: α = 0.003 kW/s²
-
t_squared_ultra_fast(peak_hrr, t_peak): Ultra-fast t² fire growth -
Growth rate: α = 0.188 kW/s²
-
linear(t_start, t_end, f_start, f_end): Linear ramp -
Straight line between two points
-
step(t_step, f_before, f_after): Step function -
Instantaneous change at time t
-
hvac_schedule_24h(on_time, off_time): 24-hour HVAC schedule -
On/off times in hours (0-24)
-
exponential(tau, t_end): Exponential growth/decay - Time constant: τ
Common Species¶
Pre-configured chemical species.
species
¶
Predefined species database for common gas species in FDS simulations.
Functions¶
list_predefined_species
¶
Get list of all available predefined species.
| RETURNS | DESCRIPTION |
|---|---|
list[str]
|
Sorted list of species names |
Examples:
>>> species = list_predefined_species()
>>> print(f"Available species: {len(species)}")
Available species: 35
>>> print(species[:5])
['ACETONE', 'ACETYLENE', 'AMMONIA', 'ARGON', 'BENZENE']
Source code in src/pyfds/builders/libraries/species.py
get_species_info
¶
Get detailed information about a predefined species.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
Species name (case-insensitive)
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
dict
|
Dictionary with species properties including formula, molecular weight, and description |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If species name is not in database |
Examples:
>>> info = get_species_info('PROPANE')
>>> print(f"Formula: {info['formula']}, MW: {info['mw']} g/mol")
Formula: C3H8, MW: 44.0956 g/mol
>>> info = get_species_info('oxygen')
>>> print(f"Description: {info['description']}")
Description: Oxygen (air component)
Source code in src/pyfds/builders/libraries/species.py
is_predefined
¶
Check if a species name is in the predefined database.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
Species name to check (case-insensitive)
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if species is predefined, False otherwise |
Examples:
>>> is_predefined('METHANE')
True
>>> is_predefined('CUSTOM_FUEL')
False
>>> is_predefined('methane') # Case insensitive
True
Source code in src/pyfds/builders/libraries/species.py
create_standard_air
¶
Create standard air composition dictionary.
This function creates a dictionary suitable for creating a lumped Species object representing standard atmospheric air composition. The composition is adjusted for humidity.
| PARAMETER | DESCRIPTION |
|---|---|
humidity
|
Relative humidity percentage (default: 40.0) Valid range: 0-100
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
dict
|
Dictionary with species definition parameters suitable for creating a lumped Species with background=True |
Examples:
>>> air_dict = create_standard_air(humidity=50.0)
>>> print(air_dict['id'])
AIR
>>> print(f"Components: {len(air_dict['spec_id'])}")
Components: 4
Notes
Standard dry air composition (by volume): - Nitrogen: 78.084% - Oxygen: 20.946% - Argon: 0.934% - Carbon dioxide: 0.036%
Water vapor is added based on humidity, displacing nitrogen and oxygen.
Source code in src/pyfds/builders/libraries/species.py
288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 | |
get_species_molecular_weight
¶
Get the molecular weight of a predefined species.
This is a convenience function for quickly accessing molecular weights.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
Species name (case-insensitive)
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
float
|
Molecular weight in g/mol |
Examples:
>>> mw = get_species_molecular_weight('WATER_VAPOR')
>>> print(f"Water molecular weight: {mw} g/mol")
Water molecular weight: 18.0153 g/mol
Source code in src/pyfds/builders/libraries/species.py
get_species_formula
¶
Get the chemical formula of a predefined species.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
Species name (case-insensitive)
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
Chemical formula |
Examples:
>>> formula = get_species_formula('PROPANE')
>>> print(f"Propane formula: {formula}")
Propane formula: C3H8
Source code in src/pyfds/builders/libraries/species.py
Usage Examples¶
from pyfds.builders.libraries import CommonSpecies
from pyfds import Simulation
sim = Simulation(chid="test")
# Add tracer species
tracer = CommonSpecies.tracer(id="SF6")
sim.add(tracer)
# Add water vapor tracking
water = CommonSpecies.water_vapor()
sim.add(water)
Available Species¶
tracer(id="TRACER"): Massless tracer- Zero diffusivity
-
No reactions
-
water_vapor(): Water vapor species -
Molecular weight: 18 g/mol
-
carbon_dioxide(): CO₂ species -
Molecular weight: 44 g/mol
-
carbon_monoxide(): CO species - Molecular weight: 28 g/mol
Common Fuels¶
Pre-configured fuel definitions for reactions.
fuels
¶
Predefined fuel database for common combustion reactions.
Classes¶
FuelData
¶
Bases: TypedDict
Type definition for fuel database entries.
Functions¶
list_fuels
¶
get_fuel_info
¶
Get detailed information about a fuel.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
Fuel name (case-insensitive)
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
FuelData
|
Dictionary with fuel composition and properties |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If fuel name is not in database |
Examples:
>>> info = get_fuel_info('PROPANE')
>>> print(f"Heat of combustion: {info['hoc']} kJ/kg")
Heat of combustion: 46000 kJ/kg
Source code in src/pyfds/builders/libraries/fuels.py
Usage Examples¶
from pyfds.builders.libraries import CommonFuels
# Get fuel properties
propane = CommonFuels.get_fuel("PROPANE")
print(f"Heat of combustion: {propane['heat_of_combustion']} kJ/kg")
print(f"Soot yield: {propane['soot_yield']}")
# List available fuels
all_fuels = CommonFuels.list_fuels()
print(f"Available fuels: {all_fuels}")
Available Fuels¶
The library includes properties for common fuels:
- Hydrocarbons: METHANE, PROPANE, ETHANE, BUTANE, HEPTANE, OCTANE
- Polymers: POLYSTYRENE, POLYETHYLENE, POLYPROPYLENE, PMMA
- Natural materials: WOOD, CELLULOSE
- Liquids: METHANOL, ETHANOL, ACETONE, GASOLINE, DIESEL
Each fuel includes: - Chemical formula (C, H, O, N atoms) - Heat of combustion (kJ/kg) - Soot yield - CO yield - Radiative fraction
Customization¶
All library functions return standard PyFDS objects that can be modified:
from pyfds.builders.libraries import CommonMaterials
# Get base material
concrete = CommonMaterials.concrete()
# Modify as needed
concrete.emissivity = 0.95
concrete.absorption = 50000 # J/m³
sim.add(concrete)
Creating Custom Libraries¶
You can create your own library following the same pattern:
from pyfds import Material
class MyMaterials:
"""Custom material library."""
@staticmethod
def my_custom_material() -> Material:
"""Create custom material."""
return Material(
id="MY_MATERIAL",
density=1500,
conductivity=1.2,
specific_heat=1.8,
emissivity=0.9
)
# Use it
from my_library import MyMaterials
sim.add(MyMaterials.my_custom_material())
See Also¶
- Material Builder - Building custom materials
- Ramp Builder - Building custom ramps
- Builders Index - All builder documentation
- Materials Guide - Material modeling guide