Rerun Butterfly cases in OpenFOAM

First I would like to give a shout out to Mostapha at Ladybug-tools, great tools and great video tutorials! I’m a HVAC engineer and just started to use Butterfly to generate CFD cases in OpenFoam. Butterfly has the potential to greatly simplify our workflow when using CFD to help us design. We have had issues running a cases created by butterfly outside of Dynamo. We would like to run the initial calculation through Dynamo then tweek it in OpenFoam and use paraview to analyse the results for reports. When I rerun the Indoor Airflow Case from the terminal (I typically run a Allrun script) I get a File Not Found error, then it references the …/1/p file. In an effort to isolate the issue I ran blockMesh and snappyHexMesh but no inlets or outlets were created. Am I missing something in the OpenFoam post-processing? Any guidance would be greatly appreciated. Thanks ahead of time for your effort.

Hi @fluke0, Thank you for the nice comments.

The file missing error is happening for two different reasons. I try first to explain the process and then cause of the issue.

The workflow in Butterfly is designed to write the files to folders only when they are needed. Because of that the case files are saved to the folder in 2 steps.

  1. Create Case writes the files that are needed for blockMesh and snappyHexMesh. It does NOT write the boundary condition though. The main reason not to write the boundary condition is that we don’t know about the boundaries that are needed for the study until we know about the recipe which is not known data until we get to the Create Solution node.

  2. Create Solution writes all the boundary condition. Once you write the solution you should be good to go for running the simulation from the command line.

The easiest workflow to do this is to bypass the meshing nodes and connect the case from Create Case to Create Solution node and write the solution without running it. Now you can go to the folder and use the commands to run the simulation.

But why when you run the initial run from inside Dyanmo, and then try to run it from command line you have the error?

When butterfly is running the analysis it does a number of automation work behind the scene that you need to take care of them manually if you want to run the case from the command line.

  1. It copies the final meshes under folder 0.
  2. It renames folder 1 and 2 to 1.org and 2.org during running the OpenFOAM commands so OpenFOAM doesn’t look inside these folders as the latest time folder.

In short, if you want to re-run a Butterfly folder, you need to rename folders 1 and 2!

Hope it helps.

Mostapha, Thanks for the reply and the guidance! I did as you suggested and bypassed the meshing nodes in Dynamo creating the case and the solution with out running blockMesh, snappyHesMesh and the simpleFoam solver. From the command line I ran blockMesh then snappyHesMesh and it created the /1 and /2 folders as you described. I tried running the case as is and it gave me the following error:
–> FOAM FATAL IO ERROR:
cannot find file

file: /home/fluke/OpenFOAM/OpenFOAM-v1612+/cases/simpleFoam/TutorialRoom1_export/2/p at line 0.

    From function regIOobject::readStream()
    in file db/regIOobject/regIOobjectRead.C at line 237.

FOAM exiting

I renamed both the /1 and /2 folder to /1.org and /2.org and ran simpleFoam, it gave the following error:
–> FOAM FATAL IO ERROR:
Cannot find patchField entry for boundingbox

file: /home/fluke/OpenFOAM/OpenFOAM-v1612+/cases/simpleFoam/TutorialRoom1_export/0/p.boundaryField from line 29 to line 45.

    From function void Foam::GeometricField<Type, PatchField, GeoMesh>::Boundary::readField(const Foam::DimensionedField<TypeR, GeoMesh>&, const Foam::dictionary&) [with Type = double; PatchField = Foam::fvPatchField; GeoMesh = Foam::volMesh]
    in file /home/fluke/OpenFOAM/OpenFOAM-v1612+/src/OpenFOAM/lnInclude/GeometricBoundaryField.C at line 191.

FOAM exiting

The error references a p.boundaryField file located in the /0 folder but it doesn’t exist. The only files that are in my /0 folder are:
/polyMesh
/epsilon
/k
/nut
/p
/U

Any further suggestions would be greatly appreciated.

See this discussion. Most likely the test geometry is not a closed geometry and the mesh is touching the bounding box.

I looked through that discussion and double checked my rvt file. As best it can tell it’s all closed up (i adjusted the floor and ceiling to make sure they intersect with the walls) but when I run the simpleFoam I still get the --> FOAM FATAL IO ERROR: Cannot find patchField entry for boundingbox. Also in the Rooms to HBZones node I set _boundaryLoc_ to 1 and 2, both gave the same error. Is there anyway I can send you my files to look at? The forum will not let me upload file, I’m new. Thanks for the help!!

Hi @fluke0, Can you update the file on dropbox or some other service and send me the link?