Skip to content

About

FoDE — Foam Dictionary Editor (pronounced "foh-dee") A GUI editor for OpenFOAM dictionary files, built with Python and PySide6. NON-official tool for OpenFOAM. Quick start: README.md; Detailed documentation: USER_GUIDE.md; for developer: DEVELOPER.md; _ja: Japanese Version.

Resources

Stars

6 stars

Watchers

1 watching

Forks

Latest commit

 

History

33 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Foam Dictionary Editor (FoDE)

A desktop editor for OpenFOAM cases — open a case, see what its dictionaries describe, edit them with help on every key, and run the case without memorising commands. FoDE (pronounced "foh-dee") is free and open source, written in Python with PySide6.

🎬 Demo movies (eighteen, on Vimeo) · 📖 User Guide · 🖼️ Screenshots · 📄 Published in SoftwareX — see Citation

Main window — Tree and Editor tabs

What it does for you

  • See your dictionaries. blockMeshDict is drawn in 3-D, and the shapes in topoSetDict, snappyHexMeshDict, setFieldsDict and your sampling files are drawn on top of it — a box in the wrong place shows up before you mesh, not after. → 3-D viewer
  • Get help on every key. Select a setting and the side panel explains it, lists the valid choices, and says which OpenFOAM versions support it. Turbulence models come with the paper that defines them and their default coefficients. → Detail pane
  • All boundary conditions in one table. Every patch against every field, editable in place, instead of opening 0/U, 0/p, 0/k… one by one. → Boundary view
  • Run the case from the menu. blockMesh, setFields, the solver — in parallel, or in the background so it keeps going after you close FoDE — each with a dialog that shows the exact command, and a short summary of the log afterwards. → Run Solver
  • Help with a first run. Check Case finds the classic mistakes — a patch with no boundary condition, a controlDict that writes nothing — before anything runs; when a run fails anyway, the log summary explains the error in plain words and opens the file at the line. → Check Case
  • Add post-processing without knowing the dictionary. Probes, line graphs, cutting planes and forces from a form, drawn in 3-D as you fill it in. → Add Function Object
  • Plot what the run wrote. Probes, forces, sampled lines and residuals, several cases in one plot; save the image, an animation through the output times, the data as a CSV with headings, or a Python or gnuplot script that draws it again. → Plot Results
  • Compare with a working case. Put your case beside a tutorial: differences are coloured, and one right-click adopts a value. → Case comparison

Requirements

  • Python 3.10 or newer.
  • Linux is the main platform; macOS works too. On Windows, FoDE starts without the terminal, as the no-terminal variant (see Launch options): the xterm terminal needs a Unix pseudo-terminal, and the Tools commands are OpenFOAM shell commands, which Simple mode's cmd.exe cannot run. --variant standard brings it back.
  • OpenFOAM is not needed to edit. It is needed to run anything from the Tools menu: source OpenFOAM's bashrc in the shell you start FoDE from, and the built-in terminal inherits it. Both forks are supported — OpenFOAM from openfoam.com (v2xxx) and from openfoam.org (numbered versions).

Install

git clone https://github.com/snaka-dev/foam-dictionary-editor
cd foam-dictionary-editor
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt pyvista pyvistaqt matplotlib

This installs the latest release, which is what the main branch holds. The dev branch is a snapshot of unreleased work, updated whenever a feature is finished: git switch dev to try it, and use the Releases page for a stable version.

pyvista and pyvistaqt give you the 3-D viewer. They are optional — leave them out and everything else works — but most of what FoDE shows you is in that view. matplotlib draws Plot Results, and is optional in the same way. (pyvista installs it anyway.)

The terminal needs an internet connection on first launch

The built-in terminal uses xterm.js, which is downloaded into ui/xterm/ the first time FoDE starts. Without it, FoDE falls back to a simpler terminal; restart with internet access to retry, or download the files yourself:

File URL
xterm.js https://cdn.jsdelivr.net/npm/@xterm/[email protected]/lib/xterm.js
xterm.css https://cdn.jsdelivr.net/npm/@xterm/[email protected]/css/xterm.css
xterm-addon-fit.js https://cdn.jsdelivr.net/npm/@xterm/[email protected]/lib/addon-fit.js

FoDE checks each file against a fixed SHA-256 checksum and uses the files only when all three match, since the terminal page can type into your shell; a file that differs is downloaded again.

Updating: git pull, then pip install -r requirements.txt again.

Quick start: a dam break in five minutes

This uses tutorials/damBreak, which comes with FoDE.

  1. Start FoDE from a shell where OpenFOAM is sourced:

    source /usr/lib/openfoam/openfoam2606/etc/bashrc   # your installation's path
    python3 main.py
  2. Open the case: Case > Open Case… (Ctrl+O) and choose tutorials/damBreak. Its files are listed on the left.

  3. See it: open the BlockMesh tab. The mesh, the water column from setFieldsDict and the two gauge lines are drawn. If the tab is missing, untick xterm terminal at the top of the Terminal tab: the 3-D view and that terminal cannot share the graphics card, so they take turns.

  4. Read and edit: click system/controlDict, then a row in the Tree tab — the side panel explains the key and lists its choices. Change a value and save with Ctrl+S.

  5. Check the boundaries: the Boundary tab shows every patch against every field.

  6. Check before running: Tools > Check Case… lists anything that would stop the run, with the file and line. Here it reports that 0/ is missing; the next step creates it from 0.orig/.

  7. Run it (the run writes its mesh and results into the opened folder, so copy the tutorial first with Case > Duplicate Case… if you want to keep the repository clean): Tools > Run blockMesh…, then Tools > Run setFields… (its Restore 0/ from 0.orig/ first box is ticked for you), then Tools > Run Solver…. Each shows the command before it runs; the output appears in the Terminal and is saved to log.*.

  8. Look at the result: Tools > View Log Summary… condenses the solver log, and explains the error if the run failed; Tools > Open Mesh in ParaView… opens the case for viewing.

To start from your own case instead, open it the same way, or drag its folder onto the window. Case > Duplicate from Case Library… copies an OpenFOAM tutorial into a folder of your own to start from.

Features

Each heading links to the full description in the User Guide.

3-D view with topoSet shapes Boundary table Tools menu

Files and cases

  • The case's dictionaries, 0/ fields and Allrun-style scripts are listed for you; multi-region cases are grouped by region, and files pulled in by #include are listed too.
  • The list keeps itself up to date and shows whether a mesh exists, whether it is older than blockMeshDict, and whether the case is decomposed.
  • Create, back up, duplicate or delete files; save the case as a new one.
  • Browse, move, rename, copy or delete cases from inside FoDE.
  • Set-ups made of several cases — an overset background case and its mesh cases — are listed together, one click apart, and duplicated as a group.

Tree and text editing

  • A tree view and the plain text, kept in step both ways, with syntax highlighting and folding.
  • Add, duplicate, comment out or delete entries with a right-click; undo with Ctrl+Z.

Help on settings

  • Descriptions, valid choices and version support for controlDict, fvSchemes, fvSolution, blockMeshDict, snappyHexMeshDict and the turbulence models — including keys one fork renamed or the other never had.
  • Add your own as plain Python files.

3-D viewer (needs pyvista / pyvistaqt)

  • blockMeshDict with its $variables, #eval and #include resolved, coloured by patch type, with an editable table of its vertices.
  • topoSetDict, snappyHexMeshDict, setFieldsDict and sampling shapes on top, each switchable on and off; STL/OBJ surfaces as reference.
  • Side-by-side with the tree while you edit; save the view as an image.

Boundary conditions

  • Edit, add, delete, copy and paste patch entries in the table; add, delete or rename a patch in every field file at once.
  • Copy the table as Markdown or CSV.

Running and post-processing

  • blockMesh, snappyHexMesh, topoSet, setFields, checkMesh, decomposePar, reconstructPar and the solver, each from a dialog that shows the command; Allrun/Allclean; runs that outlive FoDE, stopped cleanly at a written time.
  • Add function objects from your installation's own templates, and run postProcess on existing results.
  • Delete processor* directories only after FoDE has checked that the reconstructed results are complete.
  • Check Case before a run, and log summaries that explain the error after a failed one.
  • Plot Results: probes, forces, sampled lines and residuals plotted and compared across cases, followed live while a solver runs, animated through the output times, and saved as an image, a CSV with headings or a matplotlib or gnuplot script; foamMonitor residual plots, and ParaView.
  • Allrun Steps: a case's Allrun as steps marked done or failed from their logs, run one at a time; Create Allrun from Logs writes an Allrun, Allclean and Allrun-parallel for a case built by hand.

Finding out how others do it

  • Search your installation's tutorials for a keyword and see it in use; compare your case with one and adopt its values.

Teaching

  • Record your own work on a case — the files you save, the commands you run, FoDE's own operations — tidy the steps, and write a Markdown guide for students, with or without FoDE's menus in it.

Settings

Launch options

python3 main.py                                   # standard: terminal and 3-D viewer (no terminal on Windows)
python3 main.py --variant no-terminal             # no terminal (what Windows starts as)
python3 main.py --variant no-terminal-blockmesh   # no terminal, 3-D viewer always shown

The variant you choose is remembered for the next launch. See Variants.

Example cases

The tutorials/ folder holds ready-to-open cases:

Directory Solver Purpose
tutorials/cavity/cavity/ icoFoam Single-region end-to-end workflow walkthrough
tutorials/cavity/cavityGrade/ icoFoam Non-uniform grading (simpleGrading)
tutorials/cavity/cavityClipped/ icoFoam Clipped geometry; mapFieldsDict
tutorials/snappyMultiRegionHeater/ chtMultiRegionFoam Multi-region case for the boundary view and region file listing
tutorials/damBreak/ interFoam Two-phase flow; setFieldsDict and 0.orig/
tutorials/pitzDaily/ simpleFoam The canonical RAS case; the only bundled case that is not laminar, so it is where the turbulence-model help is visible
tutorials/floatingBody/ overInterDyMFoam An overset pair (background + the floatingBody mesh case it merges in): switching between related cases, duplicating a group
tutorials/oneBlocks/ icoFoam 3-D single-block; blockMeshDict editing and 3-D mesh viewer
tutorials/oneBlocks-vars/ icoFoam As oneBlocks with variable substitution and compact face notation
tutorials/nineBlocks/ icoFoam 3×3 multi-block; regex boundary patches
tutorials/nineBlocks-vars/ icoFoam As nineBlocks with variable substitution and compact face notation
tutorials/topoSetShapes/ icoFoam Every topoSetDict geometry source the 3-D viewer can overlay, in one 3×3×3 block
tutorials/samplingShapes/ icoFoam The same for the sampling overlay: probe points, lines, a point cloud and both plane spellings

The cavity/ cases, snappyMultiRegionHeater, damBreak, pitzDaily, and floatingBody are from the OpenFOAM v2512 standard tutorial set. The oneBlocks* and nineBlocks* cases are custom blockMeshDict cases derived from cavity for FoDE testing.

License: these case files are licensed under the GPL-3.0 (not the AGPL-3.0 that covers FoDE source code). See tutorials/README.md for full provenance and license details.

Documentation

Help and feedback

Questions, bug reports and suggestions are welcome as GitHub issues. For a bug, the FoDE version (Help > About), your OpenFOAM version and the steps that led to it help most.

Citation

Citation is not required, but if FoDE has been useful in your research, a citation is welcome and helps support continued development:

Shinji Nakagawa, Foam Dictionary Editor: A GUI-based open-source tool for OpenFOAM case configuration, SoftwareX, Volume 35, 2026, 102852, ISSN 2352-7110, https://doi.org/10.1016/j.softx.2026.102852 (ScienceDirect)

License

Copyright (C) 2025-2026 Shinji NAKAGAWA. Released under the GNU Affero General Public License v3.0 or later (AGPL-3.0-or-later).

Some material here comes from OpenFOAM and is not covered by that licence: the bundled tutorial cases, the extracted keyword list, and the documentation quoted in the generated turbulence schema modules. That material is GPL-3.0-or-later and is held by several parties — the OpenFOAM Foundation, OpenCFD Ltd, Upstream CFD GmbH and Keysight Technologies. See THIRD-PARTY.md for per-file credits, generated from the sources rather than maintained by hand.

The toolbar and menu icons were drawn for this project, so they are covered by the licence above and need no third-party attribution.

Disclaimer

FoDE is provided "as is", without warranty of any kind. It edits, copies and deletes files in your cases, and although it guards those operations, you use it at your own risk: the authors are not liable for any loss of data or other damage arising from its use. Keep backups of any case you cannot regenerate. The binding terms are sections 15 (Disclaimer of Warranty) and 16 (Limitation of Liability) of the licence.

This offering is not approved or endorsed by OpenCFD Limited, producer and distributor of the OpenFOAM software via www.openfoam.com, and owner of the OPENFOAM® and OpenCFD® trade marks.

Acknowledgements

  • PySide6 (Qt for Python) — GUI framework (LGPL v3)
  • pyVista / VTK — the 3-D viewer (BSD-3-Clause, optional)
  • Matplotlib — Plot Results (PSF-based Matplotlib License, optional)
  • xterm.js — Terminal emulator used in the Terminal panel (MIT). Downloaded automatically from jsDelivr on first launch and cached in ui/xterm/
  • pytest / pytest-qt — Test framework (development only)

Special thanks to the OpenFOAM Foundation and OpenCFD / ESI Group and all contributors for developing and maintaining OpenFOAM as free, open-source CFD software.

About

FoDE — Foam Dictionary Editor (pronounced "foh-dee") A GUI editor for OpenFOAM dictionary files, built with Python and PySide6. NON-official tool for OpenFOAM. Quick start: README.md; Detailed documentation: USER_GUIDE.md; for developer: DEVELOPER.md; _ja: Japanese Version.

Resources

Stars

6 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages