CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (http://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   Meshing a weird pipe (http://www.cfd-online.com/Forums/openfoam-meshing/88732-meshing-weird-pipe.html)

lazersos May 24, 2011 16:44

Meshing a weird pipe
 
2 Attachment(s)
I'd like to explore flow through a twisted pipe. Now I can readily output the coordinates of a series of nested surfaces in the pipe. I'd like to generate a 3D mesh for this coordinate system. I've thought about just constructing the points, faces, owners, boundary and neighbors files in my pre-processor but I got to the owners/neighbors part and realized that it was going to be a bit of a headache. Additionally, my deffinition of a pipe has an axial gridpoint which I believe could stand to be converted into a more cartesian mesh. Has anyone dealt with this problem. Thanks, I'm an openFOAM newbie.

PS- I've attached a plot of the points and the radial surfaces, there are ~100 radial surfaces, I've only chosen a few. Oh and I plan to have flow in one end and out the other.

lazersos May 25, 2011 12:47

Update
 
Ok so I figured it would be simplest to create a blockMeshDict file and let blockMesh take it from there. I tried to define my problem by specifying the points on the outboard, top, inboard and bottom of the shape then defining the edges using a polyMesh. Unfortuantely this doesn't seem to be working:

Code:

FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    object      blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //


convertToMeters    1.000000;


vertices
(
// Inlet (nv=0)
(4.124254 0.000000 0.000000)
(3.697167 0.000000 0.904083)
(3.357811 0.000000 0.277534)
(3.697167 0.000000 -0.904083)
// Outlet (nv=8)
(3.336592 2.424176 0.000000)
(2.991071 2.173140 0.904083)
(2.716526 1.973672 0.277534)
(2.991071 2.173140 -0.904083)
);


blocks
(
hex ( 0 1 2 3 4 5 6 7 ) ( 30 30 30 ) simpleGrading (10 10 10)
);


edges
(
// Inlet (nv=0)
polySpline 0 1
(
    ( 4.098676 0.000000 0.272565 )
    ( 4.027965 0.000000 0.519575 )
    ( 3.927305 0.000000 0.713843 )
    ( 3.812816 0.000000 0.845920 )
)
polySpline 1 2
(
    ( 3.591181 0.000000 0.864608 )
    ( 3.499359 0.000000 0.729783 )
    ( 3.419496 0.000000 0.527036 )
)
polySpline 2 3
(
    ( 3.333465 0.000000 0.000000 )
    ( 3.357811 0.000000 -0.277534 )
    ( 3.419496 0.000000 -0.527036 )
    ( 3.499359 0.000000 -0.729783 )
    ( 3.591181 0.000000 -0.864608 )
)
polySpline 3 0
(
    ( 3.812816 0.000000 -0.845920 )
    ( 3.927305 0.000000 -0.713843 )
    ( 4.027965 0.000000 -0.519575 )
    ( 4.098676 0.000000 -0.272565 )
)
// Outlet (nv=8)
polySpline 4 5
(
    ( 3.315899 2.409141 0.272565 )
    ( 3.258692 2.367579 0.519575 )
    ( 3.177257 2.308412 0.713843 )
    ( 3.084633 2.241117 0.845920 )
)
polySpline 5 6
(
    ( 2.905327 2.110843 0.864608 )
    ( 2.831041 2.056872 0.729783 )
    ( 2.766431 2.009929 0.527036 )
)
polySpline 6 7
(
    ( 2.696830 1.959361 0.000000 )
    ( 2.716526 1.973672 -0.277534 )
    ( 2.766431 2.009929 -0.527036 )
    ( 2.831041 2.056872 -0.729783 )
    ( 2.905327 2.110843 -0.864608 )
)
polySpline 7 4
(
    ( 3.084633 2.241117 -0.845920 )
    ( 3.177257 2.308412 -0.713843 )
    ( 3.258692 2.367579 -0.519575 )
    ( 3.315899 2.409141 -0.272565 )
)
// Outboard (nu=1)
polySpline 0 4
(
    ( 4.124254 0.000000 0.000000 )
    ( 4.175213 0.375776 -0.174579 )
    ( 4.277976 0.776338 -0.207229 )
    ( 4.330820 1.195230 -0.098508 )
    ( 4.206246 1.578631 0.098508 )
    ( 3.917275 1.886460 0.207229 )
    ( 3.598694 2.150119 0.174579 )
    ( 3.336592 2.424176 0.000000 )
)
// Top (nu=6)
polySpline 1 5
(
    ( 3.697167 0.000000 0.904083 )
    ( 3.498043 0.314830 0.809446 )
    ( 3.397586 0.616571 0.617582 )
    ( 3.430537 0.946768 0.450487 )
    ( 3.474680 1.304069 0.408822 )
    ( 3.485515 1.678536 0.527167 )
    ( 3.323857 1.985912 0.758950 )
    ( 2.991071 2.173140 0.904083 )
)
// Inboard (nu=10)
polySpline 2 6
(
    ( 3.357811 0.000000 0.277534 )
    ( 3.182222 0.286405 0.499018 )
    ( 2.882962 0.523181 0.477973 )
    ( 2.690070 0.742412 0.255634 )
    ( 2.673719 1.003464 -0.012463 )
    ( 2.770921 1.334405 -0.123277 )
    ( 2.828113 1.689719 -0.006381 )
    ( 2.716526 1.973672 0.277534 )
)
// Bottom (nu=16)
polySpline 3 7
(
    ( 3.697167 0.000000 -0.904083 )
    ( 3.856346 0.347077 -0.758950 )
    ( 3.806460 0.690771 -0.527167 )
    ( 3.577588 0.987351 -0.408822 )
    ( 3.331859 1.250467 -0.450487 )
    ( 3.111116 1.498235 -0.617582 )
    ( 3.015028 1.801395 -0.809446 )
    ( 2.991071 2.173140 -0.904083 )
)
);


patches
(
wall pipe_edge (
( 0 4 5 6)
( 1 5 6 2)
( 2 6 7 3)
( 3 7 4 0)
)

patch inlet (
( 0 1 2 3)
)

patch outlet (
( 4 5 6 7)
)

);

Which gives me:

Code:

:3409 blockMesh -case test
/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  1.7.1                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.com                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
Build  : 1.7.1-03e7e056c215
Exec  : blockMesh -case test
Date  : May 25 2011
Time  : 12:42:49
Host  : sunfire20.pppl.gov
PID    : 5270
Case  : ./test
nProcs : 1
SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).

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


Creating block mesh from
    "./test/constant/polyMesh/blockMeshDict"


Creating blockCorners

Creating curved edges

Creating blocks

Creating patches

Creating block mesh topology
--> FOAM Warning :
    From function cellModel::mag(const labelList&, const pointField&)
    in file meshes/meshShapes/cellModel/cellModel.C at line 128
    zero or negative pyramid volume: -0.303366 for face 0
--> FOAM Warning :
    From function cellModel::mag(const labelList&, const pointField&)
    in file meshes/meshShapes/cellModel/cellModel.C at line 128
    zero or negative pyramid volume: -0.205269 for face 1
--> FOAM Warning :
    From function cellModel::mag(const labelList&, const pointField&)
    in file meshes/meshShapes/cellModel/cellModel.C at line 128
    zero or negative pyramid volume: -0.257956 for face 2
--> FOAM Warning :
    From function cellModel::mag(const labelList&, const pointField&)
    in file meshes/meshShapes/cellModel/cellModel.C at line 128
    zero or negative pyramid volume: -0.246229 for face 3
--> FOAM Warning :
    From function cellModel::mag(const labelList&, const pointField&)
    in file meshes/meshShapes/cellModel/cellModel.C at line 128
    zero or negative pyramid volume: -0.25246 for face 4
--> FOAM Warning :
    From function cellModel::mag(const labelList&, const pointField&)
    in file meshes/meshShapes/cellModel/cellModel.C at line 128
    zero or negative pyramid volume: -0.252461 for face 5
--> FOAM Warning :
    From function blockMesh::createTopology(IOdictionary&)
    in file createTopology.C at line 397
    negative volume block : 0, probably defined inside-out

Default patch type set to empty


--> FOAM FATAL ERROR:
face 0 in patch 0 does not have neighbour cell face: 4(0 4 5 6)

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

FOAM aborting


lazersos May 25, 2011 13:29

OK fixed it. First my ordering of the initial gridpoints was wrong. I was ordering them in a counterclockwise fashion and that needed to be switch to clockwise (along with fixing an error in the points themselves). Then one of my wall patches was wrong. Now I just need to get paraview compiled on system to see if the resulting grid looks anything like what I want.


All times are GMT -4. The time now is 00:02.