Connector to allow you to easily add Simvue tracking and monitoring to FDS (Fire Dynamics Simulator) simulations.
Project description
Simvue Integrations - FDS
Allow easy connection between Simvue and FDS (Fire Dynamics Simulator), allowing for easy tracking and monitoring of fire simulations in real time.
Website
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
- Optionally parses 2D slice files for a given variable, and uploads the slice as a 3D metric, as well as summary metrics as 1D metrics
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-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.fds', # 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
slice_parse_quantity="TEMPERATURE" # Parse any 2D slices of temperature data
)
You can also load results from previously run FDS simulations in a similar way:
from simvue_fds.connector import FDSRun
...
if __name__ == "__main__":
...
# Use a context manager to automatically close the object once loading is complete
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
)
# Can use the base Simvue Run() methods to upload extra information, eg:
run.save_file(os.path.abspath(__file__), "code")
# Load FDS simulation results into Simvue
run.load(
results_dir='path/to/my/results_dir', # Path where results are located
slice_parse_quantity="TEMPERATURE", # Parse 2D slices of temperature data
)
License
Released under the terms of the Apache 2 license.
Citation
To reference Simvue, please use the information outlined in this citation file.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file simvue_fds-1.2.1.tar.gz.
File metadata
- Download URL: simvue_fds-1.2.1.tar.gz
- Upload date:
- Size: 21.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
47bf6e6ff791d1df66270428df343137c6642e2ee9118f2c8f7118b290aafef9
|
|
| MD5 |
3e88d0fe704102f7100b42a898561b25
|
|
| BLAKE2b-256 |
00598a932c031db6fcdd3a22811e95c8f8ca4b3944aa34e9312bc11f20e2c51e
|
Provenance
The following attestation bundles were made for simvue_fds-1.2.1.tar.gz:
Publisher:
deploy.yaml on simvue-io/connectors-fds
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
simvue_fds-1.2.1.tar.gz -
Subject digest:
47bf6e6ff791d1df66270428df343137c6642e2ee9118f2c8f7118b290aafef9 - Sigstore transparency entry: 611979104
- Sigstore integration time:
-
Permalink:
simvue-io/connectors-fds@619fc5caffa44c6d4ebd4a99937ba983b2627d8b -
Branch / Tag:
refs/tags/v1.2.1 - Owner: https://github.com/simvue-io
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
deploy.yaml@619fc5caffa44c6d4ebd4a99937ba983b2627d8b -
Trigger Event:
push
-
Statement type:
File details
Details for the file simvue_fds-1.2.1-py3-none-any.whl.
File metadata
- Download URL: simvue_fds-1.2.1-py3-none-any.whl
- Upload date:
- Size: 19.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c78648e770fdd83d5d755fe1728680f0fa14d81367be02574db353ccdc896e34
|
|
| MD5 |
1a93087fca8a0f431d691b123080214c
|
|
| BLAKE2b-256 |
ff38d2a87713878e6e234aa7e7fc123f96706b6133d3cd2e9046105ac9c728fb
|
Provenance
The following attestation bundles were made for simvue_fds-1.2.1-py3-none-any.whl:
Publisher:
deploy.yaml on simvue-io/connectors-fds
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
simvue_fds-1.2.1-py3-none-any.whl -
Subject digest:
c78648e770fdd83d5d755fe1728680f0fa14d81367be02574db353ccdc896e34 - Sigstore transparency entry: 611979119
- Sigstore integration time:
-
Permalink:
simvue-io/connectors-fds@619fc5caffa44c6d4ebd4a99937ba983b2627d8b -
Branch / Tag:
refs/tags/v1.2.1 - Owner: https://github.com/simvue-io
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
deploy.yaml@619fc5caffa44c6d4ebd4a99937ba983b2627d8b -
Trigger Event:
push
-
Statement type: