Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Apply for Membership

Error: Boundary code 1 has not been properly defined
  • wfc03002 November 2009
    When trying out the throttle tutorial I am unable to export the mesh to OpenFoam using "grid plus solver parameters"... I get the following error:

    boundary code 1 has not been properly defined

    file: openfoamcase.cpp
    line:310

    I suspect this has to do with an issue I encountered earlier... I was unable to combine boundaries 2,5,6, and 7 (as I do not know how).
    [attachment=0]Screenshot-1.png[/attachment]

    In addition I do not know what parameters to enter in the Tools>configure engrid section...
    [attachment=1]Screenshot.png[/attachment]

    Any advice would be most helpful.

    Output:

    Writing to "/home/bill/OpenFOAM/bill-1.6.x/run/tutorials/throttle/system/controlDict"
    Writing to "/home/bill/OpenFOAM/bill-1.6.x/run/tutorials/throttle/0/U"
    Writing to "/home/bill/OpenFOAM/bill-1.6.x/run/tutorials/throttle/0/p"
    Writing to "/home/bill/OpenFOAM/bill-1.6.x/run/tutorials/throttle/0/k"
    Writing to "/home/bill/OpenFOAM/bill-1.6.x/run/tutorials/throttle/0/epsilon"
    Writing to "/home/bill/OpenFOAM/bill-1.6.x/run/tutorials/throttle/0/omega"
    Writing to "/home/bill/OpenFOAM/bill-1.6.x/run/tutorials/throttle/constant/transportProperties"
    Writing to "/home/bill/OpenFOAM/bill-1.6.x/run/tutorials/throttle/constant/RASProperties"
    Writing to "/home/bill/OpenFOAM/bill-1.6.x/run/tutorials/throttle/system/fvSchemes"
    Writing to "/home/bill/OpenFOAM/bill-1.6.x/run/tutorials/throttle/system/fvSolution"
    :cry: Error Code prompt
    deleting Operation 0x9be4bf0
  • Oliver November 2009
    Hello,

    The tutorial is a bit outdated and it does not include the new OpenFOAM export features. Basically your error message means that you have specified a boundary type (most likely "patch") which hasn't been defined properly. It can be defined in the "Boundary Types" tab of the "edit boundary conditions" window. Alternatively you can export just the mesh; even with the combined export the mesh probably exported alright, despite the error message you got.

    If you have further problems we can try to answer them tomorrow -- there is nobody in the office at the moment.

    Regards,
    Oliver
  • wfc03002 November 2009

    "Oliver":

    Hello,

    The tutorial is a bit outdated and it does not include the new OpenFOAM export features. Basically your error message means that you have specified a boundary type (most likely "patch") which hasn't been defined properly. It can be defined in the "Boundary Types" tab of the "edit boundary conditions" window. Alternatively you can export just the mesh; even with the combined export the mesh probably exported alright, despite the error message you got.

    If you have further problems we can try to answer them tomorrow -- there is nobody in the office at the moment.

    Regards,
    Oliver


    As shown in my screenshot I have BC-type for BC-index 1 set to "wall" which is a valid BC according to http://www.opencfd.co.uk/openfoam/doc/boundaries.html#x24-1350005.2... I guess I was more interested in my second question regarding what parameters to enter in the Tools>configure engrid section (my second screenshot).
  • Mike November 2009
    enGrid uses tools like "fluentMeshToFoam", "reconstructPar" and "foamToVTK".
    It tries to find them in "OpenFOAM path"/applications/bin/"OpenFOAM architecture" using the corresponding values entered in "tools->configure".

    ex: If your OpenFOAM binaries are in "~/OpenFOAM/OpenFOAM-1.5/applications/bin/linux64GccDPOpt/", enter "linux64GccDPOpt" as architecture and "~/OpenFOAM/OpenFOAM-1.5" as path.

    As for the "boundary code 1 has not been properly defined" error, you need to define the boundary types in "simulation->edit boundary condition->boundary types".
    Any "BC-type" used in the "Boundary conditions" tab must be defined in the "Boundary types" tab for the OpenFOAM export (grid+solver parameters, not necessary to just export the grid) to work.

    ex:
    [attachment=1]foam1.png[/attachment]
    [attachment=0]foam2.png[/attachment]
  • wfc03002 November 2009
    Ahhh thank you very much... I now understand what Oliver was trying to tell me. I'm starting off a bit daft... but things are looking up.

    btw: Apologies to Oliver, I appreciate the help. :oops:
  • wfc03002 November 2009
    OK all is working very well now. I must say this is by far the best open-source mesh generation utility I have ever used.

    After I have exported the mesh using the "grid + solver parameters" and run the openFoam application checkMesh I find that I have several wrongOrientedFaces (amongst other issues), is there a way in Engrid to display only these faces so that I may attempt to fix the issue?

    Just in case you are interested here is the output from checkMesh...

    /*---------------------------------------------------------------------------*\
    | ========= | |
    | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
    | \\ / O peration | Version: 1.6.x |
    | \\ / A nd | Web: www.OpenFOAM.org |
    | \\/ M anipulation | |
    \*---------------------------------------------------------------------------*/
    Build : 1.6.x-ba8d951a9bfa
    Exec : checkMesh
    Date : Nov 29 2009
    Time : 11:50:38
    Host : CFD-1
    PID : 7473
    Case : /home/bill/OpenFOAM/bill-1.6.x/run/tutorials/throttle
    nProcs : 1
    SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).

    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
    Create time

    Create polyMesh for time = 0

    Time = 0

    Mesh stats
    points: 59823
    faces: 345542
    internal faces: 334226
    cells: 147950
    boundary patches: 7
    point zones: 0
    face zones: 0
    cell zones: 0

    Overall number of cells of each type:
    hexahedra: 12600
    prisms: 62768
    wedges: 0
    pyramids: 0
    tet wedges: 0
    tetrahedra: 72582
    polyhedra: 0

    Checking topology...
    Boundary definition OK.
    Point usage OK.
    Upper triangular ordering OK.
    Face vertices OK.
    Number of regions: 1 (OK).

    Checking patch topology for multiply connected surfaces ...
    Patch Faces Points Surface topology
    throttle 6336 3178 ok (non-closed singly connected)
    pipe 2192 1134 ok (non-closed singly connected)
    in 348 280 ok (non-closed singly connected)
    out 340 276 ok (non-closed singly connected)
    pipe 900 930 ok (non-closed singly connected)
    pipe 600 630 ok (non-closed singly connected)
    pipe 600 630 ok (non-closed singly connected)

    Checking geometry...
    Overall domain bounding box (-25 -550 -25) (25 74.863 550)
    Mesh (non-empty, non-wedge) directions (1 1 1)
    Mesh (non-empty) directions (1 1 1)
    Boundary openness (-1.17698e-18 -1.35166e-18 2.16844e-20) OK.
    ***High aspect ratio cells found, Max aspect ratio: 1053.86, number of cells 3
    <<Writing 3 cells with high aspect ratio to set highAspectRatioCells
    Minumum face area = 4.53078e-07. Maximum face area = 366.783. Face area magnitudes OK.
    Min volume = 1.4792e-07. Max volume = 898.736. Total volume = 2.19669e+06. Cell volumes OK.
    Mesh non-orthogonality Max: 89.9899 average: 12.4459
    *Number of severely non-orthogonal faces: 42.
    Non-orthogonality check OK.
    <<Writing 42 non-orthogonal faces to set nonOrthoFaces
    ***Error in face pyramids: 76 faces are incorrectly oriented.
    <<Writing 76 faces with incorrect orientation to set wrongOrientedFaces
    ***Max skewness = 6.8385, 31 highly skew faces detected which may impair the quality of the results
    <<Writing 31 skew faces to set skewFaces

    Failed 3 mesh checks.

    End
  • asolovyov June 2012
    Hello,
    I have same problem with tutorial "Error: Boundary code 1 has not been properly defined", but any patches defined in boundary conditions have been setted to boundary types. When I tried to export to OpenFOAM with solver parameters I get the error:

    boundary code 1 has not been properly defined
    file: ..\..\..\libengrid\openfoamcase.cpp
    line:310

    Please, tell me where I'm wrong. My grid file can be founded here:
    https://dl.dropbox.com/u/8700957/damper.zip
  • wyldckat June 2012
    Hi asolovyov,

    You're not the first person to confuse these definitions in enGrid ;)

    In the "Boundary types" tab you define a boundary name for each type you want to use. For example: my_special_patch
    In the "Boundary conditions" tab you define in the column "BC-type" you use the names you defined on the other tab. In other words, replace the default "patch" names defined in that column and replace with "my_special_patch" where you want to use it.

    So in your case, you have to define the same name twice in the "Boundary conditions" tab.

    Best regards,
    Bruno
  • atypicalguy September 2012
    Thanks Bruno this was very helpful.