Hello to the FiPy Team: I was recently reviewing some old work and thinking of converting it over to FiPy and realized that, while I had done some successful work in FiPy (with your assistance several times), there are a few gaps in my knowledge of how to apply FiPy to some CFD type problems. I apologize for asking questions you may feel are clear in your guide, but I am trying to learn how to use your awesome program a bit better so I don't have to keep asking questions.
I'm essentially looking at coupling the continuity equation for a fluid with the equations for motion or the equations of change. So, we start with this: \nabla(\rho*v) = -\frac{\partial \rho}{\partial t} But frequently I have a steady state situation in which: \nabla(\rho*v) = 0 In either case, I'm not sure how the continuity equation up in FiPy. Do you have any suggestions? Should I set up multiple convection terms like this: PowerLawConvectionTerm(coeff=rho, var = v_x) + PowerLawConvectionTerm(coeff=rho, var = v_y) + PowerLawConvectionTerm(coeff=rho, var = v_z) = 0 Similarly, we have momentum equations as: \nabla(\rho v_x) = -\frac{\partial{P}}{\partial x} +\rho g_x + \mu \nabla^2v_x \nabla(\rho v_y) = -\frac{\partial{P}}{\partial y} +\rho g_y + \mu \nabla^2v_y \nabla(\rho v_z) = -\frac{\partial{P}}{\partial z} +\rho g_z + \mu \nabla^2v_z I frequently am able to ignore the \rho g_i term but if I didn't, I believe I could treat this as a source term in Fipy, and simply add it to my equation. I understand how to do the diffusion and convection terms, from your guides. However, I don't know what to do with the pressure term. I don't usually have a consistent pressure in all dimensions so I would think that the pressure term should be a cell variable, but I don't know how to add it. I tried treating it as P.faceGrad, but I get errors. I've tried it as a PowerLawConvectionTerm, and I don't seem to get a result. Perhaps the problem is with the continuity equation? As a sort of classic example, I've uploaded a code that describes two plates with a fluid in between. In it, fluid is flowing between two plates. The bottom plate is stationary, the top one is moving. There's a pressure difference over the length of the plates. It's at steady state, but I'll probably end up playing with it as a non-steady state system eventually. I've tried it before, and perhaps I'm graphing it incorrectly, but it seems like it just presents a steady state solution. If I've got this completely wrong, could you suggest how to set up a continuity equation coupled with a momentum equation and, perhaps how to handle a first order differential term like the pressure gradient? Thank you, -- Daniel DeSantis
Two-plate flow example.py
Description: Binary data
_______________________________________________ fipy mailing list fipy@nist.gov http://www.ctcms.nist.gov/fipy [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]