flow.macroscopic

flow.macroscopic(f, alpha)

Density and Brinkman-corrected velocity from the populations.

The velocity solves rho u = sum_i f_i c_i - alpha u / 2 exactly, so the drag is implicit and stays stable for any alpha >= 0.

Parameters

Name Type Description Default
f jax.Array Populations, (19, NX, NY, NZ). required
alpha jax.Array Per-cell drag coefficient, (NX, NY, NZ). required

Returns

Name Type Description
tuple[jax.Array, jax.Array] (rho, u) with shapes (NX, NY, NZ) and (3, NX, NY, NZ).