CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Native Meshers: blockMesh

Making Loop inside Blockmesh: Help PLZ

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree3Likes
  • 1 Post By Yosmcer
  • 1 Post By Yosmcer
  • 1 Post By Yosmcer

Reply
 
LinkBack Thread Tools Display Modes
Old   July 28, 2013, 13:28
Default Making Loop inside Blockmesh: Help PLZ
  #1
psk
Member
 
david
Join Date: Jun 2013
Location: Montreal, Canada
Posts: 62
Rep Power: 4
psk is an unknown quantity at this point
Good Day Folks,



I am trying to draw my geometry (Using set of xyz coordinates) inside the blockMesh.I am trying to create loop inside the blockMesh.Is its possible? kindly give your feedback & suggestion about my queries.
__________________
Million Thanks,
David

"Small Dream is a Crime"
psk is offline   Reply With Quote

Old   July 29, 2013, 04:36
Default
  #2
Member
 
Yosmcer Mocktai
Join Date: Apr 2013
Location: Behind a computer
Posts: 47
Rep Power: 9
Yosmcer will become famous soon enough
I think you can make a loop on a script file that generate the blockmesh. That let you the choice of using the coding language you like and can be quite easy.
Yosmcer is offline   Reply With Quote

Old   July 29, 2013, 07:52
Default
  #3
psk
Member
 
david
Join Date: Jun 2013
Location: Montreal, Canada
Posts: 62
Rep Power: 4
psk is an unknown quantity at this point
Good Day Yosmcer,
you are correct, I have to write script file.I did small program in Matlab program to replicate my wing. I don't how to make loop inside or any suitable way according to you for create blockMesh.

Basically what I did is by using camera to capture wing motion by frame by frame, the output is .csv file format. If you see inside csv file, the 1st row gives first frame(xyz of point 1,2,3), 2nd row gives 2nd frame (xyz of point 1,2,3) similarly up to last.


Our OF folks suggest me few ways,
1).cylinder blockMesh from potentialFoam is suitable for importing the coordinates to make blockMesh

2.)write script file and import in blender for create blockMesh.

I am thinking by using these coordinates or script to make loop inside the blockMesh is somewhat easy to replicate the wing. Because I am new to blender & other programming language apart from matlab.

kindly see my attached image(wing), csv file & matlab program for your kind perusal. kindly help me, how I can built blockMesh?
__________________
Million Thanks,
David

"Small Dream is a Crime"

Last edited by psk; August 12, 2013 at 02:29.
psk is offline   Reply With Quote

Old   July 29, 2013, 15:49
Default
  #4
Member
 
Yosmcer Mocktai
Join Date: Apr 2013
Location: Behind a computer
Posts: 47
Rep Power: 9
Yosmcer will become famous soon enough
Oh, so you wants something moving (wing moving like the one of birds). I thought you wanted a loop to replicate several time the same object at different positions (row of tube etc).

I never done this type of computations.

Maybe this could help you:
http://www.openfoam.com/features/mesh-motion.php
http://openfoamwiki.net/index.php/HowTo_setting_up_dynamic_mesh_cases

And looking the examples in

$FOAM_TUTORIALS/incompressible/pimpleDyMFoam

Last edited by Yosmcer; July 29, 2013 at 17:15.
Yosmcer is offline   Reply With Quote

Old   July 30, 2013, 06:00
Default arc calcualtion
  #5
psk
Member
 
david
Join Date: Jun 2013
Location: Montreal, Canada
Posts: 62
Rep Power: 4
psk is an unknown quantity at this point
Thanks for your reply & information Yosmcer, its very challenging in OF.
Generally for meshing in OF I am using third party software. For this problem, I have to play with blockMesh.I have some basic doubts,I create rectangular domain (I took cavity an example). I want to join arc b/w 2 6 & 1 5. I go through manual I get confused.kindly guide me.
My blockMesh
convertToMeters 0.1;

vertices
(
(0 0 0) // vertex 0
(100 0 0) //vertex 1
(100 0 25) // vertex 2
(0 0 25) // vertex 3
(0 25 0) //vertex 4
(100 25 0) //vertex 5
(100 25 25) //vertex 6
(0 25 25) vertex 7
);

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

edges
(
arc 2 6 (???)
arc 1 5 (???)
);
__________________
Million Thanks,
David

"Small Dream is a Crime"
psk is offline   Reply With Quote

Old   July 30, 2013, 11:08
Default
  #6
Member
 
Yosmcer Mocktai
Join Date: Apr 2013
Location: Behind a computer
Posts: 47
Rep Power: 9
Yosmcer will become famous soon enough
Quote:
Originally Posted by psk View Post
I create rectangular domain (I took cavity an example). I want to join arc b/w 2 6 & 1 5.
When you create the block, the edge you are speaking is straight (like in cube, parallelepipeds, prisms, etc).

If you want the edge to be curved with circle arc, you need to use the arc feature.
(if you want a more general curve, you need to use the spline system).

A circle arc is entirely defined with 3 points.

arc A B (x y z)

means you want the edge between points A and B to be an arc of circle going threw the tree points [A, (x y z), B]. Where x, y and z are the Cartesian coordinates of the third point.

I hope it is more clear now. If you still needs help generating your mesh with blockMesh, maybe giving a simple draw of what you would like to have may help.
(Be aware that I currently do not know how the moving part should be drawn, I only made statics structures).
Depending of your needs, it may be useful to look on the side of snappyHexMesh.

If I do not respond, it may simply means I do not know how to help.
psk likes this.
Yosmcer is offline   Reply With Quote

Old   July 31, 2013, 02:48
Default
  #7
psk
Member
 
david
Join Date: Jun 2013
Location: Montreal, Canada
Posts: 62
Rep Power: 4
psk is an unknown quantity at this point
Good Day & Thanks Yosmcer,

I am taking about only static point only not moving.what you mention is correct and I just need the numbers, If you see the image the xyz coordinates of B(100 0 0) & C (100 50 0).I want to make arc b/w B & C, then what is the value for arc BC (x=?, y=?,z=?)
Attached Images
File Type: png Image.png (4.5 KB, 18 views)
__________________
Million Thanks,
David

"Small Dream is a Crime"
psk is offline   Reply With Quote

Old   July 31, 2013, 04:44
Default
  #8
Member
 
Yosmcer Mocktai
Join Date: Apr 2013
Location: Behind a computer
Posts: 47
Rep Power: 9
Yosmcer will become famous soon enough
It depends where you want the center of the circle to be (you take only one arc of this circle) and the side you want to have the arc to be (concave or convex).

I you want the center to be in the middle of BC (so in x=100, y = 25, z =0) and a convex shape, the arc can be:

arc B C (125 25 0)

(x = 100+25; y = 25; z = 0 as I took a radius of 25)

If you want the center to be at the center of the rectangle, you will have:

arc B C (105.901699437 25 0)

(x = 50+sqrt(25^2+50^2), y = 25, z =0 )

You just have to find a point where you want your circle to pass trow.
I took both point with y coordinate as 25 as it is more easy to calculate with right angles, but any other point of the same circle arc would have been good. The z coordinate is 0 as I decide the arc to be entirely in the z plane, but you may need to have something else.

Test the example to see what they do.

This could help defining and connecting two circular pipes using blockMesh .

If you still need help, draw (even by hand, or paint like software) the arc you would like.
psk likes this.

Last edited by Yosmcer; July 31, 2013 at 07:48.
Yosmcer is offline   Reply With Quote

Old   August 1, 2013, 03:12
Default
  #9
psk
Member
 
david
Join Date: Jun 2013
Location: Montreal, Canada
Posts: 62
Rep Power: 4
psk is an unknown quantity at this point
Good Day & Million Thanks Yosmcer,

Please don't mistaken me,I understand 2D case, but 3D I get completely confused for convex & concave especially on clockwise (+) & anticlockwise (-). Anyhow I try to understand that one, Kindly See the Image give me formula, something like this[{x = x1+y2/2+sqrt(z1^2+y1^2)}, y = {y1+x2/2}, z ={x2-y1/2} ] by using (x1,y1,z1) & (x2,y2,z2) for each case -->Top, Bottom, Left and Right. Please forgive me.

CONVEX ----->what is the formula
Top
arc fe (x=?,y=? z=?)

arc gh (x=?,y=? z=?)


Bottom

arc ab (x=?,y=? z=?)

arc dc (x=?,y=? z=?)

Left
arc ad (x=?,y=? z=?)

arc fg (x=?,y=? z=?)

Right

arc eh (x=?,y=? z=?)

arc bc (x=?,y=? z=?)

CONCAVE -----> what is the formula?
Top
arc fe (x=?,y=? z=?)

arc gh (x=?,y=? z=?)


Bottom

arc ab (x=?,y=? z=?)

arc dc (x=?,y=? z=?)

Left
arc ad (x=?,y=? z=?)

arc fg (x=?,y=? z=?)

Right

arc eh (x=?,y=? z=?)

arc bc (x=?,y=? z=?)
Attached Images
File Type: jpg IMAGE.jpg (20.0 KB, 21 views)
__________________
Million Thanks,
David

"Small Dream is a Crime"

Last edited by psk; August 1, 2013 at 04:31. Reason: forgot to add image
psk is offline   Reply With Quote

Old   August 2, 2013, 13:49
Default
  #10
Member
 
Yosmcer Mocktai
Join Date: Apr 2013
Location: Behind a computer
Posts: 47
Rep Power: 9
Yosmcer will become famous soon enough
Why do you want the arc instead of straight lines?

By two points can pass an infinite number of arc circles, since I do not know the utility of the arc in your case, I can't guess which one suits your needs.
Yosmcer is offline   Reply With Quote

Old   August 3, 2013, 01:01
Default
  #11
psk
Member
 
david
Join Date: Jun 2013
Location: Montreal, Canada
Posts: 62
Rep Power: 4
psk is an unknown quantity at this point
Thanks for reply Yosmcer, kindly see the Image for your kind perusal

Code:
vertices
(
 
    (0 0 0) //0
    (100 0 0) //1
    (100 0 25) //2
    (0 0 25) //3

    (0 50 0) //4
    (100 50 0) //5
    (100 50 25) //6
    (0 50 25) //7

);

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

);

edges
(
  arc 1 5 (125 25 0) 
  arc 2 6 (125 25 25)

);
Kindly give formula interms of (x1,y1,z1),(x2,y2,z2), (x5,y5,z5), (x6,y6,z6).
Attached Images
File Type: jpg Image.jpg (13.3 KB, 19 views)
__________________
Million Thanks,
David

"Small Dream is a Crime"
psk is offline   Reply With Quote

Old   August 8, 2013, 02:02
Default
  #12
Member
 
Yosmcer Mocktai
Join Date: Apr 2013
Location: Behind a computer
Posts: 47
Rep Power: 9
Yosmcer will become famous soon enough
You can find a possibility in the zip file.
the matlab file can generate some of the points (not all, I made the others by choosing the rights coordinates from the others).

There is plenty of possibilities.
Attached Files
File Type: zip psk.zip (6.3 KB, 12 views)
psk likes this.
Yosmcer is offline   Reply With Quote

Old   August 8, 2013, 06:19
Default
  #13
psk
Member
 
david
Join Date: Jun 2013
Location: Montreal, Canada
Posts: 62
Rep Power: 4
psk is an unknown quantity at this point
Many Many Thanks Yosmcer, It works well

Final question,

a) c15 = p4/2 + 3/4*p1 + p3/4; I am not able to understand this formula, Kindly let me know little brief.
__________________
Million Thanks,
David

"Small Dream is a Crime"
psk is offline   Reply With Quote

Old   August 29, 2013, 10:37
Default
  #14
Member
 
Yosmcer Mocktai
Join Date: Apr 2013
Location: Behind a computer
Posts: 47
Rep Power: 9
Yosmcer will become famous soon enough
Quote:
Originally Posted by psk View Post
Final question,

a) c15 = p4/2 + 3/4*p1 + p3/4; I am not able to understand this formula, Kindly let me know little brief.
Sorry for the delay, I didn't noticed the message.

I used vectorial formalism:

Origin of axis is point number 0 (not written in the code).

p4, p1 and p3 are vectors pointing to theses points.

c15 is the vector pointing to the centre of the arc circle I want passing by points 1 and 5.

To visualise what's happening, it is easier to have the hex with numbered points in view (so paraFoam -block to have it).
Yosmcer is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
OpenFOAM on MinGW crosscompiler hosted on Linux allenzhao OpenFOAM Installation 127 January 30, 2009 20:08
DxFoam reader update hjasak OpenFOAM Post-Processing 69 April 24, 2008 01:24
Errors running allwmake in OpenFOAM141dev with WM_COMPILE_OPTION%3ddebug unoder OpenFOAM Installation 11 January 30, 2008 21:30
HELPInstallation on RedHat90 booosix OpenFOAM Installation 8 July 17, 2007 06:40
DecomposePar links against liblamso0 with OpenMPI jens_klostermann OpenFOAM Bugs 11 June 28, 2007 17:51


All times are GMT -4. The time now is 07:27.