Dear FiPy developers and users, Thank you for your work! It's helped me a lot in my projects.
I used FiPy to solve an equation that models an accretion disk in 1D. I wrote the equation in the form: transient term = convection term. The problem I encountered is that the velocity coefficient in the convection term is a complicated function of the dependent variable. The function can't be written in terms of the built-in FiPy functions. In fact, the way I calculate this function is by numerically pre-computing the values in a grid and then interpolate for points in between. I didn't find anything in the documentation to create operator variables with user-defined functions. To go around this, I defined an operator variable as follows: T = Sigma._UnaryOperatorVariable(lambda x: bellLinT(x)) where `Sigma` is the dependent varible, `T.faceGrad` goes into the velocity coefficient, and `bellLin()` is the interpolating function that takes an array with the values of `Sigma` and returns the corresponding values for `T`. This seems to have worked, but I felt that I was somehow hacking FiPy and was never comfortable with it. Should I be concerned? Is there a proper way of doing this that I missed? If this should work in general, and is not in the documentation already. Wouldn't it be useful to put in there a way of building operator variables with user-defined functions? Best, Jose
_______________________________________________ fipy mailing list [email protected] http://www.ctcms.nist.gov/fipy [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]
