Skip to content

parthbhanti22/openfoam-yaml-tool

Repository files navigation

OpenFOAM Tree Configurator (FOSSEE 2026)

A Cloud Native, General Tree-based configuration tool for OpenFOAM. This project is fully refactored to support N-ary trees (General Trees) where any node can have any number of children, strictly adhering to the FOSSEE Task 1 requirements.

It runs entirely within Docker, ensuring consistency across Development, CI/CD, and Production environments.

Architecture

graph TD
    subgraph Docker["Cloud Native Container"]
        CLI["main.py (CLI)"]
        GUI["gui.py (Tkinter)"]
        Helper["utils.py (TreeHelper)"]
        Node["node.py (General Tree Node)"]
        RY["ruamel.yaml"]
    end
    
    Files["YAML Config File"]
    User[User]

    User -->|docker compose run| CLI
    User -->|docker compose run| GUI
    
    CLI --> Helper
    GUI --> Helper
    Helper -->|Builds| Node
    Helper -->|Reads/Writes| RY
    RY -->|Persists| Files
Loading

Prerequisite

  • Docker & Docker Compose

Cloud Native Setup

Build the container once. This encapsulates Python 3.11, Tkinter, X11 libs, and all dependencies.

docker compose build

Testing Requirements & Expected Outputs

Follow these steps to verify the "General Tree" implementation.

1. Verify Tree Structure (Print Tree)

Visualize the hierarchical General Tree structure.

Command:

docker compose run --rm app python main.py test_config.yaml --print-tree

Expected Output:

├── simulation
│   ├── gravity
│   │   ├── ...
│   └── active: true

2. Add a Node (General Tree Logic)

Add a new child node deeper in the tree. Note: This proves that we can add children to any parent, not just left/right.

Command:

docker compose run --rm app python main.py test_config.yaml --add-node "simulation.viscosity" --val 0.01

Expected Output:

Added node 'simulation.viscosity' with value '0.01'

(You can run the --print-tree command again to see it added under simulation)

3. Edit a Node

Modify an existing value in the tree.

Command:

docker compose run --rm app python main.py test_config.yaml --edit-node "simulation.endTime" --val 50

Expected Output:

Updated node 'simulation.endTime' to '50'

4. Delete a Node

Remove a child from a parent node.

Command:

docker compose run --rm app python main.py test_config.yaml --delete-node "simulation.active"

Expected Output:

Deleted node 'simulation.active'

5. GUI Test (X11 Forwarding)

Launch the graphical interface from the cloud container to your local display.

Command:

docker compose run --rm app python gui.py

Expected Output:

  • A window titled "OpenFOAM Tree Editor" appears.
  • You can load test_config.yaml.
  • The Treeview widget displays the nested tree.
  • Double-clicking values allows editing.

License

MIT License

About

A cloud-native, containerized OpenFOAM configuration tool with CLI & GUI support. Built for the FOSSEE 2026 Screening Task.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors