Skip to main content

AITW-Darcy-Infiltration-Model

This project contains code for simulating infiltration processes in porous materials using the FEniCSx finite element framework.

Install

cd <PATH to folder with pyproject.toml>
pip install .

Description

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

Key Features

  • 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

Usage

Progamatically

Example.

from aitw_darcy.data import Params
from aitw_darcy.infiltration import run_simulation

params = Params()
params.XXX = YYY  # Set parameters as needed

run_simulation(params)

CLI

The installation will make available a aitw-darcy command line interface.

  • Run aitw-darcy --help to see the available commands.
  • Run aitw-darcy infiltration --help to see all available options for running the simulation.
  • Run aitw-darcy infiltration --config-file INPUT_JSON_FILE to run the simulation using the parameters in JSON_FILE.

Example with the provided parameter file:

aitw-darcy infiltration --config-file examples/small.json

Using multiple processes

The code supports parallel execution using MPI. To run the simulation with multiple processes, use mpirun or mpiexec:

mpirun -np 4 aitw-darcy infiltration --config-file examples/small.json

Also make sure to set the OMP_NUM_THREADS environment variable to control the number of threads per process. If left unset it is possible that the simulation will use all available threads on the machine, which may lead to performance degradation. For example, to use 4 processes with 2 threads each:

export OMP_NUM_THREADS=2
mpirun -np 4 aitw-darcy infiltration --config-file examples/small.json --visualize

Tab autocompletion

Enabling tab autocompletion https://click.palletsprojects.com/en/stable/shell-completion/

E.G for bash run the command

eval "$(_AITW_DARCY_COMPLETE=bash_source aitw-darcy)"

You can also add it to either ~/.bashrc or, if you are using a virtual environment, to bin/activate of the virtual environment to avoid running the command for every new shell.

Output

The simulation generates the following output files in the specified output directory {output_dir}:

  • {label}_solution.npy - Complete solution array for analysis
  • {label}_output_S.xdmf - XDMF file for S visualization (can be opened in ParaView)
  • {label}_output_u.xdmf - XDMF file for u visualization (can be opened in ParaView)
  • {label}.log - Simulation log file
  • {label}.json - Copy of the input parameters for reproducibility + final saturation time if achieved (null otherwise)

where {label} is defined in the input parameters.

Parameters

Key simulation parameters:

  • 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

Metadata

Release files for AITW-darcy_infiltration 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for AITW-darcy_infiltration 1.0.0
File Size Uploaded Provenance Actions
aitw_darcy_infiltration-1.0.0.tar.gz 22.7 kB Without provenance Details for aitw_darcy_infiltration-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for AITW-darcy_infiltration 1.0.0
File Interpreter ABI Platform Actions
aitw_darcy_infiltration-1.0.0-py3-none-any.whl Python 3 none any Details for aitw_darcy_infiltration-1.0.0-py3-none-any.whl

Total release size: 45.8 kB

Release files / aitw_darcy_infiltration-1.0.0.tar.gz

Download URL aitw_darcy_infiltration-1.0.0.tar.gz
Size 22.7 kB
Tags Source
SHA-256 checksum
How to use checksums
36a3cc721a21b640d4de86c227e9c02efb655e7e37af69f6350841e74e4b9fa9
BLAKE2b-256 checksum
How to use checksums
3f7b011c3f10a6cf17b249ffa0161d5eda8c0cf9dc30e7433d88301e87f2607e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.34.2

Release files / aitw_darcy_infiltration-1.0.0-py3-none-any.whl

Download URL aitw_darcy_infiltration-1.0.0-py3-none-any.whl
Size 23.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
046ebf16bb6460dbf0e7650cd60e7328d62f16b9b3acf13167c632435cce4e77
BLAKE2b-256 checksum
How to use checksums
9a2e41e6811cce95f26d95790610ad0636c7fb2913b100b8436bc2f5e22fb03b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.34.2

Security for AITW-darcy_infiltration 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page