Hi everyone,
I'm running a simple 2D Navier-Stokes model: an IVP with two variables, the streamfunction p and the vorticity q. One equation is for the advection of vorticity, and the other relates p and q as lap(p) + q = 0.
I need to put a condition on the vorticity inversion (the second equation) so that it doesn't apply to the (nx,ny)=(0,0) mode. However, when I try:
problem.add_equation("lap(p)+q=0", condition="(nx!=0) or (ny!=0)")
and
problem.add_equation("p=0", condition="(nx==0) and (ny==0)")
I'm getting an error message claiming that ny is not defined.
I've seen the exact same syntax used for the exact same situation on previous exchanges on this group. Is this a new issue?
As a workaround, I was considering adding the equation "integ(p)=0", but I'm not sure how that's implemented in the back end. Is it going to do a long, unnecessary computation for all the other modes, or does Dedalus "know" that Fourier modes integrate out to 0, and compute this condition only for the constant mode? (Worth saying here that the spectral basis is Fourier x Fourier).
Do let me know!
Akash