Skip to main content

Connector to allow you to easily add Simvue tracking and monitoring to FDS (Fire Dynamics Simulator) simulations.

Project description

Simvue Integrations - FDS


Simvue

Allow easy connection between Simvue and FDS (Fire Dynamics Simulator), allowing for easy tracking and monitoring of fire simulations in real time.

WebsiteDocumentation

Implementation

A customised FDSRun class has been created which automatically does the following:

  • Uploads your FDS input file as an input artifact
  • Uploads information from the FDS input file as metadata
  • Uploads other important metadata, such as the FDS and compiler versions used
  • Tracks the FDS simulation itself, alerting the user via the web UI if the simulation crashes unexpectedly
  • Tracks the log file produced by the simulation, uploading data produced as metadata and events
  • Tracks variable values output in the DEVC and HRR CSV files after each step, logging them as metrics
  • Tracks the DEVC and CTRL log, recording activations as metadata and events
  • Uploads results files as Output artifacts

The FDSRun class also inherits from the Run() class of the Simvue Python API, allowing for further detailed control over how your simulation is tracked.

Installation

To install and use this connector, first create a virtual environment:

python -m venv venv

Then activate it:

source venv/bin/activate

And then use pip to install this module:

pip install simvue-integrations-fds

Configuration

The service URL and token can be defined as environment variables:

export SIMVUE_URL=...
export SIMVUE_TOKEN=...

or a file simvue.toml can be created containing:

[server]
url = "..."
token = "..."

The exact contents of both of the above options can be obtained directly by clicking the Create new run button on the web UI. Note that the environment variables have preference over the config file.

Usage example

from simvue_fds.connector import FDSRun

...

if __name__ == "__main__":

    ...

    # Using a context manager means that the status will be set to completed automatically,
    # and also means that if the code exits with an exception this will be reported to Simvue
    with FDSRun() as run:

        # Specify a run name, along with any other optional parameters:
        run.init(
          name = 'my-fds-simulation',                                   # Run name
          metadata = {'number_fires': 3},                               # Metadata
          tags = ['fds', 'multiple-fires'],                             # Tags
          description = 'FDS simulation of fires in a parking garage.', # Description
          folder = '/fds/parking-garage/trial_1'                        # Folder path
        )

        # Set folder details if necessary
        run.set_folder_details(
          metadata = {'simulation_type': 'parking_garage'},             # Metadata
          tags = ['fds'],                                               # Tags
          description = 'FDS simulations with fires in different areas' # Description
        )

        # Can use the base Simvue Run() methods to upload extra information, eg:
        run.save_file(os.path.abspath(__file__), "code")

        # Can add alerts specific to your simulation, eg:
        run.create_metric_threshold_alert(
          name="visibility_below_five_metres",    # Name of Alert
          metric="eye_level_visibility",          # Metric to monitor
          frequency=1,                            # Frequency to evaluate rule at (mins)
          rule="is below",                        # Rule to alert on
          threshold=5,                            # Threshold to alert on
          notification='email',                   # Notification type
          trigger_abort=True                      # Abort simulation if triggered
        )

        # Launch the FDS simulation
        run.launch(
            fds_input_path='path/to/my/input_file.i',   # Path to your FDS input file
            workdir_path='path/to/my/results_dir',      # Path where results should be created
            run_in_parallel=True,                       # Whether to run in parallel using MPI
            num_processors=2                            # Number of cores to use if in parallel

            )

License

Released under the terms of the Apache 2 license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

simvue_fds-1.0.0a0.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

simvue_fds-1.0.0a0-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

Details for the file simvue_fds-1.0.0a0.tar.gz.

File metadata

  • Download URL: simvue_fds-1.0.0a0.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.14

File hashes

Hashes for simvue_fds-1.0.0a0.tar.gz
Algorithm Hash digest
SHA256 019e20d0fce1f9203f0b029fe590b8ef8caaa47e426c235e083e9ffdeb30c1df
MD5 8fb5cc2701700e82f1ddd20cb0eb9a40
BLAKE2b-256 ac7c6425a76d144c77882b97bda87d1c1653f38bfce9660db3efd500f5416a9e

See more details on using hashes here.

File details

Details for the file simvue_fds-1.0.0a0-py3-none-any.whl.

File metadata

  • Download URL: simvue_fds-1.0.0a0-py3-none-any.whl
  • Upload date:
  • Size: 12.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.14

File hashes

Hashes for simvue_fds-1.0.0a0-py3-none-any.whl
Algorithm Hash digest
SHA256 c201f8304cf795a84ff85778687e6acea9c39378194bad84004841e67a45a134
MD5 4e54105e9e8439093c68a95944e76f93
BLAKE2b-256 b5e13814d39705278653436500f38015fd77a270131ebf4b320f0e6ec0253fdb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page