CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Mesh Utilities (http://www.cfd-online.com/Forums/openfoam-meshing-utilities/)
-   -   Snappyhexmesh refinement parameters (http://www.cfd-online.com/Forums/openfoam-meshing-utilities/61499-snappyhexmesh-refinement-parameters.html)

liuyang December 15, 2008 02:25

Hello all: I used snappyhe
 
Hello all:
I used snappyhexmesh for grid generating and it's quite efficient,but I still don't understand the parameters in subdictionary refinementRegions, the tuturial gives
refinementRegions
{
refinementBox
{
mode inside;
levels ((1E15 4));
}
}
and I used in a same way, only chages the mode to mode distance. It seems to work too.
My question is , what do the two parameters behind "levels" mean? and is the meanning the same for both inside mode and distance mode?
Thanks in advance.

velan December 15, 2008 04:24

Hi Liu, In my point of view (
 
Hi Liu,
In my point of view (Please reply if it is wrong), mode inside or outside defined from "searchableBox"
So if your mode is inside, inside the searchable region, mesh will be refine and if your mode is outside, mesh will refine outside the searchable area. Here it doesnt matter about where the surface is. Mode distance refine from starting of the surface upto the distance mention.

And levels define how many times each cell has to refine.

Hope this clear your doubt

liuyang December 15, 2008 05:09

Hi Velan: Thank you very much
 
Hi Velan:
Thank you very much for your reply.
Maybe I didn't make my problem clear. I knew mode distance refine from starting of the surface, and in my case the refinementRegions is specified to the surface of the solid body.
My doubt is, what the two parameters (1E15 4) after "lelvels" means? Can they make my grid generation too slow? 1E15 is quite a large number. I changed it to 10, but the grid is not fine enough.
Thank you and everyone helped.

velan December 15, 2008 06:22

Hi Liu, mode distance ; le
 
Hi Liu,

mode distance ;
levels (A B)

Here A is the distance from the solid surface. The grid will get refine upto the Distance A.
B is the number of refinement level per cell.

For you problem, keep your A constant and increase your B value. You will get more fine grid near the solid surface.

Hope your grid generation will be bit slow. Because it has to split the cells into B level times.

Some other people might explain you more clearly.

liuyang December 15, 2008 08:26

Hi Velan: Thank you very much
 
Hi Velan:
Thank you very much for your kind help and your patience. Now I'm quite clear.
Liuyang

bholbek January 19, 2009 08:44

Hello, Using snappyHexMesh
 
Hello,

Using snappyHexMesh mesh utility, i have successfully created a mesh and my simulation runs fine. I would like to modify it and play a little bit with the different parameters of snappyHexMeshDict file.
Modifying refinement parameters from some given regions or the global level (1E15 4) to (1E15 2) for example, i receive the following error when running my simulation:

Reading environmentalProperties
Reading thermophysical properties

Selecting thermodynamics package hThermo<puremixture<consttransport<speciethermo<hc onstthermo<perfectgas>>>>>
#0 Foam::error::printStack(Foam:http://www.cfd-online.com/OpenFOAM_D...part/proud.gifstream&) in "/ric_home/ep4/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libOpenFOAM.so"
#1 Foam::sigFpe::sigFpeHandler(int) in "/ric_home/ep4/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libOpenFOAM.so"
#2 __restore_rt at sigaction.c:0
#3 Foam::hThermo<foam::puremixture<foam::consttranspo rt<foam::speciethermo<foam::hc onstthermo<foam::perfectgas> > > > >::calculate() in "/ric_home/ep4/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libbasicThermophysicalM odels.so"
#4 Foam::hThermo<foam::puremixture<foam::consttranspo rt<foam::speciethermo<foam::hc onstthermo<foam::perfectgas> > > > >::hThermo(Foam::fvMesh const&) in "/ric_home/ep4/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libbasicThermophysicalM odels.so"
#5 Foam::basicThermo::addfvMeshConstructorToTable<foa m::hthermo<foam::puremixture<f oam::consttransport<foam::speciethermo<foam::hcons tthermo<foam::perfectgas> > > > > >::New(Foam::fvMesh const&) in "/ric_home/ep4/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libbasicThermophysicalM odels.so"
#6 Foam::basicThermo::New(Foam::fvMesh const&) in "/ric_home/ep4/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libbasicThermophysicalM odels.so"
#7 main in "/ric_home/ep4/OpenFOAM/OpenFOAM-1.5/applications/bin/linux64GccDPOpt/buoyantFoa m"
#8 __libc_start_main in "/lib64/tls/libc.so.6"
#9 Foam::regIOobject::readIfModified() in "/ric_home/ep4/OpenFOAM/OpenFOAM-1.5/applications/bin/linux64GccDPOpt/buoyantFoa m"

checkMesh gives me: Mesh OK. I use the function mapFields to obtain my initial fields, interpolating the fields of an other simulation.
What kind of error is it? Could someone give me a tip?

Thanks

Bastien

bholbek January 19, 2009 08:46

Hello, Using snappyHexMesh
 
Hello,

Using snappyHexMesh mesh utility, i have successfully created a mesh and my simulation runs fine. I would like to modify it and play a little bit with the different parameters of snappyHexMeshDict file.
Modifying refinement parameters from some given regions or the global level (1E15 4) to (1E15 2) for example, i receive the following error when running my simulation:

Reading environmentalProperties
Reading thermophysical properties

Selecting thermodynamics package hThermo<puremixture<consttransport<speciethermo<hc onstthermo<perfectgas>>>>>
#0 Foam::error::printStack(Foam:http://www.cfd-online.com/OpenFOAM_D...part/proud.gifstream&) in "/ric_home/ep4/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libOpenFOAM.so"
#1 Foam::sigFpe::sigFpeHandler(int) in "/ric_home/ep4/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libOpenFOAM.so"
#2 __restore_rt at sigaction.c:0
#3 Foam::hThermo<foam::puremixture<foam::consttranspo rt<foam::speciethermo<foam::hc onstthermo<foam::perfectgas> > > > >::calculate() in "/ric_home/ep4/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libbasicThermophysicalM odels.so"
#4 Foam::hThermo<foam::puremixture<foam::consttranspo rt<foam::speciethermo<foam::hc onstthermo<foam::perfectgas> > > > >::hThermo(Foam::fvMesh const&) in "/ric_home/ep4/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libbasicThermophysicalM odels.so"
#5 Foam::basicThermo::addfvMeshConstructorToTable<foa m::hthermo<foam::puremixture<f oam::consttransport<foam::speciethermo<foam::hcons tthermo<foam::perfectgas> > > > > >::New(Foam::fvMesh const&) in "/ric_home/ep4/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libbasicThermophysicalM odels.so"
#6 Foam::basicThermo::New(Foam::fvMesh const&) in "/ric_home/ep4/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libbasicThermophysicalM odels.so"
#7 main in "/ric_home/ep4/OpenFOAM/OpenFOAM-1.5/applications/bin/linux64GccDPOpt/buoyantFoa m"
#8 __libc_start_main in "/lib64/tls/libc.so.6"
#9 Foam::regIOobject::readIfModified() in "/ric_home/ep4/OpenFOAM/OpenFOAM-1.5/applications/bin/linux64GccDPOpt/buoyantFoa m"

checkMesh gives me: Mesh OK. I use the function mapFields to obtain my initial fields, interpolating the fields of an other simulation.
What kind of error is it? Could someone give me a tip?

Thanks

Bastien

gschaider January 19, 2009 10:54

Hi Bastien! That does not l
 
Hi Bastien!

That does not look like a problem of snappy to me. The problem happens during the initialization of the thermophysical solver. It would have been nice if you had provided us with the information which solver you are using, but from the type of the error it must be a compressible one. One very popular mistake with those is that p=0 somewhere (either internal or boundary). When OF tries to calculate rho (using the perfect gas relation) it dies with a division by zero.

Have a look at your intial conditions (either with a text editor or paraFoam)

Bernhard

bholbek January 20, 2009 06:24

Hi, Thank you for your answ
 
Hi,

Thank you for your answer. Actually, what makes me think that it could be a problem with snappyHexMesh is that i have run successfully the same simulation on an other mesh.
I just create a new mesh, it means, i replace the polymesh directory and i run exactly the same simulation. I have also to say that i use the mapFields utility with the "-consistent" option, to interpolate the results of a "buoyantSimpleFoam" run. Maybe is there something wrong?

I'm using buoyantFoam solver. It's a transient simulation. I'm trying to modify the mesh because i have high courant numbers, only around my inlet. My mean courant number is really lower. Actually, i impose a quite high velocity on an inlet, which corresponds to one of my stl files for snappyHexMesh. SnappyHexMesh creates quite small cells around this inlet and then i have to use really small time steps so that my courant number is not too high and that my simulation runs fine.
Thus, i'm now trying to play with global or local refinement parameters to avoid small cells near my inlet. But maybe, is it not the good way to resolve my problem?

Any suggestions for these two problems?

Thank you

Bastien

bholbek January 23, 2009 04:48

HI, i'm still searching sol
 
HI,

i'm still searching solutions for my two problems (Post 20 January).
For the first one, i ahve found that the following error appears when i launch a simulation that i have initialized from a solution obtained on a different grid. If i initialize it with a simulation run on the same grid, i do not receive this error. For initialisations, i use the mapField utility with the option concistent.

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 400


Reading environmentalProperties
Reading thermophysical properties

Selecting thermodynamics package hThermo<puremixture<consttransport<speciethermo<hc onstthermo<perfectgas>>>>>
#0 Foam::error::printStack(Foam:http://www.cfd-online.com/OpenFOAM_D...part/proud.gifstream&) in "/ric_home/ep4/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libOpenFOAM.so"
#1 Foam::sigFpe::sigFpeHandler(int) in "/ric_home/ep4/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libOpenFOAM.so"
#2 __restore_rt at sigaction.c:0
#3 Foam::hThermo<foam::puremixture<foam::consttranspo rt<foam::speciethermo<foam::hc onstthermo<foam::perfectgas> > > > >::calculate() in "/ric_home/ep4/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libbasicThermophysicalM odels.so"
#4 Foam::hThermo<foam::puremixture<foam::consttranspo rt<foam::speciethermo<foam::hc onstthermo<foam::perfectgas> > > > >::hThermo(Foam::fvMesh const&) in "/ric_home/ep4/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libbasicThermophysicalM odels.so"
#5 Foam::basicThermo::addfvMeshConstructorToTable<foa m::hthermo<foam::puremixture<f oam::consttransport<foam::speciethermo<foam::hcons tthermo<foam::perfectgas> > > > > >::New(Foam::fvMesh const&) in "/ric_home/ep4/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libbasicThermophysicalM odels.so"
#6 Foam::basicThermo::New(Foam::fvMesh const&) in "/ric_home/ep4/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libbasicThermophysicalM odels.so"
#7 main in "/ric_home/ep4/OpenFOAM/OpenFOAM-1.5/applications/bin/linux64GccDPOpt/buoyantFoa m"
#8 __libc_start_main in "/lib64/tls/libc.so.6"
#9 Foam::regIOobject::readIfModified() in "/ric_home/ep4/OpenFOAM/OpenFOAM-1.5/applications/bin/linux64GccDPOpt/buoyantFoa m"
Gleitkomma-Ausnahme

Any ideas?

Thank you

Bastien

norman1981 February 5, 2009 05:25

Hi, we are trying to simula
 
Hi,

we are trying to simulate a NACA foil 0012. We have just used blockMesh utility to generate a mesh and the simulatation run fine. Now we are trying to test the snappyHexMesh potentiality to study the same case but we are struggling to obtain a good quality mesh around the profile and this trouble has the drawback to substime the cd coefficient. We report next an image about the pressure field around naca's profile and an archive that contains the snappyHexMeshDict, blockMeshDict and naca.stl files we are using.

http://www.cfd-online.com/OpenFOAM_D...es/1/10979.jpg

http://www.cfd-online.com/OpenFOAM_D...hment_icon.gif snappyHexMeshDict

Is there someone that has any good idea about what we can do to improve our solution?

Thank you in advance

Best Regards

Norman

norman1981 February 5, 2009 05:31

Sorry the archive was too huge
 
Sorry the archive was too huge to be uploaded,

here are the blockMeshDict



and the naca.stl file



Thanks

Norman


All times are GMT -4. The time now is 00:51.