gerlero / fronts

Numerical library for nonlinear diffusion problems in semi-infinite domains
https://fronts.readthedocs.io
BSD 3-Clause "New" or "Revised" License
4 stars 0 forks source link

Non linear diffusion equation #41

Open IvanOstr opened 1 year ago

IvanOstr commented 1 year ago

Hello guys, Good job on the package, it seems very handy and easy to use! Although it is not an issure per se, I would like to ask you whether this software or method can be used for non linear diffusion equations other types also. More specifically - I have a diffusion equation of plasma with "-kn^2" added to it. I want to solve it in r or r-z using cylindrical coordinates. What type of solution would you recommend?

My equation is: image

Thanks and good day, Ivan

gerlero commented 1 year ago

@IvanOstr thanks!

Yes, I believe the method can handle the addition of such a source term (and actually, any arbitrary source term as long as it doesn't depend on $r$ or $t$ alone).

The software currently doesn't support it though. I can't promise I'll add such a feature in the short term (even though it seems nice to have it), but I'll gladly take a pull request (here and/or at https://github.com/gerlero/Fronts.jl) that adds it. If I'm doing the math right in my head, the method doesn't need the derivative of the source term; it just needs to be able to evaluate it... (EDIT: not really; the derivative is likely needed for the Jacobian)

gerlero commented 1 year ago

Had more time to think about this one. I'm no longer that optimistic about the feasibility of supporting a source term—or at least, an arbitrary one—, as I'm not sure how that would interact with the method's assumption that the concentration is always equal to the initial value at $r\to\infty$ for any $t$. Although, a source term that is zero at the initial value (as I believe might the case in your example) might not be affected by this... it definitely warrants more thought.

I'm guessing you have thought about this far longer than I have (for our usage I've never had to consider a source term), so please correct me if you think I might be wrong here.

IvanOstr commented 1 year ago

Thank you very much for the responses :) In fact I haven't gone too far thinking about this problem yet. I think that in my case I don't mind if this assumption holds but it may not be generally true for all cases.

gerlero commented 12 months ago

@IvanOstr I've tried adding a source term to the equation. Unfortunately, it turns out that the Boltzmann transformation into an ODE needs a zero source term in order to be able to cancel out the $t$ factor unconditionally. Otherwise, a generic source term $F(\theta)$ yields an $F(\theta)t$ term in the ODE, which requires that $F(\theta) \equiv f(\theta)/r^2$—which is not the case in your equation—in order to get rid of that $t$ in the ODE.