- #1
Daniel Sellers
- 117
- 17
- TL;DR Summary
- I have a discretized second order PDE which I am attempting to solve numerically and having a hard time. Looking for suggestions for the best way to solve it.
I am attempting to solve the following PDE for Ψ representing a stream function on a 2D annulus grid:
(1/s)⋅(∂/∂s)[(s/ρ)(∂ψ/∂s)] + (1/s2)⋅(∂/∂Φ)[(1/ρ)(∂ψ/∂Φ)] - 2Ω + ρ(c0 + c1ψ) = 0
I have made a vertex centered discretization:
(1/sj)⋅(1/Δs2)⋅[(sj+1/2/ρj+1/2,l){ψj+1,l - ψj,l} - (sj-1/2/ρj-1/2,l){ψj,l - ψj-1,l}] + (1/sj2)⋅(1/ΔΦ2)⋅[(1/ρj,l+1)⋅{ψj,l+1 - ψj,l} - (1/ρj,l-1)⋅{ψj,l- ψj,l-1}] - 2Ω + ρj,l(c0 + c1Ψj,l)
This can be made to form a tridiagonal matrix by iterating through j with constant l, if we can treat ψj,l+1 and ψj,l-1 terms as known values. It's been suggested to me that we can group these two terms together (R = k1ψj,l+1 + k2ψj,l-1) and solve for them based on an 'initial guess' of all Ψj,l=c.
The resulting tridiagonal matrix (in terms of ψj,l, ψj-1,l, ψj+1,l) can then be solved as long as the boundary conditions are specified. The problem I'm running into is how to actually treat R.
Is it valid to assume R = k1ψj,l+1 + k2ψj,l-1 + 2Ω - ρj,lc0 (group all of the known terms in the equation together)? If the last two terms are included in R then the method just results in solving for the initial guess given.
Alternatively, we could base the R1 on an initial guess, solve for Ψ1,l in terms of Ψ2,l and then find R2 in terms of Ψ1,l, Ψ2,l, Ψ3,l. This let's us find Ψ2,l in terms of only Ψ3,l and so on. I believe this is similar methodology to the Guass-Seidel method of updating in place.
Neither of these methods seems to converge over many iterations. The first method, where R is based completely on a 'guess' vector with 2Ω - ρj,lc0 implicitly included, the values for psi simply decrease slowly over each iteration. The second method I've described appears to be even more unstable and quickly blows up to huge values no matter the initial guess.
Thanks for reading this far, I realize my approach may be somewhat naive as I have not developed intuition for this kind of problem solving yet. How would you solve this PDE numerically?
(1/s)⋅(∂/∂s)[(s/ρ)(∂ψ/∂s)] + (1/s2)⋅(∂/∂Φ)[(1/ρ)(∂ψ/∂Φ)] - 2Ω + ρ(c0 + c1ψ) = 0
I have made a vertex centered discretization:
(1/sj)⋅(1/Δs2)⋅[(sj+1/2/ρj+1/2,l){ψj+1,l - ψj,l} - (sj-1/2/ρj-1/2,l){ψj,l - ψj-1,l}] + (1/sj2)⋅(1/ΔΦ2)⋅[(1/ρj,l+1)⋅{ψj,l+1 - ψj,l} - (1/ρj,l-1)⋅{ψj,l- ψj,l-1}] - 2Ω + ρj,l(c0 + c1Ψj,l)
This can be made to form a tridiagonal matrix by iterating through j with constant l, if we can treat ψj,l+1 and ψj,l-1 terms as known values. It's been suggested to me that we can group these two terms together (R = k1ψj,l+1 + k2ψj,l-1) and solve for them based on an 'initial guess' of all Ψj,l=c.
The resulting tridiagonal matrix (in terms of ψj,l, ψj-1,l, ψj+1,l) can then be solved as long as the boundary conditions are specified. The problem I'm running into is how to actually treat R.
Is it valid to assume R = k1ψj,l+1 + k2ψj,l-1 + 2Ω - ρj,lc0 (group all of the known terms in the equation together)? If the last two terms are included in R then the method just results in solving for the initial guess given.
Alternatively, we could base the R1 on an initial guess, solve for Ψ1,l in terms of Ψ2,l and then find R2 in terms of Ψ1,l, Ψ2,l, Ψ3,l. This let's us find Ψ2,l in terms of only Ψ3,l and so on. I believe this is similar methodology to the Guass-Seidel method of updating in place.
Neither of these methods seems to converge over many iterations. The first method, where R is based completely on a 'guess' vector with 2Ω - ρj,lc0 implicitly included, the values for psi simply decrease slowly over each iteration. The second method I've described appears to be even more unstable and quickly blows up to huge values no matter the initial guess.
Thanks for reading this far, I realize my approach may be somewhat naive as I have not developed intuition for this kind of problem solving yet. How would you solve this PDE numerically?