Behavior · Published v1

SurfaceTopology

SurfaceTopology from Water Drop Tank.

From Water Drop Tank · v2. Edit this definition in its source simulation.

Source

behavior SurfaceTopology for FreeSurfaceWater
{
    update {
        let hasFluid = min(sum n in neighbors[FreeSurfaceWater using D3Q19] { n.fluid }, 1.0);
        let hasGas = min(sum n in neighbors[FreeSurfaceWater using D3Q19] { n.gas }, 1.0);
        set self.rank = clamp(hasFluid * (2.0 - hasGas), 0.0, 2.0);
        set self.gx = clamp(0.5 * ((neighbors[FreeSurfaceWater using D3Q19, +X].fill else self.fill) - (neighbors[FreeSurfaceWater using D3Q19, -X].fill else self.fill)), -1000000.0, 1000000.0);
        set self.gy = clamp(0.5 * ((neighbors[FreeSurfaceWater using D3Q19, +Y].fill else self.fill) - (neighbors[FreeSurfaceWater using D3Q19, -Y].fill else self.fill)), -1000000.0, 1000000.0);
        set self.gz = clamp(0.5 * ((neighbors[FreeSurfaceWater using D3Q19, +Z].fill else self.fill) - (neighbors[FreeSurfaceWater using D3Q19, -Z].fill else self.fill)), -1000000.0, 1000000.0);
    }
}

Building blocks

These exact versions are included when you reuse this artifact.

PropertyFreeSurfaceWater@hyle · v1