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

[snappyHexMesh] Please help me, I am new to CFD and snappyHexMesh

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 19, 2012, 08:00
Default
  #21
Senior Member
 
Eloïse
Join Date: Jul 2012
Location: Trondheim, Norway
Posts: 113
Rep Power: 13
Eloise is on a distinguished road
Quote:
Originally Posted by ben1793 View Post
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?
See Tobi's answer... You can go from one time directory to another in the top right region of the paraView interface where you have a button that allow you going one time up or down.
Quote:
Originally Posted by Tobi View Post
Then open paraview and you can switch from 0 (backgroundmesh) to 1 (castellatedMesh) to 2 (snapped mesh) and so on.
Quote:
Originally Posted by ben1793 View Post
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.
In sHMD, you renamed your body as cara with the line
geometry { cara.stl { type triSurfaceMesh; name cara; }};
The system/controlDict file in the motorbike tutorial has the line
which should also appear in your controlDict
functions {#include "forceCoeffs"
}
It refers to the file forceCoeffs (that you must copy in your system directory) and you must change the patches name
from
patches ( "motorBike.*" ); to patches ( "cara.*" );

Eloise is offline   Reply With Quote

Old   October 19, 2012, 09:04
Default
  #22
Member
 
Ben
Join Date: Sep 2012
Posts: 40
Rep Power: 13
ben1793 is on a distinguished road
Thank you for the help.

I have changed the name in the forceCoefs file and when I tried to run the simulation in paraFoam I did not get any results, not just that but I cant even get the options for u or p, so I went into the 0 folder and realised it was still under the name motorbike so I changed all the contents (in files such as p, u, k, omega) files from "motorBike_.*" to "cara.*" I had also tried "cara_.*" but still get the same problem, I cant change to velocity or pressure in para view and cant get any results, does anyone know what else I need to change?
ben1793 is offline   Reply With Quote

Old   October 19, 2012, 12:18
Default
  #23
Senior Member
 
plucas's Avatar
 
Anonymous
Join Date: Dec 2011
Location: USA
Posts: 108
Rep Power: 14
plucas is on a distinguished road
Quote:
Originally Posted by ben1793 View Post
Thank you for the help.

I have changed the name in the forceCoefs file and when I tried to run the simulation in paraFoam I did not get any results, not just that but I cant even get the options for u or p, so I went into the 0 folder and realised it was still under the name motorbike so I changed all the contents (in files such as p, u, k, omega) files from "motorBike_.*" to "cara.*" I had also tried "cara_.*" but still get the same problem, I cant change to velocity or pressure in para view and cant get any results, does anyone know what else I need to change?
Easiest thing to do would be to change you model name to motorBike. If that does not work, you have a different problem than just file names.
plucas is offline   Reply With Quote

Old   October 19, 2012, 14:45
Default
  #24
Member
 
Ben
Join Date: Sep 2012
Posts: 40
Rep Power: 13
ben1793 is on a distinguished road
Thank you for the help plucas.

I did as you said and changed the name to motorBike and also edited the snappyHexMesh but the same problem occurs, I will take you through what I did:

In the terminal I typed:

cp -r 0.org 0 > /dev/null 2>&1
blockMesh
snappyHexMesh
potentialFoam
simpleFoam
paraFoam

I then hit apply and changed to the number 2 on the top right corner so that I could view my STL geometry, but still no u or p options, I also checked numbers 1 and 0 and still couldn't find anything.
ben1793 is offline   Reply With Quote

Old   October 19, 2012, 15:15
Default
  #25
Senior Member
 
Eloïse
Join Date: Jul 2012
Location: Trondheim, Norway
Posts: 113
Rep Power: 13
Eloise is on a distinguished road
try this:
Code:
cp -r 0.org 0 > /dev/null 2>&1
blockMesh
snappyHexMesh
cp 3/polymesh/* constant/polymesh/
rm -r 1/ 2/ 3/
potentialFoam 
simpleFoam
paraFoam
Eloïse
Eloise is offline   Reply With Quote

Old   October 19, 2012, 15:19
Default
  #26
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Suggestion - replace these three lines:
Code:
snappyHexMesh
cp 3/polymesh/* constant/polymesh/
rm -r 1/ 2/ 3/
for this one:
Code:
snappyHexMesh -overwrite
Eloise likes this.
__________________
wyldckat is offline   Reply With Quote

Old   October 19, 2012, 16:49
Default
  #27
Member
 
Ben
Join Date: Sep 2012
Posts: 40
Rep Power: 13
ben1793 is on a distinguished road
Thank you

I have now got the p and u values but can not view my drag coefficient, on the motorbike tutorial it made a log.simpleFoam file automatically and listed all my drag coefficients but on this example there is no log so I made one separately and still no results, does anyone know how to view these results?
ben1793 is offline   Reply With Quote

Old   October 20, 2012, 16:40
Default
  #28
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Ben,

If you are still using the same settings that are present in "system/controlDict" that the "motorBike" case is using, along with the included files it refers to, then you should have the following file present in your case:
Code:
forces/0/forceCoeffs.dat
To plot it... there are several options:
  • Open it in LibreOffice's Calc.
  • Plot using Gnuplot.
  • Convert the file to a CSV file and open it in ParaView.
Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   October 21, 2012, 08:22
Default
  #29
Member
 
Ben
Join Date: Sep 2012
Posts: 40
Rep Power: 13
ben1793 is on a distinguished road
Thank you for the reply wyldckat

I did as you said and found the file called forceCoefs.dat, I opened it and there was a HUGE list of coefficients for the drag but, they were all VERY high, ranging from 2800-1300 for the drag coefficient when I know it should only be around 0.2, why is this happening?



Last edited by ben1793; October 21, 2012 at 11:49.
ben1793 is offline   Reply With Quote

Old   October 22, 2012, 16:40
Default
  #30
Member
 
Ben
Join Date: Sep 2012
Posts: 40
Rep Power: 13
ben1793 is on a distinguished road
Could anybody please tell me why I am getting such high drag coefficients even though I have not modified anything apart from the snappyHexMeshDict and the STL file in the motorbike tutorial?

Also, if possible could somebody please upload a STL file that the drag coefficient has already been tested on so that I could use it as a guide?

Thank you.
ben1793 is offline   Reply With Quote

Old   October 23, 2012, 03:22
Default
  #31
Senior Member
 
Eloïse
Join Date: Jul 2012
Location: Trondheim, Norway
Posts: 113
Rep Power: 13
Eloise is on a distinguished road
Hi Ben,

Think about the definition of a drag coefficient and go to read the file forceCoeffs. There might be some stuff you need to modify in there...

Regards,
Eloïse
Eloise is offline   Reply With Quote

Old   October 23, 2012, 05:24
Default
  #32
Member
 
Ben
Join Date: Sep 2012
Posts: 40
Rep Power: 13
ben1793 is on a distinguished road
I have tried playing around with the forceCoefs and have also been reading up on the drag coefficient but can not fix the problem, still getting very high drag, I will make a separate thread for this question so that I can post all my code.

Thank you.
ben1793 is offline   Reply With Quote

Old   December 21, 2012, 04:51
Default
  #33
Member
 
Malik
Join Date: Dec 2012
Location: Austin, USA
Posts: 53
Rep Power: 13
malaboss is on a distinguished road
If you did not get any answer on that question :
you have to specify in controlDict a surface and a velocity to define the drag value. I think it is Aref and Umag. there are other variables such as the direction of the velocity.
What you found in the motor bike tutorial may not actually be applicable for your case.
Hope that helps.
malaboss 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
[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


All times are GMT -4. The time now is 05:14.