This project contains code for simulating infiltration processes in porous materials using the FEniCSx finite element framework.
data.py- Configuration file containing input parameters for the simulationinfiltration.py- Main simulation script implementing the infiltration model
The simulation models capillary infiltration in porous media using:
- 3D finite element mesh (hexahedral elements)
- Nonlinear saturation curve based on pore size distribution
- Adaptive timestepping for convergence
- Parallel computing support via MPI
- Mesh: 3D rectangular domain with configurable dimensions
- Physics: Capillary pressure, surface tension, contact angle effects
- Material properties: Porosity, permeability (anisotropic), pore radius distribution
- Solver: Newton-Raphson with adaptive timestepping
- Output: VTX files for visualization and numpy arrays for data analysis
This project requires FEniCSx and related dependencies with:
fenics-dolfinx- Main FEniCS librarypetsc4py- Parallel linear algebrampi4py- Message passing interfacematplotlib- Plotting and visualizationnumpy- Numerical computingtqdm- Progress bars
Run the simulation by providing the parameter file:
python infiltration.py data.pyThe simulation generates:
{label}_solution.npy- Complete solution array for analysis{label}_output.bp- VTX mesh files for ParaView visualization{label}.log- Simulation log file
Key simulation parameters (configurable in data.py):
- Mesh dimensions and resolution
- Material properties (porosity, permeability, surface tension)
- Fluid properties (viscosity, contact angle)
- Pore size distribution parameters
- Timestepping control
- Boundary conditions
Part of the AITW project at VTT Technical Research Centre of Finland