Skip to content

mttbrbr/bubbles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bubbles: A Modern Assistant for OpenFOAM Case Management

The Bubbles project provides a sophisticated toolset for the analysis, validation, and maintenance of OpenFOAM simulation environments. It is designed to address the inherent complexities of the OpenFOAM dictionary syntax and the structural dependencies across its distributed configuration files.

Architectural Overview

The system is constructed upon a Single Source of Truth (SSoT) architecture. Rather than treating individual dictionaries as isolated text entities, Bubbles internalizes the entire case state into a hierarchical Abstract Syntax Tree (AST). This allows for rigorous cross-validation between disparate components, such as mesh definitions, boundary conditions, and numerical schemes.

Core Components

  1. Lexical Analyzer: A hand-written lexer capable of discerning the nuanced tokens of the OpenFOAM dialect, including nested blocks, physical dimensions, macro expansions, and C-style comments.
  2. Recursive-Descent Parser: A non-generative parser that transforms raw dictionary strings into a validated FoamDict structure, preserving the semantic hierarchy of the original source.
  3. Case Manager: A high-level orchestrator that maintains the case state in memory, enabling real-time consistency checks between the system/, constant/, and 0/ directories.
  4. Terminal Interface: A modern user interface built on the Bubble Tea framework, providing a structured, tabular view of configuration keys without necessitating directory traversal.

Design Philosophy

The implementation follows the principle of "Perfect Round-trip Preservation." A primary objective is to ensure that the process of parsing and subsequent writing does not degrade the original file's integrity. To achieve this, the AST is designed to manage "trivia"—the whitespace and comments that provide essential context for human operators.

The OpenFOAM Schema Layer

To support the diverse variations between ESI-OpenFOAM and the Foundation releases, Bubbles utilizes an extensible schema layer. These schemas define the mandatory keywords and valid parameter ranges for specific solvers. By decoupling the logic from the data, the tool remains compatible with both legacy and modern versions of the OpenFOAM environment.

Installation and Execution

The project is implemented in Go. To compile and run the initial interface, execute the following commands within the repository root:

go mod tidy
go run main.go

Technical Specification

  • Data Model: Hierarchical AST with support for scalars, blocks, lists, and dimension sets.
  • Validation: Cross-file patch verification and physical dimension consistency checks.
  • Interface: Table-driven terminal UI with focused navigation and key-value previews.

Bubbles is an ongoing effort to bring modern software engineering practices to the domain of computational fluid dynamics.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages