The love-hate relationship builds.

The things I’m loving about OpenFOAM so far include: the price, the way it makes you understand what everything (every step, every parameter, every decision) is and means – the learning is much deeper, the way it make you understand that you’re asking the computer to do a lot of computations!

The things that I’ve spent a lot of time working through have all, in hindsight, been minor. That doesn’t mean that they’ve not been difficult for me at the time, especially given the user community and it’s online presence is relatively small. Actually, it might not be the community that is small, but that it is not coming so much from the education perspective, so there are lot less YouTube videos on it. And probably a bit more jargon than what I experienced when starting out with Ansys.

This aside…

So, I’ve

  • built my geometry in Blender – cool program (also open source!). I was a bit confused by the coordinate system though.
  • exported my geometry from Blender – as .stl files and in object and ascii format
  • built the snappyHexMesh procedure, including a starting block mesh to be the same dimensions as the Blender geometry, all the boundary conditions/ patch type settings
  • run the snappyHexMesh procedure
  • set up the case to run as a potentialFoam case
  • run the potentialFoam case
  • [touch CASE.foam] and open in ParaView (yes, open source!, and making sure to deselect the Skip Zero Time option – there is only zero time with the potentialFoam setup I’ve copied).
  • and…
Air velocity (x direction) around a sugar beet clamp – 1st attempt in OpenFOAM. Air entering at 5m/s on x axis (so, left to right)

Damn. Not what I was expecting.

The first issue is the lack of 0 velocity on the clamp face and the ground (the no-slip condition). This turns out to be a problem in the interface between openFOAM and ParaView – the data is right, but the visualization is not. I can live with that.

The second and the more obvious issue is that the air velocity makes no sense – where is the wind shadow? Where is the peak over the clamp? Like what I found in a similar attempt using Ansys:

But, like I said, OpenFOAM makes you think and not just click buttons looking for answers. So, I’ve changed solvers, moving to the simpleFoam solver. This is where I should have started if I had read the solver descriptions properly – I want a steady state solution for an incompressible turbulent model. So, once the k, epsilon and nut files were added to my 0 directory and updated, the controlDict file updated, and the fvSchemes and fvSolution files copied from another simpleFoam solver case, I was ready to run.

5m/s inlet velocity didn’t work – residuals blew up to something like 10^169 after 27 iterations. I guess information is flowing too fast/ the Courant number is too high (5m/s, 1s iterations (?), 0.03125m cell size: Co = 160…). So, just to make progress, the inlet velocity was dropped to 1m/s. 500 iterations and 7000 seconds later, voilà:

Air velocity (x direction) around a sugar beet clamp – using simpleFoam solver in OpenFOAM. Air entering at 1m/s on x axis (so, left to right)


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.