OpenLB Manager is a lightweight, full-stack graphical user interface for the OpenLB C++ library. It allows users to scan, configure, compile, and run simulation cases without interacting directly with the terminal.
- Case Scanner: Automatically detects simulation cases (based on
Makefilepresence) in themy_casesdirectory. - GUI Wrapper: A modern web interface (React + Tailwind CSS) to interact with the build system.
- One-Click Build & Run: Compile and execute simulations directly from the browser.
- Configuration Editor: Edit
config.xmlparameters for each case on the fly. - Real-time Output: View build and simulation logs in the integrated terminal window.
- Modular Architecture: clearly separated Backend (Python/FastAPI) and Frontend (TypeScript/React).
The project is organized into the following structure:
.
├── openlb-gui/
│ ├── backend/ # FastAPI server (Python)
│ │ ├── main.py
│ │ └── ...
│ └── frontend/ # React application (Vite + Tailwind)
│ ├── src/
│ └── ...
└── my_cases/ # Simulation cases directory
├── Aerospace/
│ └── cyl_flow/
└── Biomedical/
└── aorta_sim/
- Backend: A Python FastAPI server that handles file system operations, executes shell commands (
make,make run), and serves the API. - Frontend: A React application built with Vite and styled with Tailwind CSS, communicating with the backend via REST API.
- OpenLB: v1.6 or higher (installed and referenced in your Makefiles).
- MPI: OpenMPI or MPICH (for parallel simulations).
- Python: v3.8 or higher.
- Node.js: v18 or higher (for building the frontend).
git clone <repository-url>
cd <repository-folder>Navigate to the backend directory and set up a virtual environment:
cd openlb-gui/backend
python3 -m venv venv
source venv/bin/activate
pip install fastapi uvicornNavigate to the frontend directory and install dependencies:
cd openlb-gui/frontend/
npm install
npm run buildRun the backend and frontend in separate terminals for hot-reloading.
Terminal 1 (Backend):
cd openlb-gui/backend
source venv/bin/activate
uvicorn main:app --reload --port 8080Terminal 2 (Frontend):
cd openlb-gui/frontend
npm run devOpen your browser at http://localhost:5173.
Serve the built frontend static files directly from the backend. (Note: Requires configuring StaticFiles in main.py pointing to frontend/dist).
To add a new simulation case:
- Create a new directory under
my_cases/(e.g.,my_cases/Energy/wind_turbine). - Add a Makefile in that directory. It must support:
make all: To compile the code.make run: To execute the binary.
- (Optional) Add a
config.xmlfile to enable parameter editing in the GUI.
Example structure:
my_cases/
└── Energy/
└── wind_turbine/
├── Makefile
├── config.xml
└── main.cpp
- "Case path not found": Ensure your
my_casesdirectory is in the project root. - Build Failures: Check the
Makefilein the specific case directory by runningmakemanually in the terminal. - MPI Errors: Ensure
mpirunis available in your system path. - Frontend Connection Refused: Make sure the backend is running on port 8000.