CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   Tetra Mesh with interfoam (http://www.cfd-online.com/Forums/openfoam/92015-tetra-mesh-interfoam.html)

dsanza August 30, 2011 07:27

Tetra Mesh with interfoam
 
hi,
I am new with openfoam. I am simulating an open water channel with interfoam and due to complex geometry i would like to use a mesh with tetra cells. I copied the files from the breakdam k-epsilon tutorial and modified them to suit my case. When i try to simulate the channel with my mesh, the courant number becomes very big (e^15) and delta_t very small (e^-20). I supose i have something wrong in my fvSolution and/or fvSchemes.

FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

solvers
{
pcorr
{
solver PCG;
preconditioner DIC;
tolerance 1e-10;
relTol 0;
}

p_rgh
{
solver PCG;
preconditioner DIC;
tolerance 1e-07;
relTol 0.05;
}

p_rghFinal
{
solver PCG;
preconditioner DIC;
tolerance 1e-07;
relTol 0;
}

"(U|k|epsilon)"
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-06;
relTol 0;
}

"(U|k|epsilon)Final"
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-08;
relTol 0;
}
}

PIMPLE
{
momentumPredictor no;
nCorrectors 3;
nNonOrthogonalCorrectors 5;
nAlphaCorr 1;
nAlphaSubCycles 4;
cAlpha 2;
}
relaxationFactors
{
p 0.3;
U 0.85;
k 0.7;
epsilon 0.65;
R 0.7;
nuTilda 0.65;
}

----------------------------------

FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

ddtSchemes
{
default Euler;
}

gradSchemes
{
default Gauss linear;
}

divSchemes
{
div(rho*phi,U) Gauss limitedLinearV 1;
div(phi,alpha) Gauss vanLeer;
div(phirb,alpha) Gauss interfaceCompression;
div(phi,k) Gauss upwind;
div(phi,epsilon) Gauss upwind;
div(phi,R) Gauss upwind;
div(R) Gauss linear;
div(phi,nuTilda) Gauss upwind;
div((nuEff*dev(T(grad(U))))) Gauss linear;
}

laplacianSchemes
{
default Gauss linear corrected;
}

interpolationSchemes
{
default linear;
}

snGradSchemes
{
default corrected;
}

fluxRequired
{
default no;
p_rgh;
pcorr;
alpha;
}

as you can see, i already tried using nNonOrthogonalCorrectors and Relaxation Factors.

My checkMesh says everything is ok.

Any sugestuions as where my mistake might be?

thank you!

flowman August 30, 2011 20:22

I tried interFoam with a Tet mesh once before and the results were not great!

Have you tried using snappyHexMesh to automatically generate a predominantly Hex mesh? It can handle very complex geometries.

mgdenno August 30, 2011 21:23

I have used interFoam with a tet mesh with success before (for a 2D spillway case)...it seems to work fine for me. My fvSchemes and fvSolution files were very similar to yours (same as the dam break ones).

I have been using snappyHexMesh lately for recent 3D cases and it works very well.

What are your boundary conditions? Does it run at all before starting to blow up. How do you have alpha1 set using setFields?

MD

dsanza August 31, 2011 02:23

1 Attachment(s)
i will give snappyHexMesh a try, thanks for the advice!

and yes, alpha1 ist set with setfields. the simulation runs for about 0.02 seconds before blowing up.

i atached my bpundary conditions. i have no inlet, just an outlet, walls and the atmosphere.

maybe i defined k or epsilon wrong, it is the first time i am working with them.

thank you all for your help!

elvis August 31, 2011 02:30

Hi,

maybe you should give polyDualMesh for conversion of tetrahedral mesh to polyhedral mesh a try. http://www.openfoam.com/features/mesh-generation.php
=>can be used to generate a “honeycomb” polyhedral mesh from a tetrahedral mesh.
http://www.cfd-online.com/Forums/ope...h-utility.html
http://www.cfd-online.com/Forums/ope...eneration.html

mgdenno August 31, 2011 10:44

One way to tell if it is your turbulence inputs that are giving you trouble is to run as laminar flow.

To do so, in your constant/turbulenceProperties file set

simulationType laminar;

mgdenno August 31, 2011 12:02

You also might want to change your velocity outlet to inletOutlet, if that makes sense for your case.

dsanza September 1, 2011 06:59

in my case i wan to have a constant flow going out of the channel, that is the resason why i chose it as a fixed value.

when i start the simuilation, i do see some areas of the channel where the k factor of the turbulence model grows it then stabylizes, is it posible i defined them wrong? how are these factors defined at the beginning, i understand k and epsilon are then calculated throughout the simulation.

thank you for your help

mgdenno September 1, 2011 16:10

Just so I understand your case, you are starting your channel full of water and then it drains out during the simulation, eventually drying out?

The initial k values would either be set at the top of the 0/k file. I am not sitting at my OpenFOAM machine right now but I think it is something like:

internal uniform 0.1;

If you don't want it to be uniform you could set it using setFields...although I don't think that would be necessary to get it going.

Have you looked at the results for the first few tenths of a second that it is running with paraFOAM? Does it give any indication of where the problem might be?

Others on the Forum have suggested using totalPressure for the outlet in place of inletOutlet. I haven't seen much difference using totalPressure, but I always have used a velocity inlet - you might want to try totalPressure outlet.

If you can't get it going I would be happy to take a look at it if you can post the case. I don't really consider myself an expert, but I have had some success so far.

MD


All times are GMT -4. The time now is 02:43.