|
[Sponsors] |
[snappyHexMesh] Please help me, I am new to CFD and snappyHexMesh |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 11, 2012, 13:46 |
Please help me, I am new to CFD and snappyHexMesh
|
#1 |
Member
Ben
Join Date: Sep 2012
Posts: 40
Rep Power: 13 |
Hello
I have made a thread on the OpenFOAM sub-forum in the past about installation problems and turned it into my question thread but after a while I got told I would be better off making a new thread for my questions so here it is EDIT: I have figured this question out after searching the forum for ages and finding a solution, but I will be asking many more questions soon. Last edited by ben1793; October 11, 2012 at 14:42. |
|
October 11, 2012, 15:36 |
|
#2 |
Member
Ben
Join Date: Sep 2012
Posts: 40
Rep Power: 13 |
I have a question now, I am using the motorbike tutorial as a guide and found this:
http://www.vespalabs.org/Projects/Ve...rbike_Tutorial I have messed around on paraview for ages but cant get it anything like the view on the website, I want it so that I slice through the block (wind tunnel) so that I can actually see the flow over the motorbike while the motorbike itself stays as a solid surface, whenever I try use the slice tool it end up cutting through the bike also, is there anyway I only cut through the block? |
|
October 12, 2012, 03:50 |
|
#3 |
Senior Member
Eloïse
Join Date: Jul 2012
Location: Trondheim, Norway
Posts: 113
Rep Power: 13 |
Hi Ben,
You can try to open 2 objects in paraView: the internal flow field and the motorbike surface. If you use VTK format, then load both files. Otherwise, select both in the Object Inspector. Then, render the motorbike as a surface, and make a cut through the internal field. You can also find many info in here: http://www.paraview.org/paraview/hel...de%20v3.10.pdf I hope this help. regards, Eloïse |
|
October 12, 2012, 07:30 |
|
#4 |
Member
Ben
Join Date: Sep 2012
Posts: 40
Rep Power: 13 |
Thank you for the reply Eloise.
Could you please tell me how to render the motorbike as a surface? Also, I have been wondering, why is the motorbike tutorial under incompressible flows because the simulation is of a wind tunnel and that is a compressible flow. If I changed the name of the file in the snappyHexMeshDict file for another stl file would the model in the wind tunnel change or would more things need to be modified, and also, where would I save the stl file? I am sorry for asking such newbie questions but I have just started out with OpenFOAM and really don't know much about it. |
|
October 12, 2012, 07:48 |
|
#5 | |||
Senior Member
Eloïse
Join Date: Jul 2012
Location: Trondheim, Norway
Posts: 113
Rep Power: 13 |
Quote:
Quote:
Quote:
Good luck ! |
||||
October 13, 2012, 08:18 |
|
#6 |
Member
Ben
Join Date: Sep 2012
Posts: 40
Rep Power: 13 |
Thank you for the reply.
Last edited by ben1793; October 15, 2012 at 12:42. |
|
October 15, 2012, 12:40 |
|
#7 |
Member
Ben
Join Date: Sep 2012
Posts: 40
Rep Power: 13 |
Could anyone please tell me how to run the motorbike tutorial with a different stl model?
I have already converted my model to ASCII and placed it into the trisurface folder I have also edited the snappyHexMeshDict on the top line and changed it from motorbike.obj to myfilename.obj I meshed the geometry and used the ./Allrun command to run it and viewed it on paraview, the tunnel was there butmy stl geometry was not in the tunnel. What have I done wrong? |
|
October 16, 2012, 03:06 |
|
#8 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51 |
Hi ben,
have a look at the openfoamwiki http://openfoamwiki.net/index.php/SnappyHexMesh There you can find some tutorials with sHM! After that it should be clear how to use it. Otherwise you can make a thread in the sHM section. Regard Tobi |
|
October 16, 2012, 11:08 |
|
#9 | |
Senior Member
|
Quote:
I think HelxyOS is a great GUI and keeps one away from wrong file names. You could sometimes get much better results when you use an myfilename.eMesh-file that you get by using surfaceFeatureExtract command and include that myfilename.eMesh in snappyHexMeshDict as well |
||
October 17, 2012, 16:05 |
|
#10 |
Member
Ben
Join Date: Sep 2012
Posts: 40
Rep Power: 13 |
Thank you for the replies, links have come in very handy. My main concern at the moment is not to get perfect results but it is just to get any results at all.
I have found a guide that told me a bit about creating code in the snappyHexMeshDict file so I copied the code and modified it and got the following: FoamFile { version 2.0; format ascii; root ""; case ""; instance ""; local ""; class dictionary; object autoHexMeshDict; } castellatedMesh true; snap true; addLayers true; geometry { cara.stl { type triSurfaceMesh; name cara; } }; castellatedMeshControls { maxLocalCells 10000000; maxGlobalCells 2000000; minRefinementCells 0; nCellsBetweenLevels 1; refinementSurfaces { cara { level (4 5); } } resolveFeatureAngle 30; refinementRegions { cara { mode distance; levels ((0.1 5) (0.4 4) (1 2)); } } locationInMesh (3.11 1.51 -1.1); } snapControls { nSmoothPatch 3; tolerance 4.0; nSolveIter 30; nRelaxIter 5; } addLayersControls { layers { cara_vcg { nSurfaceLayers 1; } } } meshQualityControls { } I try this and only my tunnel loads which is what is in the blockMeshDict, my STL file does not show, what have I done wrong? Also, I did not modify anything in the refinement regions, the location mesh and dont really know what to put in the meshQualityControls, although I will modify the location in mesh once I have actually got the STL model to appear. Last edited by ben1793; October 17, 2012 at 16:21. |
|
October 18, 2012, 04:22 |
|
#11 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128 |
Greetings to all,
FYI: I've mode this thread to the snappyHexMesh sub-forum. @ben1793: which tutorial are you following now? Nonetheless, it would be best that you use OpenFOAM's own motorBike tutorial "mesh/snappyHexMesh/motorBike" and work from there. And as already mentioned before, Helyx-OS would make your life a lot easier since you're new with snappyHexMesh Best regards, Bruno
__________________
|
|
October 18, 2012, 09:10 |
|
#12 | |
Senior Member
Anonymous
Join Date: Dec 2011
Location: USA
Posts: 108
Rep Power: 14 |
Quote:
|
||
October 18, 2012, 09:46 |
|
#13 | |
Senior Member
Eloïse
Join Date: Jul 2012
Location: Trondheim, Norway
Posts: 113
Rep Power: 13 |
Try this one below...
I deactivated the layer insertion (You don't need that yet), and added some "default" values for mesh quality. Use the command snappyHexMesh > log.snappyHexMesh and post the log file here so maybe we can help you to see where is the error Regards, Eloïse Quote:
|
||
October 18, 2012, 12:35 |
|
#14 |
Member
Ben
Join Date: Sep 2012
Posts: 40
Rep Power: 13 |
Thank you for all the replies and I am sorry that I had posted this question on the wrong sub-forum.
Also, Thank you so much Eloise for taking the time to edit my code I have used the command in the terminal and got the following error: --> FOAM FATAL ERROR: Cannot find file "points" in directory "polyMesh" in times 0 down to constant From function Time::findInstance(const fileName&, const word&, const IOobject::readOption, const word&) in file db/Time/findInstance.C at line 188. FOAM exiting I also did not mention, I had changed the size of the external mesh (wind tunnel) in the blockMeshDict file because when I had loaded the tunnel and STL files separately on para view I had noticed that the STL file was much larger in size than the tunnel, so I added two more 0's after every number in the initial part of the blockMeshDict to scale the tunnel by 100. |
|
October 18, 2012, 15:48 |
|
#15 |
Senior Member
Eloïse
Join Date: Jul 2012
Location: Trondheim, Norway
Posts: 113
Rep Power: 13 |
The file "points" in the polymesh directory is created by blockMesh. Have you run the blockMesh utility before snappyHexMesh?
Try the following steps: 1) copy the "AllClean" from motorbike tutorial to your case directory 2) run AllClean in your case directory 3) execute the following commands, one by one: cp -r 0.org 0 > /dev/null 2>&1 blockMesh > log.blockMesh => Check in paraView if your windtunnel is as you expect and if your STL is where you want it to be. Play around with the bolckMeshDict until you reach that point. snappyHexMesh > log.snappyHexMesh => Check the different meshs (times 0, 1 and 2) in paraView to see what was the effect of the castellate and snap steps Regards, Eloïse |
|
October 18, 2012, 16:50 |
|
#16 |
Member
Ben
Join Date: Sep 2012
Posts: 40
Rep Power: 13 |
I managed to do everything up till the last step and then a Error:
--> FOAM FATAL IO ERROR: keyword mergeTolerance is undefined in dictionary "/home/ben/OpenFOAM/ben-2.1.1/run/motorBike/system/snappyHexMeshDict" file: /home/ben/OpenFOAM/ben-2.1.1/run/motorBike/system/snappyHexMeshDict from line 20 to line 56. From function dictionary::lookupEntry(const word&, bool, bool) const in file db/dictionary/dictionary.C at line 400. FOAM exiting I think I have fixed the mergeTolerance problem by coppying it from another example but now have the following error: --> FOAM FATAL IO ERROR: keyword features is undefined in dictionary "/home/ben/OpenFOAM/ben-2.1.1/run/motorBike/system/snappyHexMeshDict::castellatedMeshControls" file: /home/ben/OpenFOAM/ben-2.1.1/run/motorBike/system/snappyHexMeshDict::castellatedMeshControls from line 28 to line 36. From function dictionary::lookupEntry(const word&, bool, bool) const in file db/dictionary/dictionary.C at line 400. FOAM exiting Here is what is inside my snappyHexMeshDict under castellatedMeshControl: castellatedMeshControls { maxLocalCells 10000000; maxGlobalCells 2000000; minRefinementCells 0; nCellsBetweenLevels 1; When I used the command you told me to use, it created a new folder called 0, what is the difference between 0 and 0.org? Is the main reason for creating a log just to see if there is any errors? Thank you Last edited by ben1793; October 18, 2012 at 17:06. |
|
October 18, 2012, 17:17 |
|
#17 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51 |
Its the latest entry in your sHMDict:
Code:
// Advanced // Flags for optional output // 0 : only write final meshes // 1 : write intermediate meshes // 2 : write volScalarField with cellLevel for postprocessing // 4 : write current intersections as .obj files debug 0; // Merge tolerance. Is fraction of overall bounding box of initial mesh. // Note: the write tolerance needs to be higher than this. mergeTolerance 1e-6; Code:
mergeTolerance 1e-6; Differences between 0 and 0.org are that in 0.org your variables (U,T,p...) are and in the folder 0 is your castellatedMesh. If you have the folder 0.org copyed to 0 with Code:
cp -r 0.org 0 in timestep 2 is your snapped mesh in timestep 3 is your addedLayer mesh (if you use it). If you set Code:
writeTimestep 100; you ll get the folders 100 200 300 and so no. Build an empty folder 0 befor running sHM. Then open paraview and you can switch from 0 (backgroundmesh) to 1 (castellatedMesh) to 2 (snapped mesh) and so on. Tobi Tobi |
|
October 19, 2012, 04:00 |
|
#18 |
Member
Ben
Join Date: Sep 2012
Posts: 40
Rep Power: 13 |
Thank you for replying Toby and also thank you for answering my questions and clearing things up for me
I have added the code to my snappyHexMeshDict and got the same error when I tried to compile it in the terminal: --> FOAM FATAL IO ERROR: keyword features is undefined in dictionary "/home/ben/OpenFOAM/ben-2.1.1/run/motorBike/system/snappyHexMeshDict::castellatedMeshControls" file: /home/ben/OpenFOAM/ben-2.1.1/run/motorBike/system/snappyHexMeshDict::castellatedMeshControls from line 28 to line 36. From function dictionary::lookupEntry(const word&, bool, bool) const in file db/dictionary/dictionary.C at line 400. FOAM exiting |
|
October 19, 2012, 04:11 |
|
#19 | |
Senior Member
Eloïse
Join Date: Jul 2012
Location: Trondheim, Norway
Posts: 113
Rep Power: 13 |
If you read the message, it tells you that it misses "features" in castellatedMeshControls. Look at the sHMD in the motorbike totuorial and you will see that there is a line with "feature" which does not exist in your sHMD
Add this: Quote:
Regards, Eloïse |
||
October 19, 2012, 05:37 |
|
#20 |
Member
Ben
Join Date: Sep 2012
Posts: 40
Rep Power: 13 |
Thank you Eloise.
I had done as you said and continued changing the snappyHexMeshDict whenever an error came up and finally got it so that no errors come up, but now I have a new problem. I used the commands you said which created the 0 folder and then used the blockMesh > log.blockMesh and then snappyHexMesh > log.snappyHexMesh and after that used paraFoam, when I went into paraFoam I can see my part under the mesh parts in the pipeline browser, it is right at the bottom under all my other patch's and its called cara_vcg - Patch, when I click apply to view my geometry the cara_vcg vanishes and I am left with just the patch's for my tunnel. EDIT: I have fixed it, I just ticked the skip zero time box, what does this do? Also, I have executed the command potentialFoam and simpleFoam as I did on the motorBike tutorial in the past and I did not get a log for simpleFoam so I did it again but this time did simpleFoam > log.simpleFoam, I now have the log but can not view the information I need which is the drag coefficient, I could do this on the motorbike tutorial but for some reason it does not work on here. Last edited by ben1793; October 19, 2012 at 05:54. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[snappyHexMesh] snappyHexMesh does not create any mesh except one for the reference cell | Arman_N | OpenFOAM Meshing & Mesh Conversion | 1 | May 20, 2019 17:16 |
[snappyHexMesh] snappyHexMesh Parallel bad size error | andrewpomeroy | OpenFOAM Meshing & Mesh Conversion | 2 | April 2, 2018 01:08 |
[snappyHexMesh] snappyhexmesh doesn't creat mesh in parallel issue? | klausb | OpenFOAM Meshing & Mesh Conversion | 1 | March 7, 2015 11:55 |
[snappyHexMesh] snappyHexMesh running | lguillem | OpenFOAM Meshing & Mesh Conversion | 7 | June 13, 2014 11:28 |
[snappyHexMesh] Problem with snappyHexMesh | samiam1000 | OpenFOAM Meshing & Mesh Conversion | 0 | October 3, 2009 05:08 |