FlowResult
FlowResult(solver, direction, nu)
Container for a converged single-phase LBM flow simulation.
Attributes
| solid |
np.ndarray, shape (nx, ny, nz), dtype int8 |
Solid mask in internal convention: 1 = solid, 0 = pore. |
| rho |
np.ndarray, shape (nx, ny, nz), dtype float32 |
Density field. |
| velocity |
np.ndarray, shape (nx, ny, nz, 3), dtype float32 |
Velocity field (vx, vy, vz) at each voxel. |
| direction |
str |
Flow direction used in the simulation (‘x’, ‘y’, or ‘z’). |
| nu |
float |
Kinematic viscosity in lattice units. |
Methods
| export_to_vtk |
Write a VTK Rectilinear Grid (.vtr) file. |
| from_arrays |
Construct a FlowResult directly from numpy arrays (e.g. read from a VTR file). |
export_to_vtk
FlowResult.export_to_vtk(prefix)
Write a VTK Rectilinear Grid (.vtr) file.
Parameters
| prefix |
str |
Output path without extension (pyevtk appends .vtr). |
required |
from_arrays
FlowResult.from_arrays(solid, rho, velocity, direction=None, nu=None)
Construct a FlowResult directly from numpy arrays (e.g. read from a VTR file).
Parameters
| solid |
np.ndarray, shape (nx, ny, nz), dtype int8 |
Solid mask: 1 = solid, 0 = pore. |
required |
| rho |
np.ndarray, shape (nx, ny, nz), dtype float32 |
Density field. |
required |
| velocity |
np.ndarray, shape (nx, ny, nz, 3), dtype float32 |
Velocity field. |
required |
| direction |
(x, y, z) |
Flow direction. Can be supplied later to compute_permeability. |
'x' |
| nu |
float or None |
Kinematic viscosity in lattice units. Can be supplied later. |
None |