CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Meshing a pipe (https://www.cfd-online.com/Forums/openfoam/88316-meshing-pipe.html)

mikemech May 13, 2011 11:39

Meshing a pipe
 
Hello. I am trying to simulate the flow in a heat exchanger like the one that you can see here: https://docs.google.com/viewer?a=v&p...thkey=CNSL76UH

The problem is that i don't know how to create the corresponding mesh. I was trying to do that with the blockMesh tool but it's too complicated and I always get errors :(

If anybody has dealt with a problem like that, I would appreciate some advice!

linnemann May 13, 2011 15:29

Hello

Take a look here.

http://www.salome-platform.org/user-...edf-exercise-4

That should solve your question.

mikemech May 13, 2011 16:59

Well, salome is a program with gui, and tools that help you generate mesh automatically, while OenFoam uses geometry blocks. Is there a way I can import the geometry and
its corresponding mesh in openFoam, having created them in another program? Otherwise, i dont't understand how this tutorial would help me :S

elvis May 14, 2011 01:49

Hi,

ideasUnvToFoam will do the job for you.

have a look at http://www.caelinux.org/wiki/downloa...7/PipeMesh.htm video meshing with salome 3.2.6 and foamX is not in OF anymore ;-), it is a good start
syntax for ideasUnvToFoam little different today to what video shows


http://www.caelinux.org/wiki/index.p...ELinux_2007.29

bhh May 14, 2011 03:31

Hi,

Discretizer migth be an option for you, see http://www.discretizer.org/

rgds
Bjorn

basilwatson May 15, 2011 11:24

Just done the same thing, a nice fella called Martin helped

My work flow was:.... draw a solid pipe in CAD

export as STEP
import to salome and set up faces and mesh etc ( caelinux has a tutorial called pipe)

export to UNV

then in the openFOAM terminal

cd to your case directory

ideasUnvToFoam name.unv

checkMesh

Run case ( icoFoam etc)

foamToVTK

ParaView .....

my problem was with the courant number ( time) and a tweak to the FVsolutions card )

Least that worked for me

I use CAElinux 64 bit ubuntu based

Hope this was of some help

Stephen

wouter May 15, 2011 12:40

one more step
 
hello All,

I use salome for the complete drawing and meshing. In my experience you need a step before running the case namely edit the boundary conditions
I mostly need to change patch to wall, for the wall patches.

Hope this adds something
Wouter

Logan Page May 15, 2011 12:57

1 Attachment(s)
Hi

I'm partial to gmsh. Very powerful little mesher.

see attached example for a pipe.

> gmsh -3 Pipe.geo
> gmshToFoam Pipe.msh

only down side is you have to manually edit the constant/polyMesh/boundary file with the patch types you assign for you boundary conditions.

Goutam March 1, 2012 10:47

Drawing a Pipe problem
 
I am new user of openFOAM.

I want to draw a pipe of length of 1 meter with diameter 1 meter using blockMesh. How I will do it? Could you please share a blockMeshDict file?

romant March 2, 2012 03:12

1 Attachment(s)
Quote:

Originally Posted by Goutam (Post 347107)
I am new user of openFOAM.

I want to draw a pipe of length of 1 meter with diameter 1 meter using blockMesh. How I will do it? Could you please share a blockMeshDict file?

Hej,

I still had a mesh with double grading in my repository somewhere. It is attached. I hope it helps.

Goutam March 4, 2012 14:03

Quote:

Originally Posted by romant (Post 347236)
Hej,

I still had a mesh with double grading in my repository somewhere. It is attached. I hope it helps.

Thanks Roman,

I saw this geometry. Its great. But I didn't understand how you wrote the blockMesh file. Could you please explain me, how you wrote this?

First of all, you wrote 8 points, it means length of x and y is 0.02 m respectively, and length of z is 0.18 m. Am I right?

Then next 8 points, what you did?

I am considering a simple pipe of 10 m with radius 1 m for inlet and outlet. Your one is ok for me but I want to understand the basic of the blockMesh file that you created.

Thanks for your help.

romant March 5, 2012 01:49

Quote:

Originally Posted by Goutam (Post 347581)
Thanks Roman,

I saw this geometry. Its great. But I didn't understand how you wrote the blockMesh file. Could you please explain me, how you wrote this?

First of all, you wrote 8 points, it means length of x and y is 0.02 m respectively, and length of z is 0.18 m. Am I right?

Then next 8 points, what you did?

I am considering a simple pipe of 10 m with radius 1 m for inlet and outlet. Your one is ok for me but I want to understand the basic of the blockMesh file that you created.

Thanks for your help.

Note: I made a mistake in the description, it is not double graded, but just a normal pipe with grading towards the outer wall.


If you take a look at the blocks part you can see that I desribe which parts I create in which ordere, where the point numbers correspond to the numbers in the vertices section.

At first a normal block is created in the center, and then block that sit around this one. The outer block have edged which are defined as arcs instead of straight lines, so that they create a round x-y plane.

if you run
Code:

paraFoam -block
you can see the points which i define in space. Switching from "outline" to for example "wireframe" or "surface with edges", will show you also the arcs which are defined between the outer rim points.

Goutam March 5, 2012 11:54

Dear Romant,

Thanks for your details description.
I have another ques: How to calculate the points for arc boundary?

arc 8 9 (diagouter diagouter 0)

how you calculate that point?

You define diagOuter 21.213, diagOuterNeg -21.213. How?

I understood others settings.

Thanks again for your time.

romant March 5, 2012 11:57

Quote:

Originally Posted by Goutam (Post 347752)
Dear Romant,

Thanks for your details description.
I have another ques: How to calculate the points for arc boundary?

arc 8 9 (diagouter diagouter 0)

how you calculate that point?

You define diagOuter 21.213, diagOuterNeg -21.213. How?

I understood others settings.

Thanks again for your time.

They are just in a 45deg angle from the point with the radius that is used for the other points. I define the normal points to be exactly on the x and y axis and the arc points, which need to be defined between those points i define to be exactly in between.

Goutam March 7, 2012 06:56

Quote:

Originally Posted by romant (Post 347753)
They are just in a 45deg angle from the point with the radius that is used for the other points. I define the normal points to be exactly on the x and y axis and the arc points, which need to be defined between those points i define to be exactly in between.

Thanks for your cordial help.

I understood the blockMesh file clearly. When I use checkMesh command:

Create polyMesh for time = 0

Time = 0

Mesh stats
points: 136161
faces: 400100
internal faces: 391900
cells: 132000
boundary patches: 3
point zones: 0
face zones: 0
cell zones: 1

Overall number of cells of each type:
hexahedra: 132000
prisms: 0
wedges: 0
pyramids: 0
tet wedges: 0
tetrahedra: 0
polyhedra: 0

Checking topology...
Boundary definition OK.
Cell to face addressing 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
Walls 1600 1640 ok (non-closed singly connected)
inlet 3300 3321 ok (non-closed singly connected)
outlet 3300 3321 ok (non-closed singly connected)

Checking geometry...
Overall domain bounding box (-0.02595 -0.02595 0) (0.02595 0.02595 1.2)
Mesh (non-empty, non-wedge) directions (1 1 1)
Mesh (non-empty) directions (1 1 1)
Boundary openness (-1.86565e-16 8.61985e-18 -7.27923e-17) OK.
***High aspect ratio cells found, Max aspect ratio: 4095.21, number of cells 33280
<<Writing 33280 cells with high aspect ratio to set highAspectRatioCells
Minumum face area = 2.9739e-08. Maximum face area = 0.000122163. Face area magnitudes OK.
Min volume = 8.92169e-10. Max volume = 1.52642e-07. Total volume = 0.00252834. Cell volumes OK.
Mesh non-orthogonality Max: 34.8018 average: 4.32731
Non-orthogonality check OK.
Face pyramids OK.
Max skewness = 2.33588 OK.
Coupled point location match (average 0) OK.

Failed 1 mesh checks.

End

What I will do now? Do I ignore this and continue my work?

romant March 8, 2012 03:12

Quote:

Originally Posted by Goutam (Post 348122)
Thanks for your cordial help.

I understood the blockMesh file clearly. When I use checkMesh command:

Create polyMesh for time = 0

Time = 0

Mesh stats
points: 136161
faces: 400100
internal faces: 391900
cells: 132000
boundary patches: 3
point zones: 0
face zones: 0
cell zones: 1

Overall number of cells of each type:
hexahedra: 132000
prisms: 0
wedges: 0
pyramids: 0
tet wedges: 0
tetrahedra: 0
polyhedra: 0

Checking topology...
Boundary definition OK.
Cell to face addressing 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
Walls 1600 1640 ok (non-closed singly connected)
inlet 3300 3321 ok (non-closed singly connected)
outlet 3300 3321 ok (non-closed singly connected)

Checking geometry...
Overall domain bounding box (-0.02595 -0.02595 0) (0.02595 0.02595 1.2)
Mesh (non-empty, non-wedge) directions (1 1 1)
Mesh (non-empty) directions (1 1 1)
Boundary openness (-1.86565e-16 8.61985e-18 -7.27923e-17) OK.
***High aspect ratio cells found, Max aspect ratio: 4095.21, number of cells 33280
<<Writing 33280 cells with high aspect ratio to set highAspectRatioCells
Minumum face area = 2.9739e-08. Maximum face area = 0.000122163. Face area magnitudes OK.
Min volume = 8.92169e-10. Max volume = 1.52642e-07. Total volume = 0.00252834. Cell volumes OK.
Mesh non-orthogonality Max: 34.8018 average: 4.32731
Non-orthogonality check OK.
Face pyramids OK.
Max skewness = 2.33588 OK.
Coupled point location match (average 0) OK.

Failed 1 mesh checks.

End

What I will do now? Do I ignore this and continue my work?

It depends on the kind of computations that you want to perform. For RANS calculations you can have aspect ratios that are higher (I still wouldn't go higher than about 1000 in the direction of the flow direction). For LES calculations, I would not go higher than about 100 or 50.

You can get rid of these high aspect ratios by checking where they occur. Use paraFoam for this and enable to see sets, which will then give you the option to view this set of high aspect ratio cells. After identifying the cells, change the number of cells in the directions. For this check the file pipeDefinition.

Code:

// define the pipe geometry
// ----SIZING-------------------------------------------------------------------
// all measurement must be given in [mm]
lengthZ 180;


// ----MESHING------------------------------------------------------------------
radialCells 80; // cells in the radial direction from center piller
tangentialCells 7; // angular cell counter per quarter and square of central piller
verticalCells 40; // vertical cell count from inlet to outlet
meshGrad    1.25e-2; // mesh gradient towards the outer edge and outer edge of the piller

Play with the values and you will see that the high aspect ratio cells become less. Or change the gradients.


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