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

[blockMesh] Making Loop inside Blockmesh

Register Blogs Community New Posts Updated Threads Search

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 28, 2013, 14:28
Default Making Loop inside Blockmesh
  #1
psk
Member
 
david
Join Date: Jun 2013
Location: Montreal, Canada
Posts: 62
Rep Power: 12
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, 05:36
Default
  #2
Member
 
Yosmcer Mocktai
Join Date: Apr 2013
Location: Behind a computer
Posts: 50
Rep Power: 17
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, 08:52
Default
  #3
psk
Member
 
david
Join Date: Jun 2013
Location: Montreal, Canada
Posts: 62
Rep Power: 12
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 03:29.
psk is offline   Reply With Quote

Old   July 29, 2013, 16:49
Default
  #4
Member
 
Yosmcer Mocktai
Join Date: Apr 2013
Location: Behind a computer
Posts: 50
Rep Power: 17
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 18:15.
Yosmcer is offline   Reply With Quote

Old   July 30, 2013, 07:00
Default arc calcualtion
  #5
psk
Member
 
david
Join Date: Jun 2013
Location: Montreal, Canada
Posts: 62
Rep Power: 12
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, 12:08
Default
  #6
Member
 
Yosmcer Mocktai
Join Date: Apr 2013
Location: Behind a computer
Posts: 50
Rep Power: 17
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, 03:48
Default
  #7
psk
Member
 
david
Join Date: Jun 2013
Location: Montreal, Canada
Posts: 62
Rep Power: 12
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, 29 views)
__________________
Million Thanks,
David

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

Old   July 31, 2013, 05:44
Default
  #8
Member
 
Yosmcer Mocktai
Join Date: Apr 2013
Location: Behind a computer
Posts: 50
Rep Power: 17
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 http://www.cfd-online.com/Forums/ope...tml#post442857 .

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 08:48.
Yosmcer is offline   Reply With Quote

Old   August 1, 2013, 04:12
Default
  #9
psk
Member
 
david
Join Date: Jun 2013
Location: Montreal, Canada
Posts: 62
Rep Power: 12
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, 36 views)
__________________
Million Thanks,
David

"Small Dream is a Crime"

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

Old   August 2, 2013, 14:49
Default
  #10
Member
 
Yosmcer Mocktai
Join Date: Apr 2013
Location: Behind a computer
Posts: 50
Rep Power: 17
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, 02:01
Default
  #11
psk
Member
 
david
Join Date: Jun 2013
Location: Montreal, Canada
Posts: 62
Rep Power: 12
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, 38 views)
__________________
Million Thanks,
David

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

Old   August 8, 2013, 03:02
Default
  #12
Member
 
Yosmcer Mocktai
Join Date: Apr 2013
Location: Behind a computer
Posts: 50
Rep Power: 17
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, 17 views)
psk likes this.
Yosmcer is offline   Reply With Quote

Old   August 8, 2013, 07:19
Default
  #13
psk
Member
 
david
Join Date: Jun 2013
Location: Montreal, Canada
Posts: 62
Rep Power: 12
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, 11:37
Default
  #14
Member
 
Yosmcer Mocktai
Join Date: Apr 2013
Location: Behind a computer
Posts: 50
Rep Power: 17
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


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
[swak4Foam] swak4foam for OpenFOAM 4.0 mnikku OpenFOAM Community Contributions 80 May 17, 2022 09:06
[swak4Foam] Installation Problem with OF 6 version Aurel OpenFOAM Community Contributions 14 November 18, 2020 17:18
blockMesh cube inside a cube Wien3 OpenFOAM Running, Solving & CFD 7 November 25, 2014 06:42
[swak4Foam] Error bulding swak4Foam sfigato OpenFOAM Community Contributions 18 August 22, 2013 13:41
for loop inside a cell_loop? MHDWill FLUENT 0 September 26, 2007 22:24


All times are GMT -4. The time now is 15:40.