CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   convergence of QUICK scheme - simpleFoam (https://www.cfd-online.com/Forums/openfoam-solving/117365-convergence-quick-scheme-simplefoam.html)

Luis Batista May 7, 2013 07:22

convergence of QUICK scheme - simpleFoam
 
1 Attachment(s)
Hello,

I am using SimpleFoam for a Laminar cavity flow model.

I am doing a grid refinement study and to improve my convergence, I want to use a higher order convection scheme QUICK.

The plotted residuals are not looking very nice and after I have changed the relaxation parameters, it seems that this is not being sensitive to my changes.

I here post my controlDict; fvSchemes and fvSolution and send plot the residuals in attachment.

Please help:)!

controlDict:

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application simpleFoam;

startFrom latestTime;

startTime 0;

stopAt endTime;

endTime 1000;

deltaT 1;

writeControl timeStep;

writeInterval 50;

purgeWrite 1;

writeFormat ascii;

writePrecision 12;

writeCompression off;

timeFormat general;

timePrecision 6;

runTimeModifiable true;


}

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


fvSchemes:

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

ddtSchemes
{
default steadyState;
}

gradSchemes
{
default Gauss linear;
grad(p) Gauss linear;
grad(U) Gauss linear;
}

divSchemes
{
default none;
div(phi,U) bounded Gauss QUICK;
div(phi,k) bounded Gauss upwind;
div(phi,epsilon) bounded Gauss upwind;
div(phi,R) bounded Gauss upwind;
div(R) Gauss linear;
div(phi,nuTilda) bounded Gauss upwind;
div((nuEff*dev(T(grad(U))))) Gauss linear;
}

laplacianSchemes
{
default none;
laplacian(nuEff,U) Gauss linear corrected;
laplacian((1|A(U)),p) Gauss linear corrected;
laplacian(DkEff,k) Gauss linear corrected;
laplacian(DepsilonEff,epsilon) Gauss linear corrected;
laplacian(DREff,R) Gauss linear corrected;
laplacian(DnuTildaEff,nuTilda) Gauss linear corrected;
}

interpolationSchemes
{
default linear;
interpolate(U) linear;
}

snGradSchemes
{
default corrected;
}

fluxRequired
{
default no;
p ;
}


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

fvSolution:

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

solvers
{
p
{
solver PCG;
preconditioner DIC;
tolerance 1e-6;
relTol 0.01;
}

U
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-5;
relTol 0.1;
}


}

SIMPLE
{
nNonOrthogonalCorrectors 0;
pRefCell 0;
pRefValue 0;


residualControl
{
p 1e-2;
U 1e-3;

}
}

relaxationFactors
{
fields
{
p 0.3;

}
equations
{
U 0.7;

}
}


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

Regards,
Luis Batista

Tushar@cfd May 7, 2013 08:30

Quote:

Originally Posted by Luis Batista (Post 425812)
Hello,

I am using SimpleFoam for a Laminar cavity flow model.

I am doing a grid refinement study and to improve my convergence, I want to use a higher order convection scheme QUICK.

The plotted residuals are not looking very nice and after I have changed the relaxation parameters, it seems that this is not being sensitive to my changes.

I here post my controlDict; fvSchemes and fvSolution and send plot the residuals in attachment.

Please help:)!



controlDict:

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application simpleFoam;

startFrom latestTime;

startTime 0;

stopAt endTime;

endTime 1000;

deltaT 1;

writeControl timeStep;

writeInterval 50;

purgeWrite 1;

writeFormat ascii;

writePrecision 12;

writeCompression off;

timeFormat general;

timePrecision 6;

runTimeModifiable true;


}

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


fvSchemes:

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

ddtSchemes
{
default steadyState;
}

gradSchemes
{
default Gauss linear;
grad(p) Gauss linear;
grad(U) Gauss linear;
}

divSchemes
{
default none;
div(phi,U) bounded Gauss QUICK;
div(phi,k) bounded Gauss upwind;
div(phi,epsilon) bounded Gauss upwind;
div(phi,R) bounded Gauss upwind;
div(R) Gauss linear;
div(phi,nuTilda) bounded Gauss upwind;
div((nuEff*dev(T(grad(U))))) Gauss linear;
}

laplacianSchemes
{
default none;
laplacian(nuEff,U) Gauss linear corrected;
laplacian((1|A(U)),p) Gauss linear corrected;
laplacian(DkEff,k) Gauss linear corrected;
laplacian(DepsilonEff,epsilon) Gauss linear corrected;
laplacian(DREff,R) Gauss linear corrected;
laplacian(DnuTildaEff,nuTilda) Gauss linear corrected;
}

interpolationSchemes
{
default linear;
interpolate(U) linear;
}

snGradSchemes
{
default corrected;
}

fluxRequired
{
default no;
p ;
}


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

fvSolution:

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

solvers
{
p
{
solver PCG;
preconditioner DIC;
tolerance 1e-6;
relTol 0.01;
}

U
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-5;
relTol 0.1;
}


}

SIMPLE
{
nNonOrthogonalCorrectors 0;
pRefCell 0;
pRefValue 0;


residualControl
{
p 1e-2;
U 1e-3;

}
}

relaxationFactors
{
fields
{
p 0.3;

}
equations
{
U 0.7;

}
}


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

Regards,
Luis Batista



It seems, your pressure is not converging after some time iterations. Well, for your particular problem case why don't you go for icoFoam (laminar).

simpleFoam is Steady-state solver for incompressible, turbulent flow.

As for the files are concerned it seems all OK to me. I think you are using the already available case files with OF.

:)

Luis Batista May 7, 2013 08:59

Quote:

Originally Posted by Tushar@cfd (Post 425829)
It seems, your pressure is not converging after some time iterations. Well, for your particular problem case why don't you go for icoFoam (laminar).

simpleFoam is Steady-state solver for incompressible, turbulent flow.

As for the files are concerned it seems all OK to me. I think you are using the already available case files with OF.

:)

Hello,

thanks for your support.

I share the same impression as you, that it, the pressure is not converging (and the velocities are also not converging monotonically).

About IcoFoam:

I am using SimpleFoam since from my previous experience with IcoFoam, I have not managed to use under-relaxation factors for p and U. I have tried to use them previously and the solution was not reacting at all. I concluded that the convergence cannot be controled in IcoFoam thry this. (please correct me if I am wrong).

From my POV, icoFoam is meant to produce a time-accurate solution and the only way to control the algorithm convergence is by the local linear system residual (there is no outer loop convergence criteria). (correct me if I am wrong).

Additionally, I also inform that the convergence problem herefound was also happening in Icofoam.

About simpleFoam:

With respect to the problem here reported, it seems that the QUICK scheme is always trying to solve the algorithm for a source term (maybe coming from deferrationīfrom previous time step)...I donīt know.

Did I add any further information that you find helpful to understand my problem?

thanks,
Luis

Tushar@cfd May 8, 2013 01:48

Quote:

Originally Posted by Luis Batista (Post 425835)
Hello,

thanks for your support.

I share the same impression as you, that it, the pressure is not converging (and the velocities are also not converging monotonically).

About IcoFoam:

I am using SimpleFoam since from my previous experience with IcoFoam, I have not managed to use under-relaxation factors for p and U. I have tried to use them previously and the solution was not reacting at all. I concluded that the convergence cannot be controled in IcoFoam thry this. (please correct me if I am wrong).

From my POV, icoFoam is meant to produce a time-accurate solution and the only way to control the algorithm convergence is by the local linear system residual (there is no outer loop convergence criteria). (correct me if I am wrong).

Additionally, I also inform that the convergence problem herefound was also happening in Icofoam.

About simpleFoam:

With respect to the problem here reported, it seems that the QUICK scheme is always trying to solve the algorithm for a source term (maybe coming from deferrationīfrom previous time step)...I donīt know.

Did I add any further information that you find helpful to understand my problem?

thanks,
Luis


You are correct, about both the IcoFoam & SimpleFoam solvers.
Since, you are using QUICK scheme then why don't you check with coarse mesh first, as the convergence depends on source term (deffered correction). If you are successful then try with fine mesh.
I would suggest you to try with different solver, may be it will be beneficial in getting convergence.

:)

fredo490 May 8, 2013 02:39

Why don't you use a linearUpwind Scheme ? It's the second order of the upwind scheme ;) You can also use the linearUpwindV that is the pure upwind scheme of linearUpwind (the difference is in the "V" at the end).

div(phi,U) bounded Gauss upwind;
becomes
div(phi,U) Gauss linearUpwind grad(U);

You can also put all your other scheme to second order. Be careful, the gradient term must have the corresponding variable (= the second variable in the div() that correspond to the one solved).

So div(phi,k) bounded Gauss upwind; becomes div(phi,k) Gauss linearUpwind grad(k);

Luis Batista May 8, 2013 04:55

Quote:

Originally Posted by Tushar@cfd (Post 425995)
You are correct, about both the IcoFoam & SimpleFoam solvers.
Since, you are using QUICK scheme then why don't you check with coarse mesh first, as the convergence depends on source term (deffered correction). If you are successful then try with fine mesh.
I would suggest you to try with different solver, may be it will be beneficial in getting convergence.

:)

Hello,

I have tried this scheme up to grid refinement ratios of 4, that is, from 50x50 up to 400x400. It is the same problem....

I believe I am going to try a different scheme for now, p.e., Linear Upwind and leave this issue for when I understand better how the deferred correction is working for QUICK scheme.

If you now where I can find this type of information please let me know.

Best Regards,
Luis

Luis Batista May 8, 2013 05:08

Quote:

Originally Posted by fredo490 (Post 426008)
Why don't you use a linearUpwind Scheme ? It's the second order of the upwind scheme ;) You can also use the linearUpwindV that is the pure upwind scheme of linearUpwind (the difference is in the "V" at the end).

div(phi,U) bounded Gauss upwind;
becomes
div(phi,U) Gauss linearUpwind grad(U);

You can also put all your other scheme to second order. Be careful, the gradient term must have the corresponding variable (= the second variable in the div() that correspond to the one solved).

So div(phi,k) bounded Gauss upwind; becomes div(phi,k) Gauss linearUpwind grad(k);

I appreciate your comment. I am really looking forward to move away (for now from QUICK) and already started to do some tests which duly converge as expected.

However, I have not implemented exactly as you wrote, let me recapitulate what I believe I now in order that you can give me a further push:)

div(phi,U) - means the discretization of the convection term where phi is denominates as flux of the dependent variable U thru velocitycell faces and U is the dependent variable (unknown).

so, I do no understand why you mention:
"
div(phi, U) Gauss linearUpwind grad(U);
"

1) Isnīt it enough to write?
"
div(phi, U) Gauss linearUpwind
"

fredo490 May 8, 2013 05:16

no it's not enough because the linearUpwind needs to know what is the direction of your "flow" or variable your study. The linearUpwind only consider the flow from where it comes and not from where it goes. Therefor you need to tell the scheme in which direction he needs to make the computation.

Originally you could write: "div(phi, U) Gauss linearUpwind phi" where phi tells the direction of the flow. But with the new versions of OpenFoam, people got use to write the gradient of the variable, which is the same as giving phi (the flux at the face).


I'm not sure if the solver accept "div(phi, U) Gauss linearUpwind". Maybe the scheme takes a default value defined as "phi". However, this is only true for the velocity scheme. For the other, you need to specify the corresponding flux (by using the gradient).

Luis Batista May 8, 2013 05:28

Quote:

Originally Posted by fredo490 (Post 426045)
no it's not enough because the linearUpwind needs to know what is the direction of your "flow" or variable your study. The linearUpwind only consider the flow from where it comes and not from where it goes. Therefor you need to tell the scheme in which direction he needs to make the computation.

Originally you could write: "div(phi, U) Gauss linearUpwind phi" where phi tells the direction of the flow. But with the new versions of OpenFoam, people got use to write the gradient of the variable, which is the same as giving phi (the flux at the face).


I'm not sure if the solver accept "div(phi, U) Gauss linearUpwind". Maybe the scheme takes a default value defined as "phi". However, this is only true for the velocity scheme. For the other, you need to specify the corresponding flux (by using the gradient).

:) Thanks. Your explanation is very clear.

Tushar@cfd May 8, 2013 09:19

Are you able to get convergence? @Luis

Thanks fredo, for your valuable post even I was not aware of these.

:)

Luis Batista May 11, 2013 17:35

Quote:

Originally Posted by Tushar@cfd (Post 426090)
Are you able to get convergence? @Luis

Thanks fredo, for your valuable post even I was not aware of these.

:)

Hello,

I am having success with LinearUpwind, however, I was expecting a better order of convergence...

Anyhow, I will try to run tests and see what are the variables that I must use to have convergence with QUICK.

Regards,
Luis


All times are GMT -4. The time now is 08:20.