Skip to main content

Python library that automates ParaView to produce high‑quality visuals from OpenFOAM and MESHFREE simulations.

Project description

VifPara

CAE Post-Processing Toolkit

OS Languages Version License

VifPara is a Python library that automates ParaView to produce high‑quality visuals from CAE simulation results from different CAE (computer-aided engineering) frameworks. It helps you automate the generation of reproducible 2D/3D plots, animations, comparative layouts, and batch visualizations. VifPara is not here to replace manual GUI-based post-processing workflows, but to enable intuitive automation of commonly needed visualization procedures.

Key Features

  • Cross-platform compatibility - Works on Linux and Windows
  • Multiple file formats - Supports OpenFOAM and Ensight
  • Flexible configuration - JSON-based configuration system
  • Comprehensive visualization - 2D slices, 3D views, animations, and more
  • Visualization Automation - Generate many different visualizations and animations with a single script
  • Various Frameworks - Developed with OpenFoam & MESHFREE. Other frameworks can be implemented upon request

Example Code

The following code takes a finished OpenFoam simulation testcase and outputs an image of a slice of the case through the center with a view along the y-axis.

To make this code work, you need to install ParaView and download VifPara into a compatible Python environment (see below).

from vifpara import *

if __name__ == "__main__":
    # Read config and load case
    config = Config(custom_config = {"case_path": "tutorials/incompressible/simpleFoam/motorBike/case.foam",
                                     "dir_plots": "plots/motorBike",
                                     "dir_logs": "logs/motorBike"})
    logger.set_log_path(config.get_log_path())
    case = Case(config=config, case_type=CaseType.RECONSTRUCTED)

    # Define single view layout
    layout = Layout([1])

    # Create color map
    cmap = ColorMap(field="U")

    # Create slice object
    slice_obj = Slice(
        case=case,
        color_map=cmap,
        normal=Vector3(0.0, 1.0, 0.0))

    # Render slice in single view layout
    slice_obj.render(layout)
    layout.set_height(800)
    exporter = Exporter(config=config, layout=layout)

    # Save screenshot of slice
    exporter.save_snapshot(filename="minimal_example")

Example output: Example Result

Info To test the example, you need to download the OpenFoam motorbike testcase and run it with OpenFoam. Afterwards, you point the case_path in the config to the case.foam of the testcase. If it does not exist, just create an empty file with this name in the cases root directory. Afterwards, do not run the script with python, python3, etc. but with vifpara, which is a dedicated runner installed together with the package.

Software Concept & Supported ParaView Versions

VifPara is a library which adds itself on top of your installed ParaView Python environment (pvpython) via an external Python environment. Therefore, it is crucial, that the Python version you install and use VifPara in, is the same your ParaView installation uses internally.

Please make sure your installed ParaView version is between 5.11 and 5.13. ParaView version 6 is currently not supported.

Tested and working configurations are:

  • ParaView 5.11 - Python 3.12
  • ParaView 5.12 - Python 3.10
  • ParaView 5.13 - Python 3.10

VifPara Architecture

Installation & Use

For information of how to install and use VifPara consult the user documentation and API reference:

User Documentation

Python Package

In the examples directory, you can find several example scripts of how to use VifPara, which can be used as templates to start from. The result of most example scripts can be found in the reference_exports directory in the examples directory.

Contact

Virtual Vehicle Research GmbH: https://www.v2c2.at

Team

Acknowledgments

Virtual Vehicle Research GmbH has received funding within COMET Competence Centers for Excellent Technologies from the Austrian Federal Ministry for Climate Action, the Austrian Federal Ministry for Labour and Economy, the Province of Styria (Dept. 12) and the Styrian Business Promotion Agency (SFG). The Austrian Research Promotion Agency (FFG) has been authorised for the programme management.

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

vifpara-1.3.4.tar.gz (46.7 kB view details)

Uploaded Source

Built Distribution

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

vifpara-1.3.4-py3-none-any.whl (56.0 kB view details)

Uploaded Python 3

File details

Details for the file vifpara-1.3.4.tar.gz.

File metadata

  • Download URL: vifpara-1.3.4.tar.gz
  • Upload date:
  • Size: 46.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for vifpara-1.3.4.tar.gz
Algorithm Hash digest
SHA256 549467a259b7464e0fa47d4557183ed5ffcff06318dc625cb21f6c978f1b0914
MD5 cb0a9149f75dc4db16155861253cb050
BLAKE2b-256 1a6750fd57e36f4f0c50ba1358f2e60e1d23c6f6b31144c6d6f2afb580f4f81d

See more details on using hashes here.

File details

Details for the file vifpara-1.3.4-py3-none-any.whl.

File metadata

  • Download URL: vifpara-1.3.4-py3-none-any.whl
  • Upload date:
  • Size: 56.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for vifpara-1.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 39f2cabb67b8c413ff465bb2016dcb0e659c636dfe1409e4635c48ff6715efe0
MD5 3767de2d86877ac5deca59c3285ecafd
BLAKE2b-256 9447bbd4a84b284a7c349d13cd03aea7b769def35e6f519554363b5f15ce853b

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