Skip to content

wandadars/pipe_2d

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

This utility is a python script that generates simple meshes in the Plot3D format.

Supported grid types:
- half
- full
- 3d
- channel

Sample usage to generate a grid that has a boundary layer at y = 0:
python3 pipe_grid.py 9 9 2 1 1 5.0e-4 3.0e-6 0.1 half 

grid has:
9 points in the x direction
9 points in the y direction(boundary layer direction)
2 points in the z direction(single cell thick)
A length of 1
A height of 1
A width of 5.0e-4
An initial cell spacing of 3.0e-6
A final cell spacing(at y=1) of 0.1
"half" signifies that there is no boundary layer at y=1


Sample usage to generate a grid that has a boundary layer at y = 0 and y = 1:
python3 pipe_grid.py 11 11 11 4.0 1.0 0.01 1.0e-3 0.1 full 

grid has:
11 points in the x direction
21 points in the y direction(boundary layer direction), 2*11 -1(for overlapped middle point) 
11 points in the z direction
A length of 4
A width of 0.01(z direction)
A height of 1
An initial cell spacing of 1.0e-3
A final cell spacing(at y=0.5*H) of 0.1 (at the centerline of pipe)
"full" signifies that there is a boundary layer at y=H
This grid will be symmetric about y = 0.5H and have twice as many elements in the y direction.


Sample usage to generate a 3D cylindrical grid that has a boundary layer at the wall:
pipe_grid.py 11 11 11 0.1 1.0 4.0 1.0e-3 0.05 3d 

grid has:
11 points in the x direction
11 points in the radial direction(boundary layer direction)
11 points in the theta direction
Inner radius of 0.1
Outer radius of 1.0
A length of 4.0
An initial cell spacing of 1.0e-3
A final cell spacing of 0.05 (at the outer radius of pipe)
"3d" signifies that the output mesh will be a full cylinder mesh 

Note that the boundary layer can be grown from the inner cylinder or the outer cylinder by swapping the wall and centerline spacing values.
You can even grow boundary layers off both surfaces by using small spacings for both the wall and centerline values.
For uniform spacing in the y/radial direction, insert the keyword "uniform" just before the grid type:
python3 pipe_grid.py ... dhWall dhCenterline uniform half|full|3d
In uniform mode, dhWall/dhCenterline are ignored and the spacing is linear between the min/max bounds.

Sample usage to generate a uniform Cartesian channel mesh in the legacy 1DGrid style:
python3 channel_grid.py 81 65 2 0.0 0.2 -0.005 0.005 0.0 1.0e-4

grid has:
81 points in the x direction
65 points in the y direction
2 points in the z direction
x spanning [0.0, 0.2]
y spanning [-0.005, 0.005]
z spanning [0.0, 1.0e-4]

Equivalent explicit channel mode through pipe_grid.py:
python3 pipe_grid.py 81 65 2 0.0 0.2 -0.005 0.005 0.0 1.0e-4 channel

For a 2D channel grid that is one cell thick in z, set nK = 1 and give the plane location with zMin = zMax:
python3 channel_grid.py 81 65 1 0.0 0.2 -0.005 0.005 0.0 0.0

To generate a Loci VOG formatted grid use the following command:
plot3d2vog -m file     (the utility assumes the .grd suffix)

About

A simple mesh generator to create 2D planar grids with boundary layers

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages