Runing examples outside Grasshopper (outdoor example)

I am trying to develop a workflow for OpenFoam where I create the whole OpenFoam case in Butterfly, and then meshing and running it from linux machine. I am trying the new examples, based on the latest Butterfly in Github. Here is my finding on the outdoor example.

  1. The write options are not working properly.

I like the write toggle options in the latest Butterfly, as I can straight away saving my case files without having to run anything on my windows machine. However, when I tried that on the outdoor example, I got some error on my linux machine when I tried to mesh the case.

Apparently, the write command did not export “outdoor_airflow.eMesh”, so snappyHexMesh failed.

  1. Writing and Running works partially

When I run the case in my windows machine, the process stops at snappyHexMesh with the following error:
new cannot satisfy memory request.
This does not necessarily mean you have run out of virtual memory.
It could be due to a stack violation caused by e.g. bad use of pointers or an out of date shared library

I took this case to a linux machine, and re-run blockMesh and snappyHexMesh, the process works fine, but the mesh is not good:
Finished meshing with 1646929 illegal faces (concave, zero area or negative cell pyramid volume)

So, toggling the run command manage to export the “outdoor_airflow.eMesh” file that was not exported using the write command.

Well, I did not continue my experiment to running the simulation as the mesh is not good. I will report again later with another case.

Hopefully the example can be fixed so that we can have a working example for newbies like to learn Butterfly.

hi @erydjunaedy,

there are a couple of extra steps which butterfly take care automatically in the background.
when running a case on windows after writing don’t forget to run the ‘surfaceFeatureExtract’ command. This one will generate the .eMesh file you were missing.


With regards to your mesh, make sure your geometry is watertight and that your location in mesh point is well positioned. Adjust the refinement levels gradually towards the areas of interest. The defaults of butterfly should allow you to proceed.

1 Like

Hello @OlivierDambron thank you for your help. I followed the instructions and managed to get pass the snappyHexMesh.

I will come back to the linux run later, but here is what I found on the butterfly run.

I completed the outdoor simulation inside butterfly, and open the result in ParaView.

Strange thing happens: the building surfaces are not listed in the mesh list, and cannot be viewed in the mesh.

However, when I viewed the result in butterfly, the building and the mesh looks fine.

Did I miss anything?

Hi @erydjunaedy
From what I see , try to go to time 2 in paraview and see if you get it.
Blockmesh is written in /0
Castellated /1
Snapped /2

Let us know

Hi @OlivierDambron

Sorry for the delayed response. I tried to replicate the problem again but it seems that I cannot.

I confirm that I can open the results in Paraview. I have tried this for serial and parallel runs.

However, on serial run, I have this error message when I open the result. This happens only for timestep 1. Any ideas why?

Hi @erydjunaedy,

You’re right. This is a current limitation and will be addressed before the official release. For now you can run the commands yourself before running snappyHexMesh as suggested by @OlivierDambron

Did you configure memory allocation to VM after installation? VM doesn’t have access to all the memory of your machine unless you give it the permission.

It sounds like you haven’t removed the refinement region from the case. Otherwise the mesh should have an acceptable quality.

Just as a note what you are visualizing in Grasshopper preview in this case is the grid of probes which doesn’t necessarily match you mesh. You can visualize the mesh using component.

If I’m not mistaken the error is because ParaView cannot find the boundary condition files in the folder. It happens because Butterfly writes the boundary condition to folder when you write the solution. Folder 1 is created when you ran snappyHexMesh and at the time there was no boundary condition file to be copied. You can just copy them from folder 0 in this case and that should remove the error.

1 Like

Hi Mostapha, thank you for you reply. How do I remove the refinement region?

Hi @OlivierDambron and @mostapha

I think I have a problem. I looked at the flow domain in ParaView, the model looks so small. The range of x axis is about 0.04m.

I ran checkMesh, and it says:

Checking geometry...
    Overall domain bounding box (-0.02910161 -0.01213029 0) (0.06054806 0.1394959 0.03531573)
    Mesh has 3 geometric (non-empty/wedge) directions (1 1 1)
    Mesh has 3 solution (non-empty) directions (1 1 1)
    Boundary openness (-9.552427e-17 1.883e-16 -8.503742e-14) OK.
    Max cell openness = 2.219543e-16 OK.
    Max aspect ratio = 36.70771 OK.
    Minimum face area = 2.07425e-09. Maximum face area = 0.0001584144.  Face area magnitudes OK.
    Min volume = 1.320675e-13. Max volume = 1.016664e-06.  Total volume = 0.0004790682.  Cell volumes OK.
    Mesh non-orthogonality Max: 45.04813 average: 3.268392
    Non-orthogonality check OK.
    Face pyramids OK.
    Max skewness = 0.3335899 OK.
    Coupled point location match (average 0) OK.

The bounding box is tiny, isn’t it?

I looked it up further, and blockMeshDict contains the following line:

convertToMeters 0.0010;

This is wrong, right? Any thoughts on how it can be there? I believe that I work in meter in Grasshopper/Rhino.

Hi @erydjunaedy,

Disconnect refRegions_ from wind tunnel:

Most likely the units are not set correctly in your model. It seems they are set to mm while the Grasshopper model is sized in Meters. You can see the units in the bottom of the window.

You can right click on units and select Unit Settings or simply type units In Rhino command line and change it to meters. Now recompute your Grasshopper solution (Right click > Recompute).

If you want to keep the units in mm then you need to scale the buildings to be the correct size in mm. Butterfly works with any units as long as it is set correctly in Rhino.

Okay thanks. A follow up question: if the refinement region needs to be disconnected, why should it be connected in the first place? If we disconnect, does that mean the region will not get refined?

My student built the model, and I generated the OpenFoam files myself. So I told her there is something wrong. The model works fine on her machine. Well apparently what is wrong is in my Rhino settings, as you said.


The sample file show cases the possibilities including refinement region. If you use grading it provides a basic level of refinement around the geometries. In case you need to refine an area more you can use refinement region otherwise you don’t have to.

how to set refinement region properly @mostapha? I always get problem o it. the refinement region is in wrong side.

Thank you