pdefipy

How to represent these non-standard pdes with FiPy?


I am trying to solve a set of PDEs with FiPy, but not sure how to represent the equations: see the PDEs here.

The terms give me trouble are those in red rectangle and blue rectangle. The one in red rectangle is a convection term times a function depending on x, T1 and T2; The one in blue rectangle is a transient term times another function depending on x, T1 and T2.

I couldn't find any example including this kind of terms. Could you please give me some suggestions, or share me an example?

I appreciate any help. Thanks in advance.


Solution

  • This question is similar to cellvariable*Diffusion in fipy, but for convection instead of diffusion. The solution is the same though. Use,

    to convert the red terms into a convection term with a coefficient of f and a source term.

    For the blue terms do exactly the same to get a transient term with a coefficient and a source term.


    Edit: if we assume that then we can still use

    and approximate explicitly (with f as a variable in FiPy and use grad). However, we can take it further and use,

    and approximate the final explicitly.

    Again, we can go even further with,

    Again the last term can be solved explicitly. Depending on the form of f the last them should become more insignificant and thus, the explicitness less of an issue.