Error when creating boundary conditions (OpenFOAM)

AI Thread Summary
The discussion revolves around setting boundary conditions (BCs) in OpenFOAM after creating a mesh using snappyHexMesh. The user copied the "createPatchDict" to their system folder and defined several patches with specific names and types in the configuration. However, an error occurred when running the command "createPatch -overwrite," indicating an issue with the syntax related to the keyword 'patches.' The solution involved correcting the formatting by adding a space between the keyword 'patches' and the parentheses, which resolved the error. This highlights the importance of precise syntax in OpenFOAM configuration files, specifically in defining boundary conditions and ensuring proper formatting to avoid fatal errors.
JD_PM
Messages
1,125
Reaction score
156
TL;DR Summary
I get a FOAM FATAL ERROR error when I run createPatch -overwrite to create the BCs
Let's give some context. I created a Mesh via snappyHexMesh and next I am setting the boundary conditions (BCs).

First I copied the patches folder "createPatchDict" to my system's folder via the command "cp $FOAM_ETC/caseDicts/mesh/manipulation/patches/createPatchDict ./system"

Taking into account that the BCs have names that you would like to change for the computation and that could also have particular types, createPatchDict text doc has the following patches

Code:
patches
(
    {
       name free_air;
       patchInfo
       {
          type patch;
       }
       constructFrom patches;
       patches (river_patch0);
    }
    {
       name inlet_water;
       patchInfo
       {
          type patch;
       }
       constructFrom set;
       set inlet_water;
    }
    {
       name inlet_air;
       patchInfo
       {
          type patch;
       }
       constructFrom set;
       set inlet_air;
    }
    {
       name outlet;
       patchInfo
       {
          type patch;
       }
       constructFrom patches;
       patches (river_patch5);
    }
    {
       name river_walls;
       patchInfo
       {
          type wall;
       }
       constructFrom patches;
       patches (river_patch2 river_patch4 river_patch6);
    }
    {
       name pillar;
       patchInfo
       {
          type wall;
       }
       constructFrom patches;
       patches (river_patch1);
    }
)

The issue is the following. When I run createPatch -overwrite to create the new BCs I get the following error.

--> FOAM FATAL ERROR:
"ill defined primitiveEntry starting at keyword 'patches' on line 19 and ending at line 78"

The text within the mentioned lines is basically what I wrote above but I do not understand how to fix the error.

I can always provide more details if needed beAny help is appreciated :biggrin:
 
Technology news on Phys.org
Although I know next to nothing about FOAM, I suspect the problem is that you are using a keyword, patches, for the name of a case in the code you posted.

Sections 4.1 and 4.2 of the OpenFOAM docs talk about boundaries.
boundary a list of patches, containing a dictionary entry for each patch, declared using the patch name, e.g.

Code:
movingWall
{
  type patch;
  nFaces 20;
  startFace 760;
}

The startFace is the index into the face list of the first face in the patch, and nFaces is the number of faces in the patch.
Hope this helps.
 
Thanks.

It had to do with patches but in the way I wrote it. Putting a space between patches and () made it work (there wasn't in the code I was running).
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I had a Microsoft Technical interview this past Friday, the question I was asked was this : How do you find the middle value for a dataset that is too big to fit in RAM? I was not able to figure this out during the interview, but I have been look in this all weekend and I read something online that said it can be done at O(N) using something called the counting sort histogram algorithm ( I did not learn that in my advanced data structures and algorithms class). I have watched some youtube...
Back
Top