morphogen.homogenization.flow

Viscous flow through the pores of a voxel image: the permeability of Darcy’s law.

A fluid of viscosity eta creeps through the pores of a rigid solid under a macroscopic pressure gradient G: the Stokes problem eta lap(v) - grad p = G, div v = 0 in the pores, v = 0 on their walls, the pressure p and the velocity periodic. Its mean velocity over the whole cell (the filtration velocity) obeys Darcy’s law,

<v> = -(k / eta) G,

with the permeability tensor k (a squared length: that of the pores), symmetric and positive, independent of the fluid.

Method. The lattice Boltzmann method with two relaxation times (Ginzburg 2005) on the voxels themselves (lattice D3Q19): populations f_i move along the 19 velocities c_i and relax towards the linear equilibrium of a Stokes flow, w_i (rho + 3 c_i . j) — their symmetric parts (f_i + f_-i) / 2 at the rate 1 / tau+, which sets the viscosity nu = (tau+ - 1/2) / 3, their antisymmetric parts at the rate 1 / tau- — and bounce back from the solid voxels (no slip). The product (tau+ - 1/2)(tau- - 1/2) is kept at 3/16, for which the wall of a channel along the lattice lies exactly midway between the last fluid node and the first solid one, and the steady solution does not depend on the viscosity: the permeability is a property of the voxels alone. The flow is driven by a uniform body force (the pressure gradient), with the half-force correction of the momentum, and marched to its steady state; its mean velocity is the mass flux of the populations that move between the nodes of the pores, conserved exactly (the same through every section, zero where the pores are closed), which takes a number of steps of the order of w^2 / nu for pores w voxels wide (hence a large tau+, 4 by default); the changes of the mean velocity decay geometrically, which gives the error left and the limit itself (Aitken’s extrapolation), accepted when it holds at two checks in a row.

A channel of H voxels between two plane walls has the exact parabolic profile at its nodes and the permeability H^2 / 12 + 1 / 24 (per unit of its width, in voxels: the mean of the parabola sampled at the nodes). Curved walls are drawn as stairs: a few percent of error when the pores are ten voxels wide, less when they are wider.

The voxels must be cubic. The pores are the void phases of the materials (a fluid has no Material); closed pores hold a fluid at rest.

References: H. Darcy (1856); I. Ginzburg, Adv. Water Resour. 28 (2005) 1171; I. Ginzburg, F. Verhaeghe, D. d’Humières, Commun. Comput. Phys. 3 (2008) 427; L. Talon et al., Water Resour. Res. 48 (2012) W04526; A. A. Zick, G. M. Homsy, J. Fluid Mech. 115 (1982) 13; A. S. Sangani, A. Acrivos, Int. J. Multiphase Flow 8 (1982) 193.

morphogen.homogenization.flow.ENTRIES = ('mean', 'porosity', 'k11', 'k22', 'k33', 'k23', 'k31', 'k12')

The scalar results of permeability_tensor() (columns of the tables of results and quantities of the statistics of RVE studies)

morphogen.homogenization.flow.MAGIC = 0.1875

walls midway between the nodes for the flow of a channel along the lattice

Type:

The product (tau+ - 1/2)(tau- - 1/2) of the two relaxation times

morphogen.homogenization.flow.pore_mask(image: VoxelImage, materials=None, pores=None) → ndarray[source]

The voxels of the pores of an image (a boolean array): those of the phases pores (a phase or several), or of the void phases of materials.

class morphogen.homogenization.flow.StokesFlow(direction: ndarray, velocity: ndarray, porosity: float, steps: int, error: float, time: float = 0.0, field: ndarray | None = None)[source]

Bases: object

The steady creeping flow of a periodic voxel image under a unit macroscopic pressure gradient along -direction (a unit vector), in the units of the image: velocity, the filtration velocity times the viscosity (-k . G: a row of the permeability for a direction along an axis); porosity; steps of the lattice Boltzmann method and the estimated relative error of the mean velocity left; field: eta v at each voxel (x, y, z, 3; zero in the solid) when asked for.

morphogen.homogenization.flow.stokes_flow(image: VoxelImage, direction, *, materials=None, pores=None, tol: float = 0.0001, max_steps: int | None = None, relaxation: float = 4.0, fields: bool = False) → StokesFlow[source]

The creeping flow through the pores of a periodic image driven along direction (see the module). pores: the phases of the fluid (by default the void phases of materials); tol: the relative error of the mean velocity at which the march to the steady state stops; max_steps: at most that many steps (by default 200 times the largest size of the image in voxels, at least 20000); relaxation: the time tau+ (viscosity (tau+ - 1/2) / 3 of the lattice: the steady flow does not depend on it, the number of steps does); fields: keep the velocity field.

morphogen.homogenization.flow.permeability_tensor(image: VoxelImage, materials=None, *, pores=None, axes=(0, 1, 2), **options) → dict[source]

The permeability tensor of a periodic voxel image (see the module): one flow per axis of axes (the others are left out: their rows and columns zero), symmetrized.

Returns "tensor" (3 x 3, in the squared unit of the spacing of the image), its entries k11 … k12, "mean" (the mean of the diagonal over the axes), the "porosity", the "steps" of the three flows and the largest "error" estimated. options: those of stokes_flow() (tol, max_steps, relaxation).