CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (https://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   [Netgen] boundary conditions and mesh exporting (https://www.cfd-online.com/Forums/openfoam-meshing/76222-boundary-conditions-mesh-exporting.html)

vaina74 May 18, 2010 10:01

boundary conditions and mesh exporting
 
1 Attachment(s)
1. I imported a BREP geometry into NETGEN 4.9.12 and meshed it. Now I'd like to set boundary condition codes, but I'm groping for the solution. If i select Edit Surface Mesh Size I can highlight the patches. I made a note of them, becouse I don't know how to rename them. I used Salome to build the geometry, can I define the name of the patches by it? Well, for the present I note their index. After meshed the geometry, I guess I must select Edit Boundary Conditions and set an appropriate number for the bc property (a strangeness: when I pass through the face index, only one face is red-lighted - and not always the same one).

2. After setting bc, have I to export the mesh in neutral format and then launch NetgenNeutralToFoam? I don't find this command in the OpenFOAM user guide.

Please, help me with the correct procedure.

UPDATE

1. A bug prevent the rendering window to update surface colours according to the selected boundary face
2. I can't define boundary surfaces in Salome but I note the index that NETGEN assign to and set boundary codes in order to assemble the patches.
3. I tried to export the mesh and its boundary conditions in two different ways but it doesn't work:
a) I exported the mesh in OpenFOAM-1.5.x format but boundary file in polyMesh folder contains 6 patches (of 7 surfaces) and I expect 5 (I use OpenFOAM-1.6.x)
b) I exported the mesh in neutral format but I have an error when I run netgenNeutralToFoam (but the number of patches seem to be right)
Code:

giulia@giulia-laptop:~/OpenFOAM/giulia-1.6.x/run/blade$ netgenNeutralToFoam mesh/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  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-069803848c44
Exec  : netgenNeutralToFoam mesh
Date  : May 18 2010
Time  : 21:16:28
Host  : giulia-laptop
PID    : 2893
Case  : /home/giulia/OpenFOAM/giulia-1.6.x/run/blade
nProcs : 1
SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).

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

nNodes:119937
nTets:567616
nFaces:119096
--> FOAM Warning :
    From function netgenNeutralToFoam
    in file netgenNeutralToFoam.C at line 248
    There are boundary faces without attached cells.Boundary faces (as triFaces):
46
(
(24057 24058 3101)
(24293 23755 3003)
(24683 24466 3236)
(23476 23543 2909)
(24058 23756 2936)
(24360 24754 3101)
(24466 24682 3182)
(24903 24683 3236)
(24358 24360 24058)
(24466 24467 3236)
(24797 24798 3339)
(24308 24307 24293)
(23756 23543 2936)
(24361 24466 3182)
(23475 23476 2909)
(25410 25249 3236)
(24057 24308 3003)
(24293 24292 23755)
(24754 24801 24798)
(23755 24292 2909)
(23543 23755 2909)
(24058 24360 3101)
(24467 24466 24361)
(24361 24057 3101)
(23755 23756 3003)
(24798 24797 24467)
(24308 24361 3182)
(24798 24801 3339)
(23756 24057 3003)
(23756 23755 23543)
(23478 23475 2909)
(25249 24903 3236)
(24307 24308 3182)
(24754 24798 3101)
(24467 24797 3236)
(25604 25410 24797)
(25604 24797 3339)
(24308 24293 3003)
(24683 24682 24466)
(24058 24057 23756)
(24361 24308 24057)
(24797 25410 3236)
(24798 24467 3101)
(24292 23478 2909)
(24467 24361 3101)
(24358 24058 2936)
)

Patches:
    Neutral Boundary    Patch name    Size
    ----------------    ----------    ----
    0            patch0        2416
    1            patch1        103540
    2            patch2        8472
    3            patch3        2036
    4            patch4        2632



--> FOAM FATAL ERROR:
face 1770 in patch 1 does not have neighbour cell face: 3(23478 23475 2909)

    From function polyMesh::facePatchFaceCells(const faceList& patchFaces,const labelListList& pointCells,const faceListList& cellsFaceShapes,const label patchID)
    in file meshes/polyMesh/polyMeshFromShapeMesh.C at line 125.

FOAM aborting

#0  Foam::error::printStack(Foam::Ostream&) in "/home/giulia/OpenFOAM/OpenFOAM-1.6.x/lib/linuxGccDPOpt/libOpenFOAM.so"
#1  Foam::error::abort() in "/home/giulia/OpenFOAM/OpenFOAM-1.6.x/lib/linuxGccDPOpt/libOpenFOAM.so"
#2  Foam::Ostream& Foam::operator<< <Foam::error>(Foam::Ostream&, Foam::errorManip<Foam::error>) in "/home/giulia/OpenFOAM/OpenFOAM-1.6.x/applications/bin/linuxGccDPOpt/netgenNeutralToFoam"
#3  Foam::polyMesh::facePatchFaceCells(Foam::List<Foam::face> const&, Foam::List<Foam::List<int> > const&, Foam::List<Foam::List<Foam::face> > const&, int) const in "/home/giulia/OpenFOAM/OpenFOAM-1.6.x/lib/linuxGccDPOpt/libOpenFOAM.so"
#4  Foam::polyMesh::polyMesh(Foam::IOobject const&, Foam::Xfer<Foam::Field<Foam::Vector<double> > > const&, Foam::List<Foam::cellShape> const&, Foam::List<Foam::List<Foam::face> > const&, Foam::List<Foam::word> const&, Foam::List<Foam::word> const&, Foam::word const&, Foam::word const&, Foam::List<Foam::word> const&, bool) in "/home/giulia/OpenFOAM/OpenFOAM-1.6.x/lib/linuxGccDPOpt/libOpenFOAM.so"
#5 
 in "/home/giulia/OpenFOAM/OpenFOAM-1.6.x/applications/bin/linuxGccDPOpt/netgenNeutralToFoam"
#6  __libc_start_main in "/lib/tls/i686/cmov/libc.so.6"
#7 
 at /build/buildd/eglibc-2.10.1/csu/../sysdeps/i386/elf/start.S:122
Aborted

I attach the brep geometry (domain around a blade) and the boundary file (from OpenFOAM-1.5.x format exporting).

linnemann May 19, 2010 06:42

1 Attachment(s)
Hi

Looking at the geometry in Salome one thing comes to mind with my experience in generation of blade/propeller geometry.

Create it at least with two faces. You only have one face for the whole blade. split it so that you have two faces fused at the leading/trailing edge.

See the very simplified geometry attached. I've had meshing problems having only one face.

vaina74 May 27, 2010 09:38

OK, Linnemann was right. I partitioned the blade geometry and NETGEN mesh exporting (almost) works. In other words, I think that I experienced two bugs about boundary conditions editing. I use NETGEN 4.9.12 on Ubuntu 10.04 LTS.

1. Only one patch is highlighted when I select it in the Edit Boundary Conditions menu (the similar Edit Face Mesh Size works!).

2. I bypass the above bug noting the matching index number - face, so I can build boundary patches from solid faces. But when I export the mesh to OpenFOAM (in OpenFOAM 1.5+ or neutral format), the matching index-patch changes (only for two faces) - I checked it out by ParaView.

Are these NETGEN or OpenFOAM troubles? How can I bypass the bugs (a different exporting format or other tricks)?
I exported a NETGEN 2D- mesh in Gmsh2 format for enGrid and I created a 3D-mesh with a boundary layer (and conversion to OpenFOAM works), but I'd like to generate a 3D-mesh in NETGEN and export it to OpenFOAM without problems.


All times are GMT -4. The time now is 21:31.