pycfast.SimulationEnvironment#

class pycfast.SimulationEnvironment(title, time_simulation=900, print=60, smokeview=15, spreadsheet=15, init_pressure=101325, relative_humidity=50, interior_temperature=20, exterior_temperature=20, adiabatic=None, max_time_step=None, lower_oxygen_limit=None, extra_custom=None)[source]#

Defines the initial conditions and simulation time for the CFAST input file.

The Environment page defines the simulation environment, including version and title information, simulation times, ambient conditions, and miscellaneous global parameters. Ambient conditions define the environment at which the scenario begins. Initial pressures in a structure are calculated based on NOAA/NASA tables. It is convenient to choose the base of a structure to be at zero height and then reference the height of the structure with respect to that height.

Parameters:
  • title (str) – The first thing to do when setting up an input file is to give the simulation a title. The title is optional and may consist of letters, numbers, and/or symbols and may be up to 50 characters. All output files will be tagged with this character string.

  • time_simulation (int, optional) – The length of time over which the simulation takes place. The maximum value for this input is 86400 s (1 day). Default units: s, default value: 900 s.

  • print (int, optional) – The time interval between each printing of the output data. If equal to zero, no output values will appear. Default units: s, default value: 60 s.

  • smokeview (int, optional) – CFAST can output a subset of the results in a format compatible with the visualization program Smokeview. This input defines the time interval between outputs of the model results in a Smokeview-compatible format. A value greater than zero must be used if the Smokeview output is desired. Default units: s, default value: 15 s.

  • spreadsheet (int, optional) – CFAST can output the results of the simulation in a set of comma-delimited spreadsheet files. This parameter defines the time interval between these outputs. A value greater than zero must be used if the spreadsheet files are desired. Default units: s, default value: 15 s.

  • init_pressure (float, optional) – Initial values for ambient atmospheric pressure inside and outside the structure at the station elevation. The default value is standard atmospheric pressure at sea level. Default units: Pa, default value: 101325 Pa.

  • relative_humidity (float, optional) – The initial relative humidity in the system, only specified for the interior. This is converted to kilograms of water per cubic meter as an initial condition for both the interior and exterior of the structure. Default units: % RH, default value: 50 %.

  • interior_temperature (float, optional) – Initial ambient temperature inside the structure at the station elevation. Default units: °C, default value: 20 °C.

  • exterior_temperature (float, optional) – Initial ambient temperature outside the structure at the station elevation. Default units: °C, default value: 20 °C.

  • adiabatic (bool, optional) – When this option is enabled, all of the compartment surfaces are assumed to be perfect insulators and the materials section of the compartments tab becomes grayed out. This feature is useful when designing an experiment in which it is safe to assume that there is no heat transfer to the walls of the compartments.

  • max_time_step (float, optional) – CFAST will automatically adjust the time interval for the solution of the differential equation set up or down so that the simulation is as efficient as possible within the pre-defined error tolerances. This parameter places a maximum value for the equation solver and can normally be left at the default value. In cases (which are hopefully rare) where the model fails to converge on a solution, this value can be reduced which often will allow the simulation to successfully complete. Default units: s, default value: 2 s.

  • lower_oxygen_limit (float, optional) – In the CFAST model, a limit is incorporated by limiting the burning rate as the oxygen level decreases until a “lower oxygen limit” (LOL) is reached. The lower oxygen limit is incorporated through a smooth decrease in the burning rate near the limit. Normally, this value would not be changed by the user. Default units: %, default value: 15 %.

Notes

The equations implemented in the model are not designed to handle negative elevations and altitudes. Usually, the station elevation is set to zero and the pressure to ambient. The effect of changing these values is minor.

Examples

Create a simulation environment following CFAST conventions:

>>> simulation_env = SimulationEnvironment(
...     title="Office Fire Simulation",
...     time_simulation=1800,  # Length of simulation (s)
...     print=10,              # Text output interval (s)
...     smokeview=1,           # Smokeview output interval (s)
...     spreadsheet=1          # Spreadsheet output interval (s)
... )
to_input_string()[source]#

Generate CFAST input file string for the simulation environment.

Returns:

Formatted string ready for inclusion in CFAST input file.

Return type:

str

Examples

>>> config = SimulationEnvironment("Test", 300, print=10)
>>> print(config.to_input_string())
&HEAD VERSION = 7700 TITLE = 'Test' /

!! Scenario Configuration &TIME SIMULATION = 300 PRINT = 10 …