
[Sponsors] 
July 28, 2013, 13:28 
Making Loop inside Blockmesh: Help PLZ

#1 
Member
david
Join Date: Jun 2013
Location: Montreal, Canada
Posts: 62
Rep Power: 3 
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" 

July 29, 2013, 04:36 

#2 
Member
Yosmcer Mocktai
Join Date: Apr 2013
Location: Behind a computer
Posts: 41
Rep Power: 8 
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.


July 29, 2013, 07:52 

#3 
Member
david
Join Date: Jun 2013
Location: Montreal, Canada
Posts: 62
Rep Power: 3 
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. 

July 29, 2013, 15:49 

#4 
Member
Yosmcer Mocktai
Join Date: Apr 2013
Location: Behind a computer
Posts: 41
Rep Power: 8 
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/meshmotion.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. 

July 30, 2013, 06:00 
arc calcualtion

#5 
Member
david
Join Date: Jun 2013
Location: Montreal, Canada
Posts: 62
Rep Power: 3 
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" 

July 30, 2013, 11:08 

#6  
Member
Yosmcer Mocktai
Join Date: Apr 2013
Location: Behind a computer
Posts: 41
Rep Power: 8 
Quote:
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. 

July 31, 2013, 02:48 

#7 
Member
david
Join Date: Jun 2013
Location: Montreal, Canada
Posts: 62
Rep Power: 3 
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=?)
__________________
Million Thanks, David "Small Dream is a Crime" 

July 31, 2013, 04:44 

#8 
Member
Yosmcer Mocktai
Join Date: Apr 2013
Location: Behind a computer
Posts: 41
Rep Power: 8 
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. Last edited by Yosmcer; July 31, 2013 at 07:48. 

August 1, 2013, 03:12 

#9 
Member
david
Join Date: Jun 2013
Location: Montreal, Canada
Posts: 62
Rep Power: 3 
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 ={x2y1/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=?)
__________________
Million Thanks, David "Small Dream is a Crime" Last edited by psk; August 1, 2013 at 04:31. Reason: forgot to add image 

August 2, 2013, 13:49 

#10 
Member
Yosmcer Mocktai
Join Date: Apr 2013
Location: Behind a computer
Posts: 41
Rep Power: 8 
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. 

August 3, 2013, 01:01 

#11 
Member
david
Join Date: Jun 2013
Location: Montreal, Canada
Posts: 62
Rep Power: 3 
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) );
__________________
Million Thanks, David "Small Dream is a Crime" 

August 8, 2013, 02:02 

#12 
Member
Yosmcer Mocktai
Join Date: Apr 2013
Location: Behind a computer
Posts: 41
Rep Power: 8 
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. 

August 8, 2013, 06:19 

#13 
Member
david
Join Date: Jun 2013
Location: Montreal, Canada
Posts: 62
Rep Power: 3 
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" 

August 29, 2013, 10:37 

#14  
Member
Yosmcer Mocktai
Join Date: Apr 2013
Location: Behind a computer
Posts: 41
Rep Power: 8 
Quote:
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). 

Thread Tools  
Display Modes  


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 PostProcessing  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 