How ansys/pyansys-workflows works
Project type and purpose
• This is an open-source repository of example workflows, written in Python, that demonstrate how to use the PyAnsys ecosystem libraries to automate different parts of an Ansys simulation pipeline (geometry creation, meshing, solver setup, post-processing).
• Its goal is to guide users through four multiphysics workflows, each in its own folder, showing best practices for scripting and integration with various Ansys products (SpaceClaim/Discovery/Geometry Service, Fluent Meshing, Fluent Solver, Mechanical, DPF).
File structure
• Top-level workflow directories:
• geometry-mesh
• geometry-mesh-fluent
• geometry-mechanical-dpf
• fluent-mechanical
• Each workflow folder contains:
• requirements_X.Y.txt (version-specific dependencies)
• one Python script per stage: e.g., wf_*_01_geometry.py, wf_*_02_mesh.py, wf_*_03_solver.py, wf_*_04_post.py
• Supporting files:
• pyproject.toml (project metadata)
• CI/CD and docs under .github and doc/
• Templates for contribution, code style, testing
README for additional insights
• The README outlines the four workflows, the sequence of scripts to run, the Ansys products involved at each stage, and how to select the proper requirements file based on Ansys version.
• It also describes how the scripts generate outputs in a consistent outputs/ folder.
Main components
a. Workflow Orchestrator (Python scripts)
– wf_*_01_geometry.py
– wf_*_02_mesh.py
– wf_*_03_solver.py
– wf_*_04_post.py
b. PyAnsys Libraries
– pyansys.spaceclaim or geometry_service API
– pyansys.mesh or fluent_meshing API
– pyansys.fluent or fluent_solver API
– pyansys.mechanical API
– pyansys.dpf.core (post-processing)
c. External Services / Applications
– Ansys SpaceClaim / Discovery / Geometry Service
– Ansys Fluent Meshing Server / PRIME Server
– Ansys Fluent Solver
– Ansys Mechanical
– Ansys Data Processing Framework (DPF)
d. Environment & Configuration
– Virtual environment (.venv)
– requirements files for Ansys versions 24.1, 24.2, 25.1
e. Artifacts & Data Flow
– CAD geometry files (e.g., .stp, .pmdb)
– Mesh files (e.g., .msh)
– Solver setup and results
– Post-processed data or visualization plots
f. CI/CD & Documentation
– GitHub Actions pipelines for testing each workflow against supported Ansys versions
– Sphinx-based documentation under doc/source
Relationships and interactions
• The virtual environment and requirements file control which version of PyAnsys and underlying Ansys installation is targeted.
Architectural patterns and design principles
• Modular “pipeline” pattern: discrete, single-responsibility scripts chained together.
• Layered architecture:
• Presentation/Orchestration (scripts)
• Domain services (PyAnsys libraries)
• Third-party integrations (Ansys products)
• Dependency injection via requirements files to handle multiple Ansys versions.
• Convention-over-configuration: each workflow follows the same file naming and folder structure for predictability.
Key details not to miss
• The version selection mechanism via different requirements files. Represent this as a decision point before environment setup.
• The identical structure repeated across four workflow modules—group them into parallel lanes.
• The outputs folder convention: each script writes to outputs/, feeding the next script.
• CI/CD automation as an orthogonal process validating each workflow.
• Captures each major component and its role
• Shows how Python scripts orchestrate PyAnsys libraries and Ansys products
• Makes the repeated pipeline pattern of the workflows immediately clear
• Highlights configuration choices (Ansys versions) and CI/CD validation
• Provides a clear roadmap for contributors to add new workflows in the same architecture