CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Meshing & Mesh Conversion

[blockMesh] blockMeshDict for repeating geometry

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 2, 2013, 12:37
Default blockMeshDict for repeating geometry
  #1
New Member
 
Rama Prasad
Join Date: Apr 2013
Posts: 5
Rep Power: 13
rama261 is on a distinguished road
I am starting to use openFoam. I am trying to solve the flow in a pump suction sump. There are 20 pump suction pipes drawing water from the sump, all spaced equally apart in a line and all of the same diameter. There is a thin solid wall midway between each pair of adjacent pipes and all the walls are of identical size. So the vertices of the blocks are of the same pattern. If I write down the vertices for one bay, is there a simple method to generate vertices for the other 19 bays? Would be grateful for an answer
rama261 is offline   Reply With Quote

Old   July 20, 2013, 05:31
Default
  #2
Member
 
Yosmcer Mocktai
Join Date: Apr 2013
Location: Behind a computer
Posts: 50
Rep Power: 17
Yosmcer will become famous soon enough
A way to do it would be to use a m4 script that generate the blockMest file for you.

m4 is a macro processor under Linux systems.

I usually see it use with pearl for the calculations parts.

You can find some examples in the openFoam tutorials:
Code:
grep -r m4 $FOAM_TUTORIALS
You can define 'functions' that will make each operations you wants 20 time with the required space.

Example:
Code:
changecom(//)changequote([,]) dnl>
define(calc, [esyscmd(perl -E 'use Math::Trig; print ($1)')]) dnl>
define(VCOUNT, 0)
define(vlabel, [[// ]Vertex $1 = VCOUNT define($1, VCOUNT)define([VCOUNT], incr(VCOUNT))])

define(space, 10)

define(vertexb20, ($1    $2    $3)    vlabel(ba1$4)
($1    calc($2+space)    $3)    vlabel(ba2$4)
($1    calc($2+2*space)    $3)    vlabel(ba3$4)
($1    calc($2+3*space)    $3)    vlabel(ba4$4)
($1    calc($2+4*space)    $3)    vlabel(ba5$4)
($1    calc($2+5*space)    $3)    vlabel(ba6$4)
($1    calc($2+6*space)    $3)    vlabel(ba7$4)
($1    calc($2+7*space)    $3)    vlabel(ba8$4)
($1    calc($2+8*space)    $3)    vlabel(ba9$4)
($1    calc($2+9*space)    $3)    vlabel(ba10$4)
.
.
.
)
Of course take into consideration the possibility of symmetry to ease your work after.


Hope it is clear enough an that it helps.

(do not hesitate to suggest other ways that may be easiest).
Yosmcer is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[ICEM] Holes in complex ICEM geometry alecbann ANSYS Meshing & Geometry 2 April 4, 2019 04:40
[Workbench] Workbench 18.2 SpaceClaim->Mechanical geometry accuracy/tolerance problem sultzan ANSYS Meshing & Geometry 0 December 13, 2018 18:41
Export geometry file from ansys mechanical browns6 Structural Mechanics 0 August 27, 2013 17:19
Problem Importing Geometry ProE to CFX fatb0y CFX 3 January 14, 2012 20:42
2D geometry to 3D geometry Sgonzalezg ANSYS Meshing & Geometry 11 April 8, 2011 12:02


All times are GMT -4. The time now is 19:46.