@Kim Jae Sik https://github.com/oathis/2DFluentPODGalerkin
This repository provides a pipeline that builds a Proper Orthogonal Decomposition (POD) Galerkin reduced-order model from 2D flow snapshots exported from Ansys Fluent. Given a target Reynolds number, the reduced model is solved to reconstruct the full flow field.
- Python 3.9+
- Scientific Python stack (NumPy, Pandas, SciPy, Matplotlib, etc.)
PreProcessing/preprocessing.py: Sorts Fluent CSV snapshots by coordinates and generates_sortedfiles in batch.Galerkin_offline.py: Extracts the interior grid from the sorted snapshots, computes POD modes, pre-computes Galerkin tensors, and stores them inrom_offline_data.npz.Galerkin_online.py: Loads the offline data, solves the nonlinear equations for a specified Reynolds number, and exports the reconstructed pressure/velocity fields as CSV files and interpolated plots.PostProcessing/CalculateL2.py: Calculates the relative L2 error between the reference solution and ROM solution, and visualizes the error trend versus Reynolds number.
- Data sorting
Place Fluentcase*.csvfiles in a working folder such asTrainData/and runpython PreProcessing/preprocessing.pyto generate the_sortedfiles. - Offline stage
RunPPE_POD_Galerkin_OFFLINE.pyto readTrainData/case*_sorted.csv, compute POD modes and Galerkin tensors, and store the results inrom_offline_data.npz. - Online stage
RunPPE_POD_Galerkin_ONLINE.py, enter the desired Reynolds number, and the reduced model will reconstruct the flow field, saving the output toFinalResult/rom_solution_Re_<Re>.csvalong with PNG plots. - (Optional) Post-processing
Runpython PostProcessing/CalculateL2.pyto compare the reference and ROM solutions and generate the Reynolds-number-dependent relative L2 error plot.
rom_offline_data.npz: POD modes, boundary conditions, and precomputed Galerkin coefficient tensors from the offline stage.FinalResult/rom_solution_Re_*.csvand plots: Reconstructed pressure/velocity fields from the online stage.rom_error_vs_re.png: Relative ROM error versus Reynolds number produced by the post-processing script.