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).
 
Thread 'Star maps using Blender'
Blender just recently dropped a new version, 4.5(with 5.0 on the horizon), and within it was a new feature for which I immediately thought of a use for. The new feature was a .csv importer for Geometry nodes. Geometry nodes are a method of modelling that uses a node tree to create 3D models which offers more flexibility than straight modeling does. The .csv importer node allows you to bring in a .csv file and use the data in it to control aspects of your model. So for example, if you...
I tried a web search "the loss of programming ", and found an article saying that all aspects of writing, developing, and testing software programs will one day all be handled through artificial intelligence. One must wonder then, who is responsible. WHO is responsible for any problems, bugs, deficiencies, or whatever malfunctions which the programs make their users endure? Things may work wrong however the "wrong" happens. AI needs to fix the problems for the users. Any way to...
Back
Top