CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Native Meshers: snappyHexMesh and Others

Please help me, I am new to CFD and snappyHexMesh

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree2Likes

Reply
 
LinkBack Thread Tools Display Modes
Old   October 19, 2012, 08:00
Default
  #21
Senior Member
 
Elo´se
Join Date: Jul 2012
Location: Trondheim, Norway
Posts: 103
Rep Power: 4
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: 4
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
Member
 
plucas's Avatar
 
Anonymous
Join Date: Dec 2011
Location: Everywhere
Posts: 74
Rep Power: 5
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: 4
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: 103
Rep Power: 4
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
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,251
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
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: 4
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
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,251
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
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: 4
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: 4
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: 103
Rep Power: 4
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: 4
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, 05:51
Default
  #33
Member
 
Malik
Join Date: Dec 2012
Location: Austin, USA
Posts: 52
Rep Power: 4
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

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
snappyHexMesh not refining surfaces Hydro1004 OpenFOAM 3 August 29, 2012 11:56
Some problems about using snappyHexMesh xiaow_g OpenFOAM Native Meshers: snappyHexMesh and Others 1 April 13, 2012 05:56
snappyHexMesh won't work - zeros everywhere! sc298 OpenFOAM Native Meshers: snappyHexMesh and Others 2 March 27, 2011 21:11
SnappyHexMesh samiam1000 OpenFOAM 0 October 5, 2009 10:32
Problem with snappyHexMesh samiam1000 OpenFOAM 0 October 3, 2009 05:08


All times are GMT -4. The time now is 13:04.