Finite difference solver for two-phase heat transfer in porous media with Brinkman flow
Description
This dataset contains the source code of a standalone Python application for simulating transient heat transfer in a porous medium composed of a moving fluid (liquid) and a stationary solid matrix. The solver accounts for local thermal non-equilibrium between phases (separate energy equations for solid and fluid), anisotropic effective thermal conductivity, internal heat sources, and convective heat exchange between phases. Four velocity profiles are implemented: constant, parabolic, cosine, and Brinkman (Darcy–Brinkman flow with prescribed flow rate). The code solves the Brinkman equation via a tridiagonal matrix algorithm to obtain the velocity profile used in the fluid energy equation. The graphical user interface (Tkinter) provides interactive contour plots of temperature fields (solid/liquid), velocity profiles, and time–temperature diagrams. The solver includes stability checks (NaN/inf detection, bounds). Results can be saved as compressed NumPy .npz files.
Files
Steps to reproduce
1. Prerequisites: - Install Python 3.8 or higher - Install required packages: pip install numpy scipy matplotlib pillow 2. Download the file: - Save 'porous_heat_solver_gui.py' to a local folder 3. Run the program: - Open terminal/command prompt in the folder and execute program.py; - Execute: Program.py 4. Input parameters (example test case). 5. Run simulation: - Click "Запустить расчёт" (Run calculation) button; - Wait for completion (status bar shows "Выполнено за X.Xc") 6. Verify results: - Check that temperature contours appear on the right tabs. 7. Save results (optional): - Click "Сохранить .npz" (Save .npz) to export data 8. Reproduce figures from paper (if applicable): - Use the third tab ("Профили температуры") to generate temperature profiles at x = L, y = H/2, etc. - Adjust slider to visualize different time steps