Error when creating boundary conditions (OpenFOAM)

In summary, the conversation discusses creating a mesh and setting boundary conditions using createPatchDict. The createPatchDict file contains a list of patches, each with a name and type. However, when running createPatch, an error occurs due to an incorrect format in the code. The issue is resolved by adding a space between patches and ().
  • #1
JD_PM
1,131
158
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
  • #2
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.
 
  • Like
Likes JD_PM
  • #3
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).
 

FAQ: Error when creating boundary conditions (OpenFOAM)

What is an error when creating boundary conditions in OpenFOAM?

An error when creating boundary conditions in OpenFOAM refers to a problem or mistake encountered while defining the boundary conditions for a computational fluid dynamics simulation. This can be due to incorrect syntax, mismatched units, or missing information in the boundary condition definition.

How can I troubleshoot an error when creating boundary conditions in OpenFOAM?

The first step in troubleshooting an error when creating boundary conditions in OpenFOAM is to carefully review the boundary condition definition to ensure that all required information is included and that it is written correctly. It can also be helpful to refer to the OpenFOAM documentation or seek assistance from other users on forums or support groups.

Why do errors occur when creating boundary conditions in OpenFOAM?

Errors can occur when creating boundary conditions in OpenFOAM due to a variety of reasons, such as incorrect input data, unsupported boundary types, or bugs in the software. It is important to carefully check the input data and consult the documentation to ensure that the boundary conditions are defined correctly.

Is there a way to avoid errors when creating boundary conditions in OpenFOAM?

While it is not possible to completely eliminate the possibility of errors when creating boundary conditions in OpenFOAM, there are some steps that can be taken to minimize their occurrence. These include carefully reviewing the input data, using the correct syntax and units, and seeking assistance from experienced users or support groups.

Can errors in boundary conditions affect the accuracy of my simulation results in OpenFOAM?

Yes, errors in boundary conditions can significantly impact the accuracy of simulation results in OpenFOAM. The boundary conditions define the behavior of the fluid at the domain boundaries, and any errors in their definition can lead to incorrect simulation results. It is important to carefully check and verify the boundary conditions to ensure the accuracy of the simulation.

Back
Top