Idiot's guide

Help
2006-01-25
2013-04-09
  • Hi All,

    Apologies to draw this forum backwards but I need help. Desperately.

    I'm an engineer and occasionally design diffusers and manifolds. Until now i've always used proprietary programs but was thinking of using OpenFlower to carry out hydrodynamic analysis.

    Problem is i dont have any C++ training AT ALL. I've been able to instal OpenFlower but cant get the GUI to instal. I tried using gmsh (can i use OF as the solver in gmsh GUI??). and i can create the .msh file but cant run analysis in OF. what are the instructions to use?

    Basically i'd appreciate it if someone could send me step-by-step instructions for installing and using OF solver and GUI, and using OF in gmsh.

    I use Windows XP at work and ME at home. If it would be too much could you please email it to my private email: slimms1976@aol.com

    Thanks.

    slimms

     
    • Hey!

      I'm glad there is someone else interested out there.
      I started two or three months ago. I am working on a n idiots guide. It says nothing about the code involved,it just tells you step by step how to set up a problem on gmsh and then how to make a .flw file to run it on OF. I still have many questions on  some specific errors that I find some times. Nothing related to OF, but to GMSH meshing and problem set up. I'll send it to you when I get home. I've submited it to the team here, but I don't know if it is of posting quality yet.

      Basically, you will have a geometry file where you specify geometry and boundary condition locations. Also you specify characteristic length modifiers that will make it denser in some places. You use this .geo to create a .msh file.  then you write a .flw file. This one file holds all the information about time step, fluid properties, values of boundary condition properties. you can write equations descriving inlet velocity or outlet pressure.

      OF has three problem types. It solves flow , and difusion problems. The developers are working on adding other functionality so you can solve flow and heat at the same time. Right now you can only solve them separatelly.

      One thing that GMSH can do is to import .stl files from progs like Pro/e. It however does not seem to be able to export a .geo directly from a .stl. All you get are points that you can then use to create parametric geometry from scratch. So there is big potencial if GMSH can jump to that level of being able to import directly from Pro/e or you fav CAD system through .stl.

      overall, I think that OF has lots of potential. Its tedious to work with at the begining, but once  you get the hang of it, you can do some neat stuff. So far I've used it to do preliminary flow analysis on some electronic enclosures. I then outsorced to job to profesionals when I had a flow that worked on OF.

       
    • Thanks for your email. I use StarOffice at home so that's no problem ...

      Slimms

       
    • have you tried it yet? 

      There are some parts about the software that only make sense when one does it on a piece of paper. That or just think about it for more than the second when you get the error n<m+bj or what ever that  is.

      For example, the lines forming a surface have to point in one direction like vectors around the perimeter, arrow to tail. if one line in a line loop is backwards then you get a gmsh error for it. But it makes some sense in terms of organizing  the numbers mathematically. I think the same is true for surfaces. they must have their vectors matching the direction of the next nighbor. or maybe they have to match the clockwise or counterclocwise direction so the normals are pointing in or out. I'm not sure, but for some reason when I build something a little complicated and I do it by hand and not on the GUI, it tends to not work. I follow the line loop directions, but maybe surfaces also have a direction.

      Also I think that is is an OpenFlower thing, Other programs might read the mesh differently or might have checks for this kind of error that then fix the mesh and produce no errors. At this point, I need to figure out why that error apears. I already know where the error line messege and correspoding code is at in the source code, but I have to do an example to debug and figure out what I'm doing wrong.

      Fonss

       
    • Hi Fonss

      Sorry i havent been on here in a while. This is breath-taking!! Thanks a lot dude, this really works!!

      I've been able to create some simple piped systems and yes it helps to "sketch" the geomety on paper first. I dont know how realistic this will be for more complex geos. I realised that extruding lines to form a surface they need to face the same direction in GMSH, so it appears better to use the GMSH procedure to build geometries (what's your take?).

      I'm now trying something a bit more complex ... but maybe not for you :-) (a manifold with main tube body and exits at various points along the main pipe). I did an outfall recently and was wondering whether i could have used CFD to better position the outlet ports.

      Thanks a lot again for your help.

      Slimms

       
    • Hi,

      Thanks it does work ... tried to post to the forum earlier but it didnt get thru. Hope this does.

      I have been able to create simple geometries and run basic simulations but am now hoping to look at a manifold (just pipe with about four outlets at different points).

      Thanks a lot for your stuff. will try to post to the forum from home later today.

      Slimms

       
    • I've also tried some interesting things and they kept coming up wrong.  I'm posting something that may help you. I got it from Vortexflow one of the developers.

      Basically you make an extrusion and then you tell the computer to subdivide the height into rectangles. That makes a better mesh and so for things that have corners and or big things next to small things (big inlet many small outlets) it works better.  For some reason when you don't do this, you have to adjust the specific length at strategic points.. horrible looking results.  In my previous posts Vortexflow mentions the units that are output. pressure is shown in pascals/rho  so that is why they are very large numbers.

      here is the short version from Vortex:

      lc = 0.05;
      neg = -0.25;
      pos = 1.0;
      nt = 10;
      nT = 20;

      Point(1) = {1, 0, 0, 0.08};
      Point(2) = {0, 0, 0, 0.08};
      Point(3) = {0, 1, 0, 0.08};
      Point(4) = {1, 1, 0, 0.08};
      Point(9) = {0.5, 0.5, 0, 0.08};
      Point(11) = {0.5, 0.25, 0, lc};
      Point(12) = {0.5, 0.75, 0, lc};
      Point(13) = {0.25, 0.5, 0, lc};
      Point(14) = {0.75, 0.5, 0, lc};
      Point(21) = {0.375, 0.5, 0, lc};
      Point(23) = {0.625, 0.5, 0, lc};
      Point(24) = {0.5, 0.375, 0, lc};
      Point(26) = {0.5, 0.625, 0, lc};

      Circle(1) = {13,9,12};
      Circle(2) = {12,9,14};
      Circle(3) = {14,9,11};
      Circle(4) = {11,9,13};
      Circle(5) = {21,9,26};
      Circle(6) = {26,9,23};
      Circle(7) = {23,9,24};
      Circle(8) = {24,9,21};
      Line(9) = {3,4};
      Line(10) = {4,1};
      Line(11) = {1,2};
      Line(12) = {2,3};
      Line Loop(13) = {9,10,11,12};
      Line Loop(14) = {2,3,4,1};
      Plane Surface(15) = {13,14};
      Line Loop(16) = {6,7,8,5};
      Plane Surface(17) = {14,16};
      Plane Surface(18) = {16};

      Extrude Surface {15, {0.0,0.0,pos}} { Recombine; Layers { {nT}, {9000}, {1} }; };
      Extrude Surface {17, {0.0,0.0,pos}} { Recombine; Layers { {nT}, {9000}, {1} }; };
      Extrude Surface {18, {0.0,0.0,pos}} { Recombine; Layers { {nT}, {9000}, {1} }; };
      Extrude Surface {17, {0.0,0.0,neg}} { Recombine; Layers { {nt}, {9000}, {1} }; };

      // walls
      Physical Surface(1) = {15,18,31,43,35,39,137,149,141,145,153,157,161,165};
      // outlet
      Physical Surface(2) = {60,102,124};
      // inlet
      Physical Surface(3) = {166};

      Physical Volume(100) = {9000};

      here is the long version that still doesn't work but shows what I want to do. the cicles are fans, the rectangles are flow channels. It took very little effort in making the geometru, maybe one hour of work. but because I did not stay with gmsh it ended up not working. defently doing the extrusions on gmsh keeps your model consistant. if you have programmed stuff, do not save and then reload because it will put real values and take your variables off.. odd.

      // characteristic length
      lc = 0.07;
      l2c = 0.05;
      n = 5;

      // length and height of box
      h = 0.45;
      l = 1;

      // height of air volume
      ha = 0.2;

      // length of channel, width and separation size
      sp = 0.04;
      ch = (l-(6*sp))/5;
      wch = 0.05;

      // width of box
      wd = 0.72;

      // location of middle ucap heat sinks
      ms = 0.24;

      // inner and outer diameter for fans , location, thickness and spacing
      fi = 0.15;
      fsp = (l-(2*fi))/3;
      id = 0.05;
      od = 0.098;
      flc = 0.46;
      fth = 0.04;

      // 1 channel
      Point(5) = {sp,ms,0,lc};
      Point(6) = {sp+ch,ms,0,lc};
      Point(7) = {sp,ms+wch,0,lc};
      Point(8) = {sp+ch,ms+wch,0,lc};
      Line(5) = {5,6};
      Line(6) = {7,5};
      Line(7) = {8,7};
      Line(8) = {6,8};
      Line Loop(15) = {5,6,7,8};
      Plane Surface(16) = {15};

      // 2 channel
      Point(9) = {2*sp+ch,ms,0,lc};
      Point(10) = {2*sp+2*ch,ms,0,lc};
      Point(11) = {2*sp+ch,ms+wch,0,lc};
      Point(12) = {2*sp+2*ch,ms+wch,0,lc};
      Line(9) = {9,10};
      Line(10) = {11,9};
      Line(11) = {12,11};
      Line(12) = {10,12};
      Line Loop(17) = {9,12,11,10};
      Plane Surface(18) = {17};

      // 3 channel
      Point(13) = {3*sp+2*ch,ms,0,lc};
      Point(14) = {3*sp+3*ch,ms,0,lc};
      Point(15) = {3*sp+2*ch,ms+wch,0,lc};
      Point(16) = {3*sp+3*ch,ms+wch,0,lc};
      Line(19) = {13,14};
      Line(20) = {15,13};
      Line(21) = {16,15};
      Line(22) = {14,16};
      Line Loop(23) = {19,22,21,20};
      Plane Surface(19) = {23};

      // 4 channel
      Point(17) = {4*sp+3*ch,ms,0,lc};
      Point(18) = {4*sp+4*ch,ms,0,lc};
      Point(19) = {4*sp+3*ch,ms+wch,0,lc};
      Point(20) = {4*sp+4*ch,ms+wch,0,lc};
      Line(24) = {17,18};
      Line(25) = {19,17};
      Line(26) = {20,19};
      Line(27) = {18,20};
      Line Loop(28) = {24,27,26,25};
      Plane Surface(20) = {28};

      // 5 channel
      Point(29) = {5*sp+4*ch,ms,0,lc};
      Point(30) = {5*sp+5*ch,ms,0,lc};
      Point(31) = {5*sp+4*ch,ms+wch,0,lc};
      Point(32) = {5*sp+5*ch,ms+wch,0,lc};
      Line(29) = {29,30};
      Line(30) = {31,29};
      Line(31) = {32,31};
      Line(32) = {32,30};
      Line Loop(33) = {29,-32,31,30};
      Plane Surface(21) = {33};

      // 6 channel
      Point(33) = {sp,wd,0,lc};
      Point(34) = {sp+ch,wd,0,lc};
      Point(35) = {sp,wd-wch,0,lc};
      Point(36) = {sp+ch,wd-wch,0,lc};
      Line(56) = {33,35};
      Line(57) = {35,36};
      Line(58) = {36,34};
      Line(59) = {34,33};
      Line Loop(98) = {57,58,59,56};
      Plane Surface(99) = {98};

      // 7 channel
      Point(37) = {2*sp+ch,wd,0,lc};
      Point(38) = {2*sp+2*ch,wd,0,lc};
      Point(39) = {2*sp+ch,wd-wch,0,lc};
      Point(40) = {2*sp+2*ch,wd-wch,0,lc};
      Line(60) = {37,39};
      Line(61) = {39,40};
      Line(62) = {40,38};
      Line(63) = {38,37};
      Line Loop(100) = {61,62,63,60};
      Plane Surface(101) = {100};

      // 8 channel
      Point(41) = {3*sp+2*ch,wd,0,lc};
      Point(42) = {3*sp+3*ch,wd,0,lc};
      Point(43) = {3*sp+2*ch,wd-wch,0,lc};
      Point(44) = {3*sp+3*ch,wd-wch,0,lc};
      Line(64) = {41,43};
      Line(65) = {43,44};
      Line(66) = {44,42};
      Line(67) = {42,41};
      Line Loop(102) = {65,66,67,64};
      Plane Surface(103) = {102};

      // 9 channel
      Point(45) = {4*sp+3*ch,wd,0,lc};
      Point(46) = {4*sp+4*ch,wd,0,lc};
      Point(47) = {4*sp+3*ch,wd-wch,0,lc};
      Point(48) = {4*sp+4*ch,wd-wch,0,lc};
      Line(68) = {45,47};
      Line(69) = {47,48};
      Line(70) = {48,46};
      Line(71) = {46,45};
      Line Loop(104) = {69,70,71,68};
      Plane Surface(105) = {104};

      // 10 channel
      Point(49) = {5*sp+4*ch,wd,0,lc};
      Point(50) = {5*sp+5*ch,wd,0,lc};
      Point(51) = {5*sp+4*ch,wd-wch,0,lc};
      Point(52) = {5*sp+5*ch,wd-wch,0,lc};
      Line(72) = {49,51};
      Line(73) = {51,52};
      Line(74) = {52,50};
      Line(75) = {50,49};
      Line Loop(106) = {73,74,75,72};
      Plane Surface(107) = {106};

      // 1 fan
      Point(53) = {fi,flc,0,l2c};
      Point(54) = {fi+id,flc,0,l2c};
      Point(55) = {fi-id,flc,0,l2c};
      Point(56) = {fi,flc+id,0,l2c};
      Point(57) = {fi,flc-id,0,l2c};
      Point(58) = {fi+od,flc,0,l2c};
      Point(59) = {fi-od,flc,0,l2c};
      Point(60) = {fi,flc+od,0,l2c};
      Point(61) = {fi,flc-od,0,l2c};
      Circle(550) = {56,53,54};
      Circle(551) = {54,53,57};
      Circle(552) = {57,53,55};
      Circle(553) = {55,53,56};
      Circle(554) = {60,53,58};
      Circle(555) = {58,53,61};
      Circle(556) = {61,53,59};
      Circle(557) = {59,53,60};
      Line Loop(558) = {551,552,553,550};
      Plane Surface(559) = {558};
      Line Loop(560) = {554,555,556,557};
      Plane Surface(561) = {560,558};

      // 2 fan
      Point(62) = {fsp+fi,flc,0,l2c};
      Point(63) = {fsp+fi+id,flc,0,l2c};
      Point(64) = {fsp+fi-id,flc,0,l2c};
      Point(65) = {fsp+fi,flc+id,0,l2c};
      Point(66) = {fsp+fi,flc-id,0,l2c};
      Point(67) = {fsp+fi+od,flc,0,l2c};
      Point(68) = {fsp+fi-od,flc,0,l2c};
      Point(69) = {fsp+fi,flc+od,0,l2c};
      Point(70) = {fsp+fi,flc-od,0,l2c};
      Circle(1004) = {65,62,63};
      Circle(1005) = {63,62,66};
      Circle(1006) = {66,62,64};
      Circle(1007) = {64,62,65};
      Circle(1008) = {69,62,67};
      Circle(1009) = {67,62,70};
      Circle(1010) = {70,62,68};
      Circle(1011) = {68,62,69};
      Line Loop(1012) = {1006,1007,1004,1005};
      Plane Surface(1013) = {1012};
      Line Loop(1014) = {1008,1009,1010,1011};
      Plane Surface(1015) = {1014,1012};

      // 3 fan
      Point(71) = {2*fsp+fi,flc,0,l2c};
      Point(72) = {2*fsp+fi+id,flc,0,l2c};
      Point(73) = {2*fsp+fi-id,flc,0,l2c};
      Point(74) = {2*fsp+fi,flc+id,0,l2c};
      Point(75) = {2*fsp+fi,flc-id,0,l2c};
      Point(76) = {2*fsp+fi+od,flc,0,l2c};
      Point(77) = {2*fsp+fi-od,flc,0,l2c};
      Point(78) = {2*fsp+fi,flc+od,0,l2c};
      Point(79) = {2*fsp+fi,flc-od,0,l2c};
      Circle(1016) = {74,71,72};
      Circle(1017) = {72,71,75};
      Circle(1018) = {75,71,73};
      Circle(1019) = {73,71,74};
      Circle(1020) = {78,71,76};
      Circle(1021) = {76,71,79};
      Circle(1022) = {79,71,77};
      Circle(1023) = {77,71,78};
      Line Loop(1024) = {1016,1017,1018,1019};
      Plane Surface(1025) = {1024};
      Line Loop(1026) = {1020,1021,1022,1023};
      Plane Surface(1027) = {1026,1024};

      // 4 fan
      Point(80) = {3*fsp+fi,flc,0,l2c};
      Point(81) = {3*fsp+fi+id,flc,0,l2c};
      Point(82) = {3*fsp+fi-id,flc,0,l2c};
      Point(83) = {3*fsp+fi,flc+id,0,l2c};
      Point(84) = {3*fsp+fi,flc-id,0,l2c};
      Point(85) = {3*fsp+fi+od,flc,0,l2c};
      Point(86) = {3*fsp+fi-od,flc,0,l2c};
      Point(87) = {3*fsp+fi,flc+od,0,l2c};
      Point(88) = {3*fsp+fi,flc-od,0,l2c};
      Circle(1028) = {83,80,81};
      Circle(1029) = {81,80,84};
      Circle(1030) = {84,80,82};
      Circle(1031) = {82,80,83};
      Circle(1032) = {87,80,85};
      Circle(1033) = {85,80,88};
      Circle(1034) = {88,80,86};
      Circle(1035) = {86,80,87};
      Line Loop(1036) = {1028,1029,1030,1031};
      Plane Surface(1037) = {1036};
      Line Loop(1038) = {1032,1033,1034,1035};
      Plane Surface(1039) = {1038,1036};

      // box
      Point(1) = {0,0,0,lc};
      Point(2) = {l,0,0,lc};
      Point(3) = {l,1.1*wd,0,lc};
      Point(4) = {0,1.1*wd,0,lc};
      Line(1) = {1,2};
      Line(2) = {3,2};
      Line(3) = {4,3};
      Line(4) = {1,4};
      Line Loop(13) = {3,2,-1,4};
      Plane Surface(14) = {13,15,17,23,28,33,98,100,102,104,106,560,1014,1026,1038};

      Extrude Surface {16, {0.0,0.0,h}} { Recombine; Layers { {2*n}, {9000}, {1} }; };
      Extrude Surface {18, {0.0,0.0,h}} { Recombine; Layers { {2*n}, {9000}, {1} }; };
      Extrude Surface {19, {0.0,0.0,h}} { Recombine; Layers { {2*n}, {9000}, {1} }; };
      Extrude Surface {20, {0.0,0.0,h}} { Recombine; Layers { {2*n}, {9000}, {1} }; };
      Extrude Surface {21, {0.0,0.0,h}} { Recombine; Layers { {2*n}, {9000}, {1} }; };
      Extrude Surface {99, {0.0,0.0,h}} { Recombine; Layers { {2*n}, {9000}, {1} }; };
      Extrude Surface {101, {0.0,0.0,h}} { Recombine; Layers { {2*n}, {9000}, {1} }; };
      Extrude Surface {103, {0.0,0.0,h}} { Recombine; Layers { {2*n}, {9000}, {1} }; };
      Extrude Surface {105, {0.0,0.0,h}} { Recombine; Layers { {2*n}, {9000}, {1} }; };
      Extrude Surface {107, {0.0,0.0,h}} { Recombine; Layers { {2*n}, {9000}, {1} }; };

      Extrude Surface {14, {0.0,0.0,-ha}} { Recombine; Layers { {n}, {9000}, {1} }; };
      Extrude Surface {16, {0.0,0.0,-ha}} { Recombine; Layers { {n}, {9000}, {1} }; };
      Extrude Surface {18, {0.0,0.0,-ha}} { Recombine; Layers { {n}, {9000}, {1} }; };
      Extrude Surface {19, {0.0,0.0,-ha}} { Recombine; Layers { {n}, {9000}, {1} }; };
      Extrude Surface {20, {0.0,0.0,-ha}} { Recombine; Layers { {n}, {9000}, {1} }; };
      Extrude Surface {21, {0.0,0.0,-ha}} { Recombine; Layers { {n}, {9000}, {1} }; };
      Extrude Surface {99, {0.0,0.0,-ha}} { Recombine; Layers { {n}, {9000}, {1} }; };
      Extrude Surface {101, {0.0,0.0,-ha}} { Recombine; Layers { {n}, {9000}, {1} }; };
      Extrude Surface {103, {0.0,0.0,-ha}} { Recombine; Layers { {n}, {9000}, {1} }; };
      Extrude Surface {105, {0.0,0.0,-ha}} { Recombine; Layers { {n}, {9000}, {1} }; };
      Extrude Surface {107, {0.0,0.0,-ha}} { Recombine; Layers { {n}, {9000}, {1} }; };

      Extrude Surface {561, {0.0,0.0,-ha}} { Recombine; Layers { {n}, {9000}, {1} }; };
      Extrude Surface {1039, {0.0,0.0,-ha}} { Recombine; Layers { {n}, {9000}, {1} }; };
      Extrude Surface {1027, {0.0,0.0,-ha}} { Recombine; Layers { {n}, {9000}, {1} }; };
      Extrude Surface {1015, {0.0,0.0,-ha}} { Recombine; Layers { {n}, {9000}, {1} }; };

      Extrude Surface {1865, {0.0,0.0,-fth}} { Recombine; Layers { {n/2}, {9000}, {1} }; };
      Extrude Surface {1907, {0.0,0.0,-fth}} { Recombine; Layers { {n/2}, {9000}, {1} }; };
      Extrude Surface {1949, {0.0,0.0,-fth}} { Recombine; Layers { {n/2}, {9000}, {1} }; };
      Extrude Surface {1823, {0.0,0.0,-fth}} { Recombine; Layers { {n/2}, {9000}, {1} }; };

      Extrude Surface {559, {0.0,0.0,-ha}} { Recombine; Layers { {n/2}, {9000}, {1} }; };
      Extrude Surface {1013, {0.0,0.0,-ha}} { Recombine; Layers { {n/2}, {9000}, {1} }; };
      Extrude Surface {1025, {0.0,0.0,-ha}} { Recombine; Layers { {n/2}, {9000}, {1} }; };
      Extrude Surface {1037, {0.0,0.0,-ha}} { Recombine; Layers { {n/2}, {9000}, {1} }; };

      //inlets
      Physical Surface(2198) = {1061,1083,1105,1127,1149,1171,1193,1215,1237,1259};
      //outlets
      Physical Surface(2199) = {2117,2075,2033,1991};
      //walls
      Physical Surface(2200) ={1641,14,561,559,1015,1013,1027,1025,1039,1037,1140,1136,1144,1148,1118,1114,1122,1126,1096,1092,1250,1100,1246,1104,1074,1070,1228,1082,1060,1206,1048,1236,1052,1214,1184,1180,1188,1192,1162,1158,1158,1166,1170,1210,1202,1232,1224,1258,1254,1078,1056,2180,2176,2134,2188,2184,2138,2176,2192,2150,2146,2196,2172,2154,2142,2130,2042,2084,2126,2168,1751,1729,1707,1685,1663,1773,1795,1817,1839,1861,2219,2241,2263,2285,1332,1336,1324,1328,1561,1693,1715,1737,1759,1781,1583,1605,1627,1649,1671,1962,1990,1978,1974,2004,2032,2020,2016,2046,2066,2070,2058,2088,2104,2108,2100,1986,1966,2096,2112,2116,2092,2054,2070,2070,2074,2062,2050,2012,2024,2028,2008,1970,1982};
      //
      //volume
      Physical Volume(100) = {9000};

       
    • see that variable "n"? it controls the amount of subdivisions per line. if you extrude a square and get a cube, the side lines forming the cube will be subdivided 5 times. the cross subdivision is dictated by the characteristic length on the base points. It helps a lot to know this. if you don't use subdivisions, your mesh is huge and chanses are that it will go slow and hit the E-80. At wich point it is useless.

      fonss

       
    • http://geuz.org/gmsh/wiki/EscapeImage

      use gmsh and wiki as id and password.. there are lots of sambles there.. Escape seems to be a .geo of a pipe with a side exit.. I haven't seen it but I know exactly what the problems would be. If its not a square tube, I bet its hard to get it to work.. Another way would be to use Blender.org to make a pipe and then use gmsh to import the STL. it will import as some mesh  but then save it as a .geo and re-open. you will get a million points that you can use to make a pipe from scratch.