I am working on a 2D NS equation in streamfunction-vorticity formulation with topography in a tunnel (Fourier-Chebyshev base). I have built a similar case in double periodic and it seem to work. However, when migrating the case to the new mixed bases with some revised boundary conditions, the main loop does 2 iterations, then report "overflow encountered in multiply" warning and then "factor is exactly singular" error in the next iteration. I have encountered the singular matrix error previously, and it is usually related to improper boundary condition. However, I am not sure what is the probable cause for the singular matrix error after several iteration. Is it still the B.C. problem, or is it because of the overflow and thus make the matrix singular?
problem = de.IVP(domain, variables=['Psi', 'zeta','Psix','Psiy'])
problem.parameters['nu'] = nu
problem.parameters['H'] = H
problem.parameters['Hinv'] = Hinv
problem.parameters['r'] = r
problem.substitutions['v'] = "Hinv*dx(Psi)"
problem.substitutions['u'] = "-Hinv*dy(Psi)"
problem.add_equation("Psix-dx(Psi)=0")
problem.add_equation("Psiy-dy(Psi)=0")
problem.add_equation("dt(zeta) + r*(Hinv**2)*(dx(Psix)+dy(Psiy))= Psiy*dx(zeta*Hinv) - Psix*dy(zeta*Hinv) + nu*(dx(dx(zeta)) + dy(dy(zeta)))+r*(Hinv**3)*(Psix*dx(H))+F()")
problem.add_equation("zeta = dx(v) - dy(u)")
problem.add_bc("left(Psi)=12")
problem.add_bc("right(Psi)=12")