3D Micropolar Fluid Flow Solver: Numerical Simulation of a Lid-Driven Cavity using MATLAB
Description
This dataset contains a complete MATLAB implementation for the numerical simulation of a three-dimensional, steady-state flow of an incompressible micropolar fluid in a closed cubic cavity with a moving upper lid. The code solves the full system of Eringen's micropolar hydrodynamics equations using a finite difference method on a uniform staggered grid combined with a projection scheme for pressure-velocity coupling. The solver features explicit time integration, second-order central differencing for spatial derivatives, and a Successive Over-Relaxation (SOR) method for the Poisson pressure equation. The simulation accounts for key physical parameters: Reynolds number (Re), and micropolarity parameters (N, m). The package includes functions for applying boundary conditions (no-slip for velocity, homogeneous Neumann for microrotation on stationary walls, and zero microrotation on the moving lid), calculating energy dissipation, and generating publication-quality visualizations of velocity, pressure, microrotation, and dissipation fields. The code is designed for reproducibility and includes detailed convergence monitoring, grid independence verification, and physical consistency checks (e.g., mass conservation). This work provides a foundational numerical framework for researchers and students in computational fluid dynamics studying the influence of internal microstructure on macroscopic flow characteristics in confined domains.
Files
Steps to reproduce
Download the file MicropolarFlow3D.m. Open MATLAB (version R2023a or later recommended). Run the main script MicropolarFlow3D.m. The code will automatically: Set up the computational domain (41x41x41 grid) and physical parameters (Re=5, N=0.2, m=0.3). Execute the iterative solver for up to 3000 iterations or until convergence (relative tolerance 1e-6). Generate and display figures showing: Convergence history of residuals. Contour plots of velocity components, pressure, microrotation magnitude, and energy dissipation in the central horizontal plane (z=0.5). Vector field of the flow. Line profiles of all variables along central axes. Print a detailed quantitative analysis of the solution (boundary condition verification, divergence check, micropolar effect quantification, energy balance). To modify simulation parameters (Re, N, m, grid resolution), edit the corresponding variables in the "PROBLEM PARAMETERS" section of the main script. All computed fields are stored in the solver structure for further post-processing.
Institutions
- Samara State Technical University
- Ural'skij federal'nyj universitet imeni pervogo Prezidenta Rossii B N El'cina