Module 18 · v1.1 · Fluid Dynamics · NumPy Only
Harmonic
Geometric Fluid
A 2D fluid dynamics module that evolves through harmonic geometry rather than linear time. The coherence field tracks geometric order across the grid. Turbulence is failed harmony. Stability is restored phase alignment.
from harmonic_geometric_fluid import HarmonicGeometricFluid
NumPy only · MIT licensed
The displacement approach
Standard Navier-Stokes evolves a fluid field through time — each step advances the system by dt. This module replaces that linear time axis with harmonic displacement. The fluid doesn't move through time. It moves through geometry.
The displacement operator D_φ combines three forces, each anchored to a universal geometric constant:
①
Convection
φ-scaled movement
The primary advection term, scaled by the golden ratio. φ sets the natural rate at which the field carries itself — not arbitrary, not tuned, but the ratio that appears wherever growth is stable.
conv = φ · (u₀·∂u₀/∂x₀ + u₁·∂u₀/∂x₁)
②
Rotation
θg golden-angle refraction
The rotational term, governed by the golden angle (2.39996 rad ≈ 137.508°). This is the angle that produces maximally uniform distribution in nature — sunflower seeds, phyllotaxis, optimal packing. Applied here as the rate at which the field refracts and turns.
rot = θg · (u₁·∂u₀/∂x₀ − u₀·∂u₁/∂x₁)
③
Damping
α fine-structure impedance
Strain damping scaled by the fine structure constant α ≈ 1/137. The same constant that governs electromagnetic coupling governs the drag coefficient here — the natural impedance of the field against its own deformation.
impedance = α · √(∂u₀/∂x₀² + ∂u₁/∂x₁² + ½(∂u₀/∂x₁ + ∂u₁/∂x₀)²)
Turbulence is failed harmony.
Stability is restored phase alignment.
The coherence field
Every step, the module tracks a coherence field C(x) across the grid — a measure of geometric order at each point. It evolves through four competing forces:
C1
Diffusion
Coherence spreads
High-coherence regions pull neighboring cells toward alignment. Coherence is contagious — ordered regions stabilize those around them.
C2
Strain growth
Energy input raises coherence
High-strain regions receive coherence — they're being worked, and that work lifts their geometric order. Rate: 0.8 × strain × (1 − C).
C3
Saturation
Prevents lock at 1.0
Coherence can't reach perfect 1.0 — the saturation term resists it. A fully locked field is brittle. Rate: −1.2 × C × (1 − C)².
C4
Harmonic reward
Phase-aligned regions are pulled up
Regions where the velocity gradient aligns with the golden angle θg receive a coherence boost. The field rewards its own geometry. Rate: 0.6 × cos(θg · ∂u₀/∂x₀) × (1 − C).
The floor
Coherence is hard-floored at PHI − 1 ≈ 0.618 — the golden conjugate. A field stabilized by φ cannot fall below 1/φ. This is not a clamp for numerical safety. It is the geometric minimum of the system's own basis.
Coherence field · φ = 1.618 · live simulation
Constants
Five universal geometric constants. Same constants used across all Living Circuit modules — the same relationships that appear in electromagnetism, biological growth, and signal propagation appear here in fluid geometry.
| Symbol | Value | Role in HGF |
| φ | 1.61803399 | Primary convection scaling — the natural rate of self-similar movement |
| θg | 2.39996 rad | Rotational refraction rate — golden angle, maximally uniform distribution |
| α | 0.00729735 | Strain impedance — fine structure constant as drag coefficient |
| π | 3.14159265 | Wave periodicity, angular normalization |
| e | 2.71828183 | Natural growth and decay in coherence evolution |
| φ−1 | 0.61803399 | Coherence floor — golden conjugate, geometric minimum |
API
Initialization
HarmonicGeometricFluid(grid_size=64, viscosity=0.001)
Initialize a grid_size × grid_size fluid field. Velocity initialized to zero. Coherence initialized at 0.85. C_floor set to PHI−1.
Seeding
seed_vortex(cx=None, cy=None, strength=0.1)
Inject a harmonic vortex into the velocity field. Center defaults to grid center. Strength controls peak velocity. Good starting condition for testing coherence recovery.
seed_uniform(ux=0.05, uy=0.0)
Seed a uniform laminar flow. Use to test displacement operator behavior in a clean field.
Stepping
step(dt_placeholder=0.1) → (u, C, total_energy)
One displacement step. dt_placeholder is a scaling parameter, not literal time — smaller values give more stable evolution. Recommended range: 0.01–0.1.
Returns: velocity field (2,N,N) · coherence field (N,N) · total energy scalar
Monitoring
is_stable(threshold=0.72) → bool
True if mean coherence exceeds threshold AND coherence std < 0.12. Both conditions required — high mean with high variance means the field is fighting itself.
get_summary() → dict
Returns step count, mean/min/max/std coherence, total energy, kinetic energy, stability flag, and C_floor. Use for logging and monitoring over long runs.
reset()
Reset velocity and coherence to initial state. Step count resets to zero.
Simulation output — v1.1
=== HarmonicGeometricFluid v1.1 ===
Zero velocity baseline:
step : 1
mean_coherence : 0.91705
min_coherence : 0.91705
max_coherence : 0.91705
coherence_std : 0.0
total_energy : 0.013761
kinetic_energy : 0.0
is_stable : True
C_floor : 0.618034
Seeded vortex — 20 steps:
Coherence range : 0.9170 – 1.0000
C_floor held : True
Final stable : True
NaN detected : False
v1.1 changes from v1.0
seed_vortex replaced nested Python loop with NumPy meshgrid — same output, ~100× faster on large grids. step() now computes independent convective terms for u[0] and u[1] — each velocity component advects correctly through its own gradients.
Pairs with
HGF operates on 2D grid fields — composable with any module that produces or consumes spatial signal arrays.
M07
Phase Reflection Agent
Monitor coherence drift over long runs. PRA sits above HGF and flags when the field is working too hard to stay stable.
M08
Impedance Variance Vectors
Pre-condition input vectors before seeding into HGF. Reduces initialization noise in high-resolution grids.
M10
Harmonic Coherence Filter
Score the output coherence field. Filter or gate downstream processing based on field quality.
M09
Impedance Network Simulator
Model signal propagation through the fluid field as an impedance network. Useful for photonic or acoustic applications.
NumPy only. Drop it in.
No framework dependencies. No external APIs. One file, one class, five constants.
Copyright © 2026 The Living Circuit LLC. Public code modules: MIT License. Website text, branding, and non-code content: All rights reserved. Built by John Burlingame / The Living Circuit LLC.