Error running SnappyHexMesh


#1

Hello,

I was trying to run an indoor heat flow simulation using butterfly. The spaces are consist of two adjacent box, with first box as an indoor room and the second box as an outdoor double skin facade with certain cavity distance (Picture below).

In the grasshopper definition, I was trying to define every single surface temperature differently.

But, when i tried to run the SnappyHexMesh, the error message was like this:

  1. Solution exception:
    –> snappyHexMesh Failed!
    –> FOAM FATAL IO ERROR:
    Cannot find patchField entry for boundingbox

file: /home/ofuser/workingDir/butterfly/indoor_airflow/0/T.boundaryField from line 29 to line 43.

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/buzz2/pawan/OpenFOAM/OpenFOAM-v1612+/src/OpenFOAM/lnInclude/GeometricBoundaryField.C at line 191.

FOAM exiting
[0]
[0]
[0] --> FOAM FATAL IO ERROR:
[0] Expected a ‘(’ or a ‘{’ while reading List, found on line 38 the word ‘_Room’
[0]
[0] file: /home/ofuser/workingDir/butterfly/indoor_airflow/system/snappyHexMeshDict at line 38.
[0]
[0] From function char Foam::Istream::readBeginList(const char*)
[0] in file db/IOstreams/IOstreams/Istream.C at line 134.
[0]
FOAM parallel run exiting
[0]

Do you guys have any idea what’s the problem?

Thank you

Regards,

Irfan


#2

How did you define the mesh for blockMesh? Did you visualize the mesh and did you ensure that _locationInMesh is inside the room?

boundingbox is a boundary condition that butterfly assigns to blockMesh bounding box and should be removed automatically when you generate the snappyHexMesh because it’s outside the volume that will be kept.


#3

Hello @mostapha. Yesterday, I tried to imitate all the setting in the in the example files called 04_atrium_bouyancy.gh you gave in the github. It was once works! But then, when I am trying to re-run the simulation with the same setting, the SnappyHexMesh in this time produce another error just like this:

  1. Solution exception:
    –> snappyHexMesh Failed!
    –> FOAM FATAL IO ERROR:
    Cannot find patchField entry for boundingbox

file: /home/ofuser/workingDir/butterfly/DSF_indoor_airflow/0/T.boundaryField from line 29 to line 157.

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/buzz2/pawan/OpenFOAM/OpenFOAM->v1612+/src/OpenFOAM/lnInclude/GeometricBoundaryField.C at line 191.

FOAM exiting

Before the running the SnappyHexMesh, I always purge the previous butterfly case. I tried to visualize the mesh using loadMesh and I saw no error message. I also tried to run checkMesh on blockMesh the output said Mesh OK.

Sorry, regarding the _locationInMesh, how do I ensure that?
I attempted to run the SnappyHexMesh twice with the first setting using a point data in the center of the room as the input for the _locationInMesh, and the second attempt without any data input for the _locationInMesh and they produce the same error.

Anyway, this is how it looks after the run:


The yellow surface as the inlet and the purple surfaces as the outlets

Any help will be much appreciated.
Thank you.


#4

Anyway, It was solved just now by removing the decomposeParDict from the SnappyHexMesh input so I did not run the process in parallel and by adjusting the _cellSizeXYZ input to value {1.0,1.0,1.0}.
With that setting, the Butterfly_Solution ran successfully.
Thank you


#5

Hi Irfanirwanudddin,

thanks for sharing the solution!


#6

hi @irfanirwanuddin

looking at your geometry it seems your walls have a thickness. that can easily cause issues with meshing. I suggest you to model only the internal surfaces of the volume you are meshing, it will be neater this way.

the location in mesh is just a point to select which side of the mesh you want to keep, just put a point inside the volume without intersecting with anything.

perhaps try without the “expandBlockMesh”, as this may cause some problems as well.

one more thing that comes up often is that the surfacefeaturelevel in snappy needs to be >= to the highest refinement level set to surfaces otherwise you get that boundary box issue.

best


#7

Thanks for sharing @irfanirwanuddin! Although I imagine the cellsize did more to help than not running decomposePar. That shouldn’t make your case fail.

Generally what happens in these cases is that Butterfly envelops your geometry with a box (the infamous boundinbox in your errors) that is slightly offset from your geometry. Then OF meshes the box (blockMesh) and then snaps your geometry to that (snappyHexMesh).

At that point you need two things:

  1. your locationInMesh to be inside the zone you want to simulate, in this case your room+facade
  2. your indoor geometry to be completely closed to the outside (i.e. the boundingbox). If there is an opening, then snappyHexMesh will happily mesh the outside as well and will not remove the boundingbox patch.

Hope this helps.

Kind regards,
Theodore.