You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`kabs/_solve_flow.py` — `solve_flow()` entry point and `FlowResult` container class; sets BCs, runs loop, handles convergence/VTK export; returns a `FlowResult`
9
+
-`kabs/_solve_flow.py` — `solve_flow()` entry point and `FlowResult` container class; sets BCs, runs loop, handles convergence; returns a `FlowResult`
10
10
-`kabs/_compute_permeability.py` — `compute_permeability()`: accepts a `FlowResult`, applies Darcy's law
11
11
-`kabs/_compute_hydraulic_conductance.py` — `compute_hydraulic_conductance()`: accepts a `FlowResult`, computes Q/ΔP conductance
12
12
-`kabs/utils.py` — `read_flow_vtr()` / `write_flow_vtr()`: VTR file I/O (pure `numpy` + `struct`, no pyvista dependency); embeds `direction` and `nu` as an XML comment for round-trip fidelity
@@ -31,8 +31,8 @@
31
31
- For the cylinders test image (`r=10`, `ν=1/6`): converges around 500–1000 steps
32
32
33
33
### VTR output
34
-
- Written via `result.export_to_vtk(prefix)`or automatically when `export_vtk=True` (default)
35
-
- Filename: `{prefix}-{final_step}-{axis}.vtr` (step count reflects actual converged step, not `n_steps`)
34
+
- Written via `result.export_to_vtk(prefix)`on the `FlowResult`, or via `write_flow_vtr(prefix, result)` from `kabs.utils`
35
+
- Filename: `{prefix}.vtr` (caller controls the full prefix, including any step/axis suffix if desired)
`kabs` computes the absolute (Darcy) permeability of a porous material from its 3D tomographic image using the Lattice Boltzmann Method (LBM). Given a binary voxel image of the pore space, it solves single-phase incompressible creeping flow, returning results in lattice units or physical units.
4
7
5
8

@@ -36,7 +39,7 @@ ti.init(arch=ti.cpu) # use ti.gpu for GPU acceleration
36
39
im = ps.generators.cylinders([200, 200, 200], r=10, porosity=0.7).astype(int)
37
40
38
41
# Run the LBM simulation and get a FlowResult back
39
-
result = solve_flow(im, direction="x", export_vtk=False)
42
+
result = solve_flow(im, direction="x")
40
43
41
44
# Optionally save to a VTR file for later inspection
42
45
result.export_to_vtk("sample")
@@ -93,14 +96,21 @@ compute_permeability(result)
93
96
The convergence check fires every `log_every` steps (default 500), so the true stopping
94
97
point is rounded to that interval.
95
98
99
+
To save the converged result to a VTR file, call `export_to_vtk` on the returned object:
0 commit comments