CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Dicretization schemes in LES (pitzDaily) (https://www.cfd-online.com/Forums/openfoam-solving/106700-dicretization-schemes-les-pitzdaily.html)

 owayz September 5, 2012 18:47

Dicretization schemes in LES (pitzDaily)

Hallo Foamers,
I am trying to do a compressible LES simulation of a cylinder at Re=10,000. And I am very confused about the fvSchemes settings in openfoam.
I have read it in many places that upwind schemes must be avoided as they are highly dissipative. Now I come to my question, in "tutorials/compressible/rhoPimpleFoam/les/pitzDaily" some divergence schemes are given as:

div(phi,U) Gauss filteredLinear2V 0.2 0;
div(phi,h) Gauss filteredLinear2 0.2 0;

Openfoam documentation says " filteredLinear2 --- Linear with filtering for high-frequency ringing"
I have 2 questions:
1-Well I don't know how would this effect the results if I simply select limitedLinear for div(phi,U) and div(phi,h)?
2-If I choose filteredLinear2 then what does the two numbers specify (i.e. 0.2 0) and how should I choose them?
Any help would be welcomed. If somebody could give me a pointer where I could read more about it, I would be very happy. :D
And if somebody could help me or guide me about setting fvSchemes specifically for LES I would be the happiest man on earth for some time.

Regards,
Awais

 Djub September 6, 2012 05:25

Hi,
My divSchemes are Gauss linear in general, but for div(phi,U) which is Gauss linearUpwindV grad(U); . By the way, I don't know why I am using this!!!
What I know is that the spatial schemes have to be centered; and the temporal scheme has to be of 2nd order (Crank-Nicholson 1/2 or Backward) (cf university of Chalmers). Eugene DeVillier promotes the use of Backward but I am not sure it is a good idea with large time steps.

 owayz September 6, 2012 09:18

Quote:
 Originally Posted by Djub (Post 380513) Hi, My divSchemes are Gauss linear in general, but for div(phi,U) which is Gauss linearUpwindV grad(U); . By the way, I don't know why I am using this!!! What I know is that the spatial schemes have to be centered; and the temporal scheme has to be of 2nd order (Crank-Nicholson 1/2 or Backward) (cf university of Chalmers). Eugene DeVillier promotes the use of Backward but I am not sure it is a good idea with large time steps. 'hope thie little things could help you...
Hi Julien,
My point of view is that using upwind schemes would produce high Dissipation so may be you should avoid using linearUpwind for grad(U) and instead simply use Gauss Linear for grad.
What is confusing for me is that how should we use filteredLinear and filteredLinearV, and when should we use them, because they are used in LES tutorials in openFoam specially for div(phi,U) and div(phi,h).
So if you have any idea about it?. :)
Regards,
Awais

 Djub September 26, 2012 05:36

Hi Owayz,
I agree with you: I have red that upWind schemes were "forbidden" in LES cases because thay add viscosity. So I tried to change my scheme, replacing
by
div(phi,U) Gauss linear;
But now, that DOES NOT WORK AT ALL! The flow is awful , the mesh appears:
http://www.cfd-online.com/Forums/mem...uss-linear.png

So I prefer to keep Gauss linearUpwindV grad(U);.

 owayz September 26, 2012 09:16

Hi Djub
Well, it could be the problem with flow convergence or mesh refinement. Actually I tried linear scheme for all my terms (i.e. div, laplacian, grad) in fvSchemes and it works for me.
May be you can share your case?
regards,
Awais

 Djub September 26, 2012 09:27

What do you mean by sharing my case? Do you want all my dictionnaries ?

 owayz September 26, 2012 14:01

Yes share the dictionary files, and if possible mesh as well.
Regards,
Awais

 Djub September 27, 2012 04:48

Whoua... Let's go:

constant\polyMesh\blockMeshDict
Code:

vertices        (
(-1  -.7 0) (-.2  -.7 0) (.2  -.7 0) (1  -.7 0) (3  -.7 0)
(-1 -.05 0) (-.2 -.05 0) (.2 -.05 0) (1 -.05 0) (3 -.05 0)
(-1  .05 0) (-.2  .05 0) (.2  .05 0) (1  .05 0) (3  .05 0)
(-1  .7 0) (-.2  .7 0) (.2  .7 0) (1  .7 0) (3  .7 0)

(-1  -.7 .49) (-.2  -.7 .49) (.2  -.7 .49) (1  -.7 .49) (3  -.7 .49)
(-1 -.05 .49) (-.2 -.05 .49) (.2 -.05 .49) (1 -.05 .49) (3 -.05 .49)
(-1  .05 .49) (-.2  .05 .49) (.2  .05 .49) (1  .05 .49) (3  .05 .49)
(-1  .7 .49) (-.2  .7 .49) (.2  .7 .49) (1  .7 .49) (3 .7 .49)            );
blocks          (
hex  (0 1 6 5 20 21 26 25)  (56 45 25) simpleGrading (.50 .5  1)
hex  (1 2 7 6 21 22 27 26)  (40 45 25) simpleGrading ( 1  .5  1)
hex  (2 3 8 7 22 23 28 27)  (56 45 25) simpleGrading ( 2  .5  1)
hex  (3 4 9 8 23 24 29 28)  (62 45 25) simpleGrading (2.5 .5  1)
hex  (5 6 11 10 25 26 31 30)  (56 10 25) simpleGrading (.5  1  1)
hex  (7 8 13 12 27 28 33 32)  (56 10 25) simpleGrading ( 2  1  1)
hex  (8 9 14 13 28 29 34 33)  (62 10 25) simpleGrading (2.5  1  1)
hex (10 11 16 15 30 31 36 35) (56 45 25) simpleGrading (.50  2  1)
hex (11 12 17 16 31 32 37 36) (40 45 25) simpleGrading ( 1  2  1)
hex (12 13 18 17 32 33 38 37) (56 45 25) simpleGrading ( 2  2  1)
hex (13 14 19 18 33 34 39 38) (62 45 25) simpleGrading (2.5  2  1)      );
edges          ();
boundary      (
flux_entrant {
type inlet;
faces (      (0 20 25 5)
(5 25 30 10)
(10 30 35 15)  );    }
flux_sortant {
type outlet ;
faces (      (4 9 29 24)
(9 14 34 29)
(14 19 39 34)    );    }
le_sol {
type wall ;
faces (    (0 1 21 20)
(1 2 22 21)
(2 3 23 22)
(3 4 24 23)    );    }
le_plafond {
type wall ;
faces (  (15 35 36 16)
(16 36 37 17)
(17 37 38 18)
(18 38 39 19) );    }
Mur_gauche {
type wall ;
faces (    (5 6 1 0)
(6 7 2 1)
(7 8 3 2)
(8 9 4 3)
(10 11 6 5)
(12 13 8 7)
(13 14 9 8)
(15 16 11 10)
(16 17 12 11)
(17 18 13 12)
(18 19 14 13)    );    }
Mur_droit {
type symmetryPlane ;
faces (      (25 20 21 26)
(26 21 22 27)
(27 22 23 28)
(28 23 24 29)
(30 25 26 31)
(32 27 28 33)
(33 28 29 34)
(35 30 31 36)
(36 31 32 37)
(37 32 33 38)
(38 33 34 39)    );    }
le_cylindre {
type wall ;
faces (    (7 6 26 27)
(12 7 27 32)
(11 12 32 31)
(6 11 31 26)    );    }
);
mergePatchPairs
();

Note: excuse me for the French names of the patchs...

constant\LESProperties
Code:

LESModel        Smagorinsky;
delta          cubeRootVol;
printCoeffs    on;
cubeRootVolCoeffs
{
deltaCoeff      1;
}

system\controldict
Code:

application    pimpleFoam;
startFrom      latestTime;
startTime      0;
stopAt          endTime;
endTime        150;
deltaT          .001;
maxCo      10 ;
maxDeltaT      .1 ;
writeControl    timeStep;
writeInterval  1;
purgeWrite      20;
writeFormat    binary;
writePrecision  6;
writeCompression off;
timeFormat      general;
timePrecision  8;
runTimeModifiable true;

system\fvSchemes
Code:

ddtSchemes{
default        CrankNicholson .5;    }

default        Gauss linear;
grad(U)        cellLimited Gauss linear 1;      }

divSchemes{
default        none;
div(phi,U)      Gauss linearUpwindV grad(U); OR Gauss linear;

laplacianSchemes{
default        none;
laplacian(nuEff,U) Gauss linear corrected;
laplacian((1|A(U)),p) Gauss linear corrected;

interpolationSchemes{
default        linear;}

default        corrected;}

fluxRequired{
default        no;
p              ;}

system\fvSolution

solvers{
p {
solver PCG;
preconditioner DIC;
tolerance 1e-06;
relTol 0.01; }
pFinal {
solver PCG;
preconditioner DIC;
tolerance 1e-06;
relTol 0; }
U {
solver PBiCG;
preconditioner DILU;
tolerance 1e-05;
relTol 0; }
U final {
solver PBiCG;
preconditioner DILU;
tolerance 1e-05;
relTol 0; } }
PIMPLE {
nOuterCorrectors 2;
nCorrectors 2;
nNonOrthogonalCorrectors 1;
pRefCell 0;
pRefValue 0; }
cache {

0/U
Code:

dimensions      [ 0 1 -1 0 0 0 0 ];
initValue    uniform (3.3 0 0);
internalField    \$initValue;
boundaryField{
flux_entrant    {
type            fixedValue;
value          \$initValue;    }
flux_sortant    {
type            inletOutlet;
inletValue      uniform ( 0 0 0 );
value          \$initValue;    }
le_sol    {
type            fixedValue;
value          uniform ( 0 0 0 );    }
le_plafond    {
type            fixedValue;
value          uniform ( 0 0 0 );    }
Mur_gauche    {
type            fixedValue;
value          uniform ( 0 0 0 );    }
Mur_droit    {
type            symmetryPlane;    }
le_cylindre    {
type            fixedValue;
value          uniform ( 0 0 0 );    }
}

0/p
Code:

dimensions      [ 0 2 -2 0 0 0 0 ];
internalField  uniform 0;
boundaryField{
flux_entrant    {
flux_sortant    {
type            fixedValue;
value          uniform 0;    }
le_sol    {
le_plafond    {
Mur_gauche    {
Mur_droit    {
type            symmetryPlane;    }
le_cylindre    {
}

0/nuSgs
Code:

dimensions      [ 0 2 -1 0 0 0 0 ];
initValue      uniform .1;
internalField  \$initValue;
boundaryField{
flux_entrant  {
type            fixedValue;
value          \$initValue;    }
flux_sortant    {
type            calculated;    }
le_sol    {
type            kqRWallFunction;
value          \$initValue;    }
le_plafond    {
type            kqRWallFunction;
value          \$initValue;    }
Mur_gauche    {
type            kqRWallFunction;
value          \$initValue;    }
Mur_droit    {
type            symmetryPlane;    }
le_cylindre    {
type            kqRWallFunction;
value          \$initValue;    }
}

Note: I know these kqRWallFunction are out of interest here.

Of course, there are some other files, but nothing interesting (but nu=1.5e-5). About the fvSchemes: what do you think about LUST ?

 owayz September 27, 2012 07:12

I will try to run the case.
I myself don't have much idea about LUST scheme, haven't used it.
openFOAM actually advises to use LUST in case the mesh is highly unstructured (and quality is not good). If you look into the LUST its a blending of linear and linearUpwind. The blending factor of 0.75 (for linear) is hard coded which they say is optimized for a range of mesh quality.
But with a blending of linearUpwind (2nd order upwind), it will also add some damping.
LUST is being used in motorbike tutorial of openFOAM.
Regards,
Awais

 alberto September 28, 2012 02:30

The choice of the scheme for LES should be based on the numerical diffusion it introduces. Ideally you should use linear, or cubic. You need good and prett uniform mesh anyways for LES, since you are assuming the filter operator and the differential operator are commutative, which is not true on non-uniform grids!
The filtered schemes are a last resort scheme in my view, if you can't really do better with your mesh. Upwind and linearUpwind, but also limitedLinear and QUICK should be avoided because they are too dissipative.

For the time scheme, backward is the prmary choice among the schemes available in OF. The constraint on he time step is generally not an issue in LES because you are tied by the requirement of resolving the flow large-scale time scales.

Best,

 Djub September 28, 2012 03:48

Thanks !

Thanks a lot Alberto. Your explainations are so simple, accurate and efficient! Respect...
Nevertheless, I am quite surprised because I have been using linearUpwind since some months, and it seems to work well. At least for these "simple" cases of a rectangluar rod in a uniform flow (similar to BARC if you know), in which I am interested for vortex shedding (Von Karman Alley). Do you think I could have a bias in the vortex shedding frequency, due to the artificial dissipation introduced by linearUpwind ?

PS: Thanks a lot also for GeekoCFD. While installing my Foam, you were my Saviour !

 Djub October 1, 2012 09:02

(picture added on post #4 : http://www.cfd-online.com/Forums/ope...tml#post383679 )

 alberto October 1, 2012 14:15

Hi Julien, since you are interested in accurate and detailed solutions, you should really use the "linear" scheme. This scheme requires the cell Re < 2, so you will have to use a refined mesh, which is anyways necessary when you do LES (of course it might be an issue if your Re is very high).

Best,

 Djub October 2, 2012 03:58

Hi Alberto,
I really do not understand:
- linearUpwind seems to work, when linear does not (is my picture a kind of "staggering"? I am quite new in CFD and my vocabulary is still poor). Why ??? Let suppose it is not working properly, giving wrong results. How to control this? How to be sure my solution is working well? Fields are pretty nice, vortex sheddind has a good frequency... What is wrong?
- why does LES need a fine mesh? Small eddies have not to be resolved! Thus, I supposed a coarse mesh is enough to describe large structures, while my SGS is modelling finer eddies...

In order to "tune" the size of my cells, I thought about the link between time and space: I am thinking about Strouhal number, which is commonly around 0.2 (for a cylinder for example). Thus, an eddy of size dx should "vibrate" at a frequency of nu=St.U/dx . With St=.2, this succeeds to a mean current number of about Co=5 (=St^-1). My mesh is based on these considerations.

My mesh is designed with a Co=5, about 1cm. You advice me to use Re=2. In my case, this leads to 0,1 mm. 100 times coarser, and thus a cell number 1 000 000 times larger :eek: !?!? I thought this kind of simulation was called DNS, not LES !:confused:

 alberto October 2, 2012 11:55

Quote:
 Originally Posted by Djub (Post 384462) Hi Alberto, I really do not understand: - linearUpwind seems to work, when linear does not (is my picture a kind of "staggering"? I am quite new in CFD and my vocabulary is still poor). Why ??? Let suppose it is not working properly, giving wrong results. How to control this? How to be sure my solution is working well? Fields are pretty nice, vortex sheddind has a good frequency... What is wrong?
The linear scheme is conditionally stable. You need the cell Re < 2. Please refer to a CFD book for this (Ferziger and Peric discuss this, for example).

Quote:
 - why does LES need a fine mesh? Small eddies have not to be resolved! Thus, I supposed a coarse mesh is enough to describe large structures, while my SGS is modelling finer eddies...
This is quite basic. The idea behind LES is that you resolve directly the large non-isotropic scales, and you model the smallest isotropic ones. In true LES you must have a filter size that falls in the inertial sub-range, in order to achieve this result (Please, see Pope's book).

Quote:
 My mesh is designed with a Co=5, about 1cm. You advice me to use Re=2. In my case, this leads to 0,1 mm. 100 times coarser, and thus a cell number 1 000 000 times larger :eek: !?!? I thought this kind of simulation was called DNS, not LES !:confused:
Welcome to the confusion constantly affecting CFD communities :D
A DNS is technically a simulation where all the turbulent scales are directly resolved. In other words you resolve directly from the largest scale, down to the Kolmogorov microscale.
An LES is less demanding in terms of grid resolution, because the isotropic scales are not resolved directly, so you can use a coarser mesh. Coarser however does not mean as coarse as you want. The requirement is that your filter size (typically the cubic root of your cell volume) corresponds to to a frequency that falls in the inertial sub-range of the spectrum.

About the schemes, in practical applications the linear scheme might have too stringent requirements. In such a case, some authors suggest to use the bounded QUICK, which is however known to be too dissipative for LES, due to its upwind nature. If you really can't use a central scheme (linear, cubic, ...), I would start looking at filtered schemes before considering others.

Best,

 cfdonline2mohsen November 20, 2012 04:36

Quote:
 Originally Posted by alberto (Post 383996) The choice of the scheme for LES should be based on the numerical diffusion it introduces. Ideally you should use linear, or cubic. You need good and prett uniform mesh anyways for LES, since you are assuming the filter operator and the differential operator are commutative, which is not true on non-uniform grids! The filtered schemes are a last resort scheme in my view, if you can't really do better with your mesh. Upwind and linearUpwind, but also limitedLinear and QUICK should be avoided because they are too dissipative. For the time scheme, backward is the prmary choice among the schemes available in OF. The constraint on he time step is generally not an issue in LES because you are tied by the requirement of resolving the flow large-scale time scales. Best,
Dear Alberto
Thanks for your useful guide regarding different schemes in LES.
I have a question: you said that " Upwind and linearUpwind, but also limitedLinear and QUICK should be avoided because they are too dissipative"
I know that Upwind and linearUpwind produce high dissipation and must be avoided.
But what about QUICK and TVD schemes (e.g. limitedLinear & vanLeer)? are they dissipative too?(Please introduce me a reference about dissipation in QUICK and TVD schemes!!)
Then the only choice that remains is Centred schemes (e.g. linear, cubicCorrection, midPoint) but they are all unbounded.
The question is "what scheme should be used for divSchemes that guaranties both boundedness and accuracy and also has not been too much dissipative? "

I have used the following Schemes for my case (twoLiquidMixingFoam) in LES:

ddtSchemes
{
default backward;
}

{
default Gauss linear;
}

divSchemes
{
default none;
div(rho*phi,U) Gauss linear;
div(phi,alpha1) Gauss vanLeer01; // to bound the vanLeer scheme strictly between 0 and 1 to avoid negative and higher than 1 alpha

div(phi,k) Gauss limitedLinear 1;
div(phi,B) Gauss limitedLinear 1;
div(B) Gauss linear;
div(phi,nuTilda) Gauss limitedLinear 1;
}

laplacianSchemes
{
default Gauss linear corrected;
}

interpolationSchemes
{
default linear;
}

{
default corrected;
}

fluxRequired
{
default no;
p_rgh;
alpha1;
}

Since we had negative or higher than 1 values for alpha we have to bound it using Gauss vanLeer01 and of course Gauss limitedLinear 1 for div(phi,k).

Mohsen

 openfoammaofnepo January 29, 2015 09:41

Dear Owayz,

I am also interested in try the scheme "filteredLinear2V" in the LES. Do you know what they mean about the parameters 0.2 and 0? Do you have any experience in selecting them? Thank you very much.

best regards,
OFFO

Quote:
 Originally Posted by owayz (Post 380559) Hi Julien, My point of view is that using upwind schemes would produce high Dissipation so may be you should avoid using linearUpwind for grad(U) and instead simply use Gauss Linear for grad. What is confusing for me is that how should we use filteredLinear and filteredLinearV, and when should we use them, because they are used in LES tutorials in openFoam specially for div(phi,U) and div(phi,h). So if you have any idea about it?. :) Regards, Awais

 openfoammaofnepo March 26, 2016 09:50

I think LUST can be used for LES with OpenFOAM solvers. It is available OF2.1.0 and is described as:

=====================================
Linear-upwind stabilised transport
Linear-upwind stabilised transport (LUST) is a new interpolation schemes in which linear-upwind is blended with linear interpolation to stabilise solutions while maintaining second-order behaviour. The scheme is proving particularly successful for LES/DES in complex geometries with complex unstructured meshes, e.g. external aerodynamics of vehicles.
=====================================

The blending is harded coded as
Code:

0.75*this->mesh().surfaceInterpolation::weights()
+ 0.25*linearUpwind<Type>::weights();

In OF3.0.1, it has been used for the following tutorials:

Code:

incompressible/shallowWaterFoam/squareBump/system/fvSchemes:30:    div(phiv,hU)    Gauss LUST un;

Quote:
 Originally Posted by owayz (Post 383898) I will try to run the case. I myself don't have much idea about LUST scheme, haven't used it. openFOAM actually advises to use LUST in case the mesh is highly unstructured (and quality is not good). If you look into the LUST its a blending of linear and linearUpwind. The blending factor of 0.75 (for linear) is hard coded which they say is optimized for a range of mesh quality. But with a blending of linearUpwind (2nd order upwind), it will also add some damping. LUST is being used in motorbike tutorial of openFOAM. Regards, Awais

 ykanani August 3, 2016 00:32

Quote:
 Originally Posted by openfoammaofnepo (Post 529527) Dear Owayz, I am also interested in try the scheme "filteredLinear2V" in the LES. Do you know what they mean about the parameters 0.2 and 0? Do you have any experience in selecting them? Thank you very much. best regards, OFFO
from filteredLinear2V.H (k_ is the first parameter and l_ is the second):

Code:

// Scaling corefficient for the gradient ratio,
// 0 = linear
// 1 = fully limited
scalar k_;

// Maximum allowed overshoot/undershoot relative to the difference
// across the face.
// On input:
//    0 = no overshoot/undershoot
//    1 = overshoot/undershoot equal to the difference across the face
// Note: After input 1 is added to l_
scalar l_;

 All times are GMT -4. The time now is 03:48.