I need to learn and utilize a finite volume automated solution package for a project I'm working on and have narrowed it down to these two packages. I was wondering if anybody has experience of both packages and could perhaps comment on a comparison. Considering the similar goal of both packages I am a little surprised that I can't find much in the way of a comparison on-line.

My feeling is that FiPy would be easier to learn/implement as it is Python based but that OpenFoam may be more robust and feature rich due to its wide adoption? Both packages have very credible organisations behind them.


1 Answer 1


I haven't used FiPy but only OpenFOAM, but I think some points on both homepages suggest it strongly depends on what you want to simulate.

OpenFOAM already has some solvers imlemented (mostly CFD, since your profile states computational plasma physics the mhdFoam solver may be what you want or at least serve as basis, here's its user group), but can be expanded to solve other FVM-feasible PDEs, while in FiPy you'll probably have to implement the equations from scratch anyway - and in the latter case, yes, Python is a lot more comfortable than C++, at least to me.

There are some Python codes that make life with OpenFOAM easier: PyFoam to help setting up cases, and pythonflu, a wrapper to write solvers in Python (untested, I don't know how that performs).

From my experience, setting up a case in OpenFOAM is rather tedious and you will most likely end up writing scripts to automate the mesh setup etc anyway, so I don't know whether FiPy would actually require that much more effort even if you used one of OpenFOAM's already implemented solvers. And should you choose to use Python for that scripting, I suspect you can write most of the code in a way that the decision on FiPy vs OpenFOAM boils down to a difference of less than 100 lines of code, i.e. it shouldn't be too difficult to change your mind later on, especially if planned beforehand.

The more important points are of course, how much time does the first time setup take and how well does it perform. I couldn't find any comparisons on either though, so you'd have to compare them yourself...

Personally, had I not already used OpenFOAM before and I would need to simulate a system for which OpenFOAM does not already provide a solver, I would most likely try FiPy first due to my preference of Python over C++. But as mentioned, together with PyFoam one could probably come up with a rather generic framework to compare the two... If a solver of OpenFOAM could be used though, I'd probably use that one.

  • $\begingroup$ Side note: Apart from the "official" OpenFOAM 2 there is also the OpenFOAM 1.6-ext project, which is a community driven branch with many user submitted features, while the former one is "only" developed by OpenCFD Ltd $\endgroup$ Jan 23, 2013 at 9:00
  • $\begingroup$ This is exactly the type of informed opinion I was looking for, thank you. It does sound like FiPy would be more suited to my needs. Plasma simulation often requires much more bespoke equation sets and so even something like mhdFoam is not terribly attractive to me. Cheers for your reply $\endgroup$
    – dmon
    Jan 23, 2013 at 10:09
  • $\begingroup$ @dmon Glad I could help. As mentioned, pythonflu may be worth a look then - maybe you can have a PhD s̶l̶a̶v̶e̶student compare the performance :-P $\endgroup$ Jan 23, 2013 at 10:19
  • $\begingroup$ @dmon So, how did things work out? $\endgroup$ Oct 7, 2014 at 12:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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