CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (http://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   OpenFOAM - structured or unstructured Grids ? (http://www.cfd-online.com/Forums/openfoam-meshing/75572-openfoam-structured-unstructured-grids.html)

thomasduerr April 29, 2010 03:15

OpenFOAM - structured or unstructured Grids ?
 
Hi everybody,

For a change, I have a more general question to the community:
I have been using OpenFOAM now for about 1 year and we were running in massive trouble using unstructured grids (non isothermal). We have heard now that most applications are actually on structured grids and that OF actually in reality needs structured grids.

Can you confirm that? Isn't there anybody who runs complex geometries on unstructured grids?
For us this would mean that we need to think about the use of an improved snappyHexMesher.

Thanks a lot to you all,
Thomas

olesen April 30, 2010 02:24

Quote:

Originally Posted by thomasduerr (Post 256787)
We have heard now that most applications are actually on structured grids and that OF actually in reality needs structured grids.

Where did you hear this misinformation? OpenFOAM definitely handles unstructured grids. Indeed it handles arbitrary polyhedral meshes http://www.openfoam.com/docs/user/me...#x23-1260005.1
Of course, a tet mesh may still give you problems.

Quote:

Isn't there anybody who runs complex geometries on unstructured grids?
How do you define a "complex geometry"?
Do the geometries pictured on page 20 of the following document qualify? http://www.opensourcecfd.com/conference2009/proceedings/documents/Session%20III/OSCIC2009_Hinterberger.pdf

alberto April 30, 2010 11:39

Quote:

Originally Posted by thomasduerr (Post 256787)
Hi everybody,

For a change, I have a more general question to the community:
I have been using OpenFOAM now for about 1 year and we were running in massive trouble using unstructured grids (non isothermal). We have heard now that most applications are actually on structured grids and that OF actually in reality needs structured grids.

As Mark said, OF can deal with polyhedral grids. You're probably referring to some discussion where using tetrahedral grids problems appeared.
OpenFOAM is, in my experience, quite sensitive to the mesh quality, so you need to be a bit careful when generating the grid to avoid very skewed cells. Many of the users I saw reporting problems were using salomé or gmsh to generate their grid. They're good tools, but, in my experience, their meshing capabilities are not always the best for finite-volume codes.

Quote:

Can you confirm that? Isn't there anybody who runs complex geometries on unstructured grids?
For us this would mean that we need to think about the use of an improved snappyHexMesher.
Yes, many. Just take a look at the slides of workshops and conferences about OpenFOAM.

Best,

thomasduerr May 3, 2010 05:06

Yes, we saw that there was some discussion about problems with tetras, we are using the commercial mesher Centaur to generate the mesh and have some problems in particular with high aspect ratio cells...

We have also seen that OF can handle polyheder meshes, however the background of my question was that we heard that most industry projects with OF generally use an improved snappyHexMesher to generate robust meshes since OF is so sensitive to mesh quality.

@Mark, yes on page 20, those would be complex geometries.

I guess the iteration process to generate a good, unstructured OF mesh will just take a little bit longer...

egp May 3, 2010 07:14

For unstructured meshes with high skewness, I've seen that choice of schemes is quite important. I might recommend fvScheme settings (for simpleFoam with kOmegaSST_lowRe) such as:

//************************************************** ******

ddtSchemes
{
default steadyState;
}

gradSchemes
{
default cellLimited leastSquares 1.0;
}

divSchemes
{
default none;
div(phi,U) Gauss reconCentral cellLimited leastSquares 1.0;
div(phi,k) Gauss vanLeerDC;
div(phi,omega) Gauss vanLeerDC;
div(R) Gauss linear;
div((nuEff*dev(grad(U).T()))) Gauss linear;
}

laplacianSchemes
{
default none;
laplacian(nuEff,U) Gauss linear limited 0.5;
laplacian((1|A(U)),p) Gauss linear limited 0.5;
laplacian(DkEff,k) Gauss linear limited 0.5;
laplacian(DomegaEff,omega) Gauss linear limited 0.5;
laplacian(1,p) Gauss linear corrected;
}

interpolationSchemes
{
default reconCentral phi leastSquares;
interpolate(U) reconCentral phi leastSquares;
}

snGradSchemes
{
default limited 0.5;
}

fluxRequired
{
default no;
p ;
}

//************************************************** ******


FYI: you will need to use 1.5-dev with these settings (reconCentral doesn't exist in 1.6.x).

Ramnik July 1, 2010 05:45

Hellp epg,

Can u please suggest similar schemes for unstructured mesh for openFoam1.6x.

Thanks in Advance
Ramnik

egp July 1, 2010 05:51

Ramnik,

If you want advanced functionality such as the reconCentral scheme, I would advise that you use the OpenFOAM-extend version. There is significant capability there that doesn't exist in 1.6.x or 1.7.

Ramnik July 1, 2010 06:18

2 Attachment(s)
Egp,

Changing the version is not possible as i am required to show my results for 1.6.

I am running a 3D simulation for an emptying process of a surge tank design using interfoam. I have an unstructured grid and i have been facing this problem for a very long time now. The Courant's number jumps to a very high value suddenly.

the mesh check is completely ok except around 230 non-orthogonal faces.

here is the error
Quote:

Courant Number mean: 0.000727639 max: 0.505194
deltaT = 0.000700614
Time = 6.09586

MULES: Solving for alpha1
Liquid phase volume fraction = 0.882692 Min(alpha1) = -1.04471e-26 Max(alpha1) = 1.0017
MULES: Solving for alpha1
Liquid phase volume fraction = 0.882691 Min(alpha1) = -1.94937e-26 Max(alpha1) = 1.0017
DICPCG: Solving for p, Initial residual = 8.64688e-05, Final residual = 4.06583e-06, No Iterations 10
DICPCG: Solving for p, Initial residual = 4.95736e-05, Final residual = 2.44067e-06, No Iterations 49
DICPCG: Solving for p, Initial residual = 3.388e-05, Final residual = 9.60513e-08, No Iterations 393
time step continuity errors : sum local = 5.02498e-11, global = 5.25651e-13, cumulative = 3.27921e-06
smoothSolver: Solving for epsilon, Initial residual = 0.00107067, Final residual = 2.84845e-10, No Iterations 2
smoothSolver: Solving for k, Initial residual = 0.000243268, Final residual = 2.27668e-11, No Iterations 2
ExecutionTime = 19025.8 s ClockTime = 19573 s

Courant Number mean: 0.000717944 max: 0.504811
deltaT = 0.000691189
Time = 6.09656

MULES: Solving for alpha1
Liquid phase volume fraction = 0.88269 Min(alpha1) = -1.94937e-26 Max(alpha1) = 1.0017
MULES: Solving for alpha1
Liquid phase volume fraction = 0.882689 Min(alpha1) = -6.94741e-27 Max(alpha1) = 1.0017
DICPCG: Solving for p, Initial residual = 9.61413e-05, Final residual = 4.61993e-06, No Iterations 16
DICPCG: Solving for p, Initial residual = 5.59775e-05, Final residual = 2.57609e-06, No Iterations 19
DICPCG: Solving for p, Initial residual = 2.65742e-05, Final residual = 9.36751e-08, No Iterations 191
time step continuity errors : sum local = 4.70235e-11, global = -9.4174e-14, cumulative = 3.27921e-06
smoothSolver: Solving for epsilon, Initial residual = 0.0010941, Final residual = 2.90639e-10, No Iterations 2
smoothSolver: Solving for k, Initial residual = 0.000243594, Final residual = 2.29966e-11, No Iterations 2
ExecutionTime = 19051.5 s ClockTime = 19599 s

Courant Number mean: 0.000708467 max: 0.504495
deltaT = 0.000685017
Time = 6.09724

MULES: Solving for alpha1
Liquid phase volume fraction = 0.882688 Min(alpha1) = -6.33288e-27 Max(alpha1) = 1.0017
MULES: Solving for alpha1
Liquid phase volume fraction = 0.882687 Min(alpha1) = -2.79288e-26 Max(alpha1) = 1.0017
DICPCG: Solving for p, Initial residual = 8.89488e-05, Final residual = 4.39486e-06, No Iterations 49
DICPCG: Solving for p, Initial residual = 7.38401e-05, Final residual = 3.55002e-06, No Iterations 29
DICPCG: Solving for p, Initial residual = 3.7267e-05, Final residual = 9.31492e-08, No Iterations 217
time step continuity errors : sum local = 4.69723e-11, global = -1.33004e-12, cumulative = 3.27921e-06
smoothSolver: Solving for epsilon, Initial residual = 0.00112341, Final residual = 3.04919e-10, No Iterations 2
smoothSolver: Solving for k, Initial residual = 0.000245285, Final residual = 2.38875e-11, No Iterations 2
ExecutionTime = 19081.9 s ClockTime = 19629 s

Courant Number mean: 0.000702325 max: 0.506536
deltaT = 0.000675924
Time = 6.09792

MULES: Solving for alpha1
Liquid phase volume fraction = 0.882687 Min(alpha1) = -1.89938e-26 Max(alpha1) = 1.0017
MULES: Solving for alpha1
Liquid phase volume fraction = 0.882686 Min(alpha1) = -1.42845e-26 Max(alpha1) = 1.0017
DICPCG: Solving for p, Initial residual = 0.000106261, Final residual = 5.31081e-06, No Iterations 9
DICPCG: Solving for p, Initial residual = 5.51595e-05, Final residual = 2.71885e-06, No Iterations 21
DICPCG: Solving for p, Initial residual = 2.47782e-05, Final residual = 9.58574e-08, No Iterations 221
time step continuity errors : sum local = 4.62714e-11, global = 8.75967e-13, cumulative = 3.27921e-06
smoothSolver: Solving for epsilon, Initial residual = 0.00115054, Final residual = 3.11431e-10, No Iterations 2
bounding epsilon, min: -0.700262 max: 2173.43 average: 0.23601
smoothSolver: Solving for k, Initial residual = 0.000247784, Final residual = 2.41797e-11, No Iterations 2
ExecutionTime = 19109.2 s ClockTime = 19657 s

Courant Number mean: 0.000693187 max: 0.506359
deltaT = 0.00066703
Time = 6.09858

MULES: Solving for alpha1
Liquid phase volume fraction = 0.882685 Min(alpha1) = -1.25557e-26 Max(alpha1) = 1.0017
MULES: Solving for alpha1
Liquid phase volume fraction = 0.882684 Min(alpha1) = -1.06496e-26 Max(alpha1) = 1.0017
DICPCG: Solving for p, Initial residual = 1, Final residual = 0.0443623, No Iterations 144
DICPCG: Solving for p, Initial residual = 0.654218, Final residual = 0.0322806, No Iterations 14
DICPCG: Solving for p, Initial residual = 0.431166, Final residual = 9.76228e-08, No Iterations 824
time step continuity errors : sum local = 0.129724, global = 0.000486648, cumulative = 0.000489928
smoothSolver: Solving for epsilon, Initial residual = 1, Final residual = 9.40959e-09, No Iterations 42
smoothSolver: Solving for k, Initial residual = 1, Final residual = 2.07907e-11, No Iterations 3
ExecutionTime = 19191.8 s ClockTime = 19739 s

Courant Number mean: 671044 max: 1.52481e+11
[1] [2] [0] ###0 00Foam::error::printStack(Foam::Ostream&) Foam::error::printStack(Foam::Ostream&) Foam::error::printStack(Foam::Ostream&)
And the residuals

Attachment 3959

Can u please have a look and suggest solution

Regards
Ramnik

alberto July 1, 2010 12:38

Could you publish your fvScheme and fvSolution dictionaries?

Best,

alberto July 1, 2010 12:40

Quote:

Originally Posted by egp (Post 265249)
Ramnik,

If you want advanced functionality such as the reconCentral scheme, I would advise that you use the OpenFOAM-extend version. There is significant capability there that doesn't exist in 1.6.x or 1.7.

What does exactly reconCentral do?

Thanks,

alberto July 1, 2010 14:02

1 Attachment(s)
I answered myself, and compiled it for 1.7.x. You find it attached (wmake libso to build it, and then include it in controlDict), but I doubt this will fix the problems you are facing, so it would still be useful to see your numerical setup.

Best,

bastil July 2, 2010 18:39

Quote:

Originally Posted by alberto (Post 265323)
I answered myself, and compiled it for 1.7.x

I agree that choice of schemes is important for bad meshes. However, I al also onderwing what reconCentral and vanLeerDC exactly do?
Eric: How did you find these scheme-settings? I will give them a try.

Regards Bastian

alberto July 2, 2010 19:38

Quote:

Originally Posted by bastil (Post 265538)
However, I al also onderwing what reconCentral and vanLeerDC exactly do?

reconCentral computes the interpolated value on the face centroid introducing a correction based on the gradient on both sides of the face, which is pretty widespread practice.

vanLeerDC is the vanLeer scheme with deferred correction.

I never used them in OF since they're not in the 1.7.x, but I am a bit doubtful about the improvements they can bring on poor meshes. Sometime it is just easier to fix the mesh than waste time fiddling with schemes. You'll also gain in quality of the results.

Best,

bastil July 3, 2010 05:11

Quote:

Originally Posted by alberto (Post 265545)
reconCentral computes the interpolated value on the face centroid introducing a correction based on the gradient on both sides of the face, which is pretty widespread practice.

Thanks Alberto. So it is a modification of "linear" in terms that it still is cental differencing and second order?

anothr_acc April 27, 2012 08:00

Well, I'm interested in the reconCentral approach now, too. My openFoam is version 2.1.0 and I downloaded it for Ubuntu without building it. My questions are....

1) Is openFoam-ext still going? The website shows little / no forum activity that I could see.

2) Can I insert components from openFoam-ext into openFoam 2.1.0, given that I didn't build it?

3) Do openFoam-ext components find their way into openFoam after time or is it completely separate? (This seems a little odd, given the open/free nature of the code).

Best regards all,

Mark.

alberto April 27, 2012 11:07

Quote:

Originally Posted by anothr_acc (Post 357464)
Well, I'm interested in the reconCentral approach now, too. My openFoam is version 2.1.0 and I downloaded it for Ubuntu without building it. My questions are....

You can easily adapt reconCentral to OpenFOAM 2.1.x. There might be some changes required for the code to compile.

Quote:

1) Is openFoam-ext still going? The website shows little / no forum activity that I could see.
The project is active. I do not have a lot of information either on the progress, but probably it will be available after their workshop.

Quote:

2) Can I insert components from openFoam-ext into openFoam 2.1.0, given that I didn't build it?
It depends on what you need. Some parts are easily ported to the 2.1.x version, others are not as easy to adapt, since the two code trees are independent and developed by different people.

Quote:

3) Do openFoam-ext components find their way into openFoam after time or is it completely separate? (This seems a little odd, given the open/free nature of the code).
This has not happened until now.

Best,

greel October 16, 2012 14:59

Quote:

Originally Posted by alberto (Post 265323)
I answered myself, and compiled it for 1.7.x. You find it attached (wmake libso to build it, and then include it in controlDict), but I doubt this will fix the problems you are facing, so it would still be useful to see your numerical setup.

Best,

I´m trying to compile reconCentral in OF 2.0 but I´m not familiarized with the code and I don´t know which lines needs modifications. May you give some tips??
Thanks!

Andrés

Sirshendu April 5, 2013 06:18

Quote:

Originally Posted by egp (Post 257294)
For unstructured meshes with high skewness, I've seen that choice of schemes is quite important. I might recommend fvScheme settings (for simpleFoam with kOmegaSST_lowRe) such as:

//************************************************** ******

ddtSchemes
{
default steadyState;
}

gradSchemes
{
default cellLimited leastSquares 1.0;
}

divSchemes
{
default none;
div(phi,U) Gauss reconCentral cellLimited leastSquares 1.0;
div(phi,k) Gauss vanLeerDC;
div(phi,omega) Gauss vanLeerDC;
div(R) Gauss linear;
div((nuEff*dev(grad(U).T()))) Gauss linear;
}

laplacianSchemes
{
default none;
laplacian(nuEff,U) Gauss linear limited 0.5;
laplacian((1|A(U)),p) Gauss linear limited 0.5;
laplacian(DkEff,k) Gauss linear limited 0.5;
laplacian(DomegaEff,omega) Gauss linear limited 0.5;
laplacian(1,p) Gauss linear corrected;
}

interpolationSchemes
{
default reconCentral phi leastSquares;
interpolate(U) reconCentral phi leastSquares;
}

snGradSchemes
{
default limited 0.5;
}

fluxRequired
{
default no;
p ;
}

//************************************************** ******


FYI: you will need to use 1.5-dev with these settings (reconCentral doesn't exist in 1.6.x).

I want to use the vanLeerDC scheme. Where should I get it as it is not officially available in OpenFOAM?

Tobias Adam October 10, 2014 06:31

fv-schemes- unstructured- no extended ?
 
Hello everyone

What settings for unstructured Mesh do you prefer for people who don´t use the extended version of OpenFoam?

Greets
Tobi


All times are GMT -4. The time now is 22:10.