|
[Sponsors] |
August 1, 2013, 09:38 |
set of xyz data in blockMesh
|
#1 |
Member
david
Join Date: Jun 2013
Location: Montreal, Canada
Posts: 62
Rep Power: 12 |
Good Day Folks,
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. I did small program in Matlab program to replicate my wing. I don't how to make loop inside or any suitable way for create blockMesh. 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:27. |
|
August 1, 2013, 17:39 |
|
#2 | |
Senior Member
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,267
Blog Entries: 1
Rep Power: 25 |
you can repeat coordinate using codeStream,look at following tutorials
Quote:
Code:
vertices #codeStream { codeInclude #{ #include "pointField.H" #}; code #{ pointField points(19); points[0] = point(0.5, 0, -0.5); points[1] = point(1, 0, -0.5); points[2] = point(2, 0, -0.5); points[3] = point(2, 0.707107, -0.5); points[4] = point(0.707107, 0.707107, -0.5); points[5] = point(0.353553, 0.353553, -0.5); points[6] = point(2, 2, -0.5); points[7] = point(0.707107, 2, -0.5); points[8] = point(0, 2, -0.5); points[9] = point(0, 1, -0.5); points[10] = point(0, 0.5, -0.5); points[11] = point(-0.5, 0, -0.5); points[12] = point(-1, 0, -0.5); points[13] = point(-2, 0, -0.5); points[14] = point(-2, 0.707107, -0.5); points[15] = point(-0.707107, 0.707107, -0.5); points[16] = point(-0.353553, 0.353553, -0.5); points[17] = point(-2, 2, -0.5); points[18] = point(-0.707107, 2, -0.5); // Duplicate z points label sz = points.size(); points.setSize(2*sz); for (label i = 0; i < sz; i++) { const point& pt = points[i]; points[i+sz] = point(pt.x(), pt.y(), -pt.z()); } os << points; #}; };
__________________
My Personal Website (http://nimasamkhaniani.ir/) Telegram channel (https://t.me/cfd_foam) |
||
August 2, 2013, 03:52 |
|
#3 |
Member
david
Join Date: Jun 2013
Location: Montreal, Canada
Posts: 62
Rep Power: 12 |
Many thanks for your reply & information Nima Sam,
1). You are correct, cylinder tutorial is good for this case. Please see the attached zip file for your kind persual. I edit blockMeshDict, I hope I have to correct something. kindly guide me. 2). I already try to run cylinder tutorial, but I am not successful on that, I run potentialFoam it shows error, take a look [ http://www.cfd-online.com/Forums/ope...tml#post441524 ]. I didn't understand how it works. Please help me
__________________
Million Thanks, David "Small Dream is a Crime" Last edited by psk; August 12, 2013 at 03:27. Reason: Forgot to add Zip file |
|
August 7, 2013, 05:18 |
|
#4 |
Member
david
Join Date: Jun 2013
Location: Montreal, Canada
Posts: 62
Rep Power: 12 |
Good Day Nima sam,
I hope you see my blockMeshDict, Kindly guide me what I have to do? give your feedback.
__________________
Million Thanks, David "Small Dream is a Crime" |
|
August 7, 2013, 10:23 |
|
#5 |
Senior Member
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,267
Blog Entries: 1
Rep Power: 25 |
Dear David
i dont have time to check your blockMeshDict, but a fast look in it i feel you should write appropriate program, in fact, codeStream gives this chance to write a run-time compilable program. Hint: check your syntax and the program you write
__________________
My Personal Website (http://nimasamkhaniani.ir/) Telegram channel (https://t.me/cfd_foam) |
|
August 7, 2013, 14:43 |
|
#6 |
Member
david
Join Date: Jun 2013
Location: Montreal, Canada
Posts: 62
Rep Power: 12 |
Many Thanks for your reply & Information NimaSam, Apolozie for disturbing you, Here I post my blockMesh & also see my attached csv file & matlab script. kindly help me, I am looking for only meshing.
Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.1.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object blockMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // convertToMeters 1; vertices #codeStream { codeInclude #{ #include "pointField.H" #}; code #{ pointField points(24); // 1 to 24 points[1] = point(11.03188, 3.534115, 6.404323); points[2] = point(3.190682, 4.892467, 5.764356); points[3] = point(9.559749, -5.47123, 2.317475); /// The above xyz points are corresponding to pt1(xyz), pt2(xyz), pt3(xyz) for 1st frame points[4] = point(10.96441, 3.571152, 6.276311); points[5] = point(3.116855, 4.871729, 5.870568); points[6] = point(9.643979, -5.58868, 3.602635); /// The above xyz points are corresponding to pt1(xyz), pt2(xyz), pt3(xyz) for 2nd frame points[7] = point(10.89945, 3.532348, 6.343315); points[8] = point(3.389355, 4.850251, 5.801583); points[9] = point(8.287025, -4.58698, 11.05406); /// The above xyz points are corresponding to pt1(xyz), pt2(xyz), pt3(xyz) for 3rd frame points[10] = point(10.89958, 3.532292, 6.343871); points[11] = point(3.389355, 4.850251, 5.801583); points[12] = point(8.331151, -5.00143, 10.40822); /// The above xyz points are corresponding to pt1(xyz) ,pt2(xyz), pt3(xyz) for 4th frame points[13] = point(10.8994, 3.533178, 6.338943); points[14] = point(3.389355, 4.850251, 5.801583); points[15] = point(8.349275, -5.27453 9.506363); /// The above xyz points are corresponding to pt1(xyz), pt2(xyz), pt3(xyz) for 5th frame points[16] = point(10.88493, 3.587584, 6.315026); points[17] = point(3.179451, 4.973716, 5.81553); points[18] = point(9.157894, -1.23074, -1.43747); /// The above xyz points are corresponding to pt1(xyz), pt2(xyz), pt3(xyz) for 6th frame points[19] = point(10.88638, 3.59006, 6.305255); points[20] = point(3.25526, 4.992905, 5.931494); points[21] = point(9.567679, -2.77394, -0.66752); /// The above xyz points are corresponding to pt1(xyz), pt2(xyz), pt3(xyz) for 7th frame points[22] = point(10.88564, 3.590991, 6.298537); points[23] = point(3.199731, 4.965945, 5.914939); points[24] = point(9.154611, -2.72368, 0.472577); /// The above xyz points are corresponding to pt1(xyz), pt2(xyz), pt3(xyz) for 8th frame ---------------------------->upto this I import my xyz data, Kindly see my csv file for your perusal. edges ---------------------> Here I start to draw my geometry ( ///First Frame line 1 2 (-7.841198 1.358352 -0.639967) // subtract (2-1) line 2 3 (6.369067 -0.578763 -3.446881) // subtract (3-2) ///second Frame line 4 5 ( -7.847555 1.300577 -0.405743) // subtract (5-4) line 5 6 (6.527124 -10.460409 -2.267933) // subtract (6-5) ///third Frame line 7 8 (-7.510095 1.317903 -0.541732) // subtract (8-7) line 8 9 (4.89767 -9.437231 5.252477) // subtract (9-8) ///fourth Frame line 10 11 (-7.510225 1.317959 -0.542288) // subtract (11-10) line 11 12 (4.941796 -9.851681 4.606637) // subtract (12-11) ///fifth Frame line 13 14 (-7.510045 1.317073 -0.53736) // subtract (14-13) line 14 15 (4.95992 -10.124781 3.70478) // subtract (15-14) ///sixth Frame line 16 17 (-7.705479 1.386132 -0.499496) // subtract (17-16) line 17 18 (5.978443 -6.204456 -7.253) // subtract (18-17) ///seventh Frame line 19 20 (-7.63112 1.402845 -0.373761) // subtract (20-19) line 20 21(6.312419 -7.766845 -6.599014) // subtract (21-20) ///Eighth Frame line 22 23 (-7685909 1.374954 -0.383598) // subtract (23-22) line 23 24 (5.95488 -7.689625 -5.442362) // subtract (24-23) ); // Duplicate z points label sz = points.size(); points.setSize(2*sz); for (label i = 0; i < sz; i++) { const point& pt = points[i]; points[i+sz] = point(pt.x(), pt.y(), -pt.z()); } os << points; #}; };
__________________
Million Thanks, David "Small Dream is a Crime" Last edited by wyldckat; August 18, 2013 at 08:55. Reason: Added [CODE][/CODE] |
|
August 8, 2013, 04:58 |
|
#7 | |
Senior Member
Roman Thiele
Join Date: Aug 2009
Location: Eindhoven, NL
Posts: 374
Rep Power: 21 |
Quote:
__________________
~roman |
||
August 8, 2013, 12:44 |
|
#8 | |
Member
david
Join Date: Jun 2013
Location: Montreal, Canada
Posts: 62
Rep Power: 12 |
Quote:
Again it gives the same error, please post your feedback in this link [http://www.cfd-online.com/Forums/ope...ml#post441524], kindly help me
__________________
Million Thanks, David "Small Dream is a Crime" |
||
August 18, 2013, 10:32 |
|
#9 | |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Greetings to all!
@David: Quote:
As for the "blockMeshDict":
And I know I've said this before to you: start working with a simple geometry! Then gradually increase the level of complexity. Otherwise it will be very complicated to help you, as has happened in this case. Since there are 24 points, I'm not going to spend time figuring out what point is where! Specially since you took down the CSV attachement Last but not least, to other forum readers, the following thread is also related to this same topic, which David created some time ago as well, but he is trying to address the same issue in another form: www.cfd-online.com/Forums/openfoam-meshing-blockmesh/121421-making-loop-inside-blockmesh-help-plz.html Best regards, Bruno
__________________
|
||
August 19, 2013, 04:54 |
|
#10 |
Member
david
Join Date: Jun 2013
Location: Montreal, Canada
Posts: 62
Rep Power: 12 |
Good Day Bruno,
I hope you fine, Many Thanks for coming. last couple of weeks, I try two way for Making blockMeshDict, a) Convert matlab script to python script (I am new to python that's why I convert using this link : [ http://ompclib.appspot.com/m2py ] I hope there is some mistake in converted python script)then import in blender to make blockMeshDict-------> suggested by elvis b) Another one is your suggestion, I edit blockMeshDict with including external domain. Kindly see the attached file for your kind perusal and also please give your suggestion about converted python script ( I am newbie)
__________________
Million Thanks, David "Small Dream is a Crime" Last edited by psk; September 5, 2013 at 12:57. |
|
August 20, 2013, 03:07 |
|
#11 |
Member
david
Join Date: Jun 2013
Location: Montreal, Canada
Posts: 62
Rep Power: 12 |
Good Day Bruno,
Kindly see my above post and guide me.
__________________
Million Thanks, David "Small Dream is a Crime" |
|
August 25, 2013, 10:14 |
|
#12 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Hi David,
I finally managed to look into this. OK, my suggestions from this point onwards are:
Best regards, Bruno
__________________
|
|
August 27, 2013, 09:37 |
|
#13 |
Member
david
Join Date: Jun 2013
Location: Montreal, Canada
Posts: 62
Rep Power: 12 |
Many thanks bruno, apologize for late reply,First of all I have to go through thoroughly block Mesh concept and then I will let you. I hope it works for this case.
Have a nice day
__________________
Million Thanks, David "Small Dream is a Crime" |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Commercial meshers] fluentMeshToFoam multidomain mesh conversion problem | Attesz | OpenFOAM Meshing & Mesh Conversion | 12 | May 2, 2013 11:52 |
OF 1.6 | Ubuntu 9.10 (64bit) | GLIBCXX_3.4.11 not found | piprus | OpenFOAM Installation | 22 | February 25, 2010 14:43 |
XYZ (ASCII format) data points into GAMBIT | Neil | FLUENT | 1 | August 7, 2007 10:24 |
Env variable not set | gruber2 | OpenFOAM Installation | 5 | December 30, 2005 05:27 |
How to set environment variables | kanishka | OpenFOAM Installation | 1 | September 4, 2005 11:15 |