You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
🐛[BUG]: Diffusion(time=True) in darcy_physics_informed/utils.py silently drops the time-derivative term #2020
In examples/cfd/darcy_physics_informed/utils.py, Diffusion builds the field as
T_var = Function(T)(*iv.values()) with iv = {x, y} (L52), and when time=True adds
T_var.diff(Symbol("t")) (L57). Since T_var does not depend on t, SymPy evaluates the
derivative to 0, so time=True silently produces the steady equation.
Impact: both Darcy examples use time=False (darcy_physics_informed_fno.py L84,
darcy_physics_informed_deeponet.py L124), so they are unaffected. Anyone reusing the
class for a transient problem (the docstring advertises dT/dt) trains against the
steady equation with no warning.
Suggested fix (after L51):
if time:
iv["t"] = Symbol("t")
With it, the equation vanishes on the exact heat solution
T = exp(-2π²Dt)·sin(πx)·sin(πy) (max residual ~1e-6), and time=False equations are unchanged.
Minimum reproducible example
cd examples/cfd/darcy_physics_informed
python -c "from utils import Diffusion; print(Diffusion(T='u', D=1.0, time=True).equations)"# {'diffusion_u': -1.0*Derivative(u(x, y), (x, 2)) - 1.0*Derivative(u(x, y), (y, 2))} <- no d/dt term
Activity