In the context of a research project of mine, I am faced with the difficult task of modeling the mixing of two fluids in a container. I would like to achieve the following:

Given a container (cylindrical or spherical) containing a static mixture of gases (carbon dioxide + nitrogen), an inflow channel of oxygen into the container, and a vacuum outflow exiting the container, I would like to simulate the evolution of the mixing of gases inside the container (composition and vortices) and in the outflow channel. In fact, the goal is to end up with a crude model of a lung with the particularity of a vacuum outflow.

Does anyone point me to a tool (perferably free) or a set of techniques that could help me build such a simulation? I can program in pretty much any language, and GUI software packages would be ok too

  • 1
    $\begingroup$ To such purpose most convenient are Smoothed Particle Hydrodynamics methods. Check this link $\endgroup$ – Misery Oct 18 '15 at 16:18

OpenFOAM is a free, fully functioned CFD package which is capable of such simulations and also deformable meshes if that becomes relevant. OpenFOAM primarily uses the finite volume method and already has a solver developed for your application - interMixingFoam. Others are:


Even so, the development of new solvers is pretty straightforward since it is developed to handle the weak form of your equations. There are also some GUIs that exist to help developing the simulation,my preferred one when I was learning OPF is HelyxOS:


And there is a very active forum community that supplements the somewhat poor documentation:


Lastly, there is an extended project which contains a number of additional features for OPF that are developed by the community:



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.