Skip to main content

Simvue Connectors - OpenFoam


Simvue

Allow easy connection between Simvue and OpenFOAM, allowing for easy tracking and monitoring of CFD simulations in real time.

Website

Implementation

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

  • Uploads the input files stored in the Constant and System directories, as well as the initial conditions in the 0 directory, as input artifacts
  • Uploads the Allrun script as a code artifact
  • Uploads information from the top of the log files, such as the OpenFOAM build used, as metadata
  • Uploads information from the log files before the solve begins to the events log
  • Tracks the residuals being calculated for each parameter as metrics
  • Once complete, uploads all of the outputs for each time step as output artifacts

The OpenfoamRun 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-openfoam

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_openfoam.connector import OpenfoamRun

...

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 OpenfoamRun() as run:

        # Specify a run name, along with any other optional parameters:
        run.init(
          name = 'my-openfoam-simulation',                              # Run name
          metadata = {'angle_of_attack': 30},                           # Metadata
          tags = ['fds', 'airfoil', '2D'],                              # Tags
          description = 'OpenFOAM simulation of a 2D airfoil.',         # Description
          folder = '/openfoam/airfoil2D/trial_1'                        # Folder path
        )

        # Set folder details if necessary
        run.set_folder_details(
          metadata = {'simulation_type': 'airfoil2D'},             # Metadata
          tags = ['openfoam'],                                     # Tags
          description = 'OpenFOAM simulations of airfoils'         # 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='ux_residuals_too_high',           # Name of Alert
          metric='residuals.initial.Ux',          # Metric to monitor
          frequency=1,                            # Frequency to evaluate rule at (mins)
          rule="is above",                        # Rule to alert on
          threshold=0.1,                          # Threshold to alert on
          notification='email',                   # Notification type
          trigger_abort=True                      # Abort simulation if triggered
        )

        # Launch the OpenFOAM simulation
        run.launch(
            openfoam_case_dir='path/to/my/openfoam/case',   # Path to your OpenFOAM case directory
            upload_as_zip=True,                              # Whether to upload inputs & results as zip files
            )

License

Released under the terms of the Apache 2 license.

Citation

To reference Simvue, please use the information outlined in this citation file.

Release files for simvue-openfoam 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for simvue-openfoam 1.1.0
File Size Uploaded
simvue_openfoam-1.1.0.tar.gz 10.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for simvue-openfoam 1.1.0
File Interpreter ABI Platform
simvue_openfoam-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 21.9 kB

Release files / simvue_openfoam-1.1.0.tar.gz

Download URL simvue_openfoam-1.1.0.tar.gz
Size 10.4 kB
Tags Source
SHA-256 checksum
How to use checksums
d100f43e5070f399c72f965af70ca747971ceae4936907ec03b6d4e0da6017e6
BLAKE2b-256 checksum
How to use checksums
2d772454a560031d56b617e89a40b44b1c42fb62b0f8d4547879acbe7c1560d0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 10, 2026.

Transparency log

Release files / simvue_openfoam-1.1.0-py3-none-any.whl

Download URL simvue_openfoam-1.1.0-py3-none-any.whl
Size 11.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
20dd6ce6f4a197b7158503821406c4313de4a85a3cf911e0145ad78277f8c5e3
BLAKE2b-256 checksum
How to use checksums
4cbdfdb6337709b8bf8da02bdfe6e3cdb804e5937688e10a5c8b896dc1ca6696
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 10, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page