CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   why pimple foam used under relaxation in all iteration of pimple Loop ? (https://www.cfd-online.com/Forums/openfoam/121711-why-pimple-foam-used-under-relaxation-all-iteration-pimple-loop.html)

mechy August 4, 2013 02:04

why pimple foam used under relaxation in all iteration of pimple Loop ?
 
P { margin-bottom: 0.08in; } Hi all

the under relaxation factor is used in steady simulation for better convergencey and I think it can not be used in unsteady flow

in pimpleFoam1.6ext the under relaxation is not applied at the last iteration of pimple loop therefor its OK

but in pimpleFoam2.x in all iteration pimple loop the flow is under relaxed.

I will be so grateful if anybody can tell me that pimplefoam2.x is true or not ?

Regards

andre.weiner August 4, 2013 04:38

Hello,

Neither SIMPLE (where under-relaxation is applied) nor PISO (where its not necessary) is designed particularly for steady or unsteady flows. In unsteady RANS simlations you just solve to steady state for each timestep.
PIMPLE works the same as PISO, but you can start the iteration process from the beginning with the final results of the PISO-alorithm (so you can also use under-relaxation, but its not necessary).
This is a very short explanation, but i hope i could help you.

Best regards, Andre

mechy August 4, 2013 08:20

Quote:

Originally Posted by andre.weiner (Post 443685)
Hello,

Neither SIMPLE (where under-relaxation is applied) nor PISO (where its not necessary) is designed particularly for steady or unsteady flows. In unsteady RANS simlations you just solve to steady state for each timestep.
PIMPLE works the same as PISO, but you can start the iteration process from the beginning with the final results of the PISO-alorithm (so you can also use under-relaxation, but its not necessary).
This is a very short explanation, but i hope i could help you.

Best regards, Andre

under relaxation can not be used in final calculation of P and U in each time step
if we used URF we average the given P and U from current ddt and previous time step and it is not true

akidess August 5, 2013 03:58

Mechy you are right that in a transient simulation, you should not use underrelaxation on the final iteration (using PISO/PIMPLE). And thus, OpenFOAM doesn't :) In older OpenFOAM versions, you could see an "if" clause preventing underrelaxation on the last iteration (if I remember correctly). In newer versions, GeometricFields are smart:
Code:

00889 template<class Type, template<class> class PatchField, class GeoMesh>
00890 void Foam::GeometricField<Type, PatchField, GeoMesh>::relax()
00891 {
00892    word name = this->name();
00893
00894    if
00895    (
00896        this->mesh().data::template lookupOrDefault<bool>
00897        (
00898            "finalIteration",
00899            false
00900        )
00901    )
00902    {
00903        name += "Final";
00904    }
00905
00906    if (this->mesh().relaxField(name))
00907    {
00908        relax(this->mesh().fieldRelaxationFactor(name));
00909    }
00910 }


mechy August 5, 2013 04:18

Quote:

Originally Posted by akidess (Post 443828)
Mechy you are right that in a transient simulation, you should not use underrelaxation on the final iteration (using PISO/PIMPLE). And thus, OpenFOAM doesn't :) In older OpenFOAM versions, you could see an "if" clause preventing underrelaxation on the last iteration (if I remember correctly). In newer versions, GeometricFields are smart:
Code:

00889 template<class Type, template<class> class PatchField, class GeoMesh>
00890 void Foam::GeometricField<Type, PatchField, GeoMesh>::relax()
00891 {
00892    word name = this->name();
00893
00894    if
00895    (
00896        this->mesh().data::template lookupOrDefault<bool>
00897        (
00898            "finalIteration",
00899            false
00900        )
00901    )
00902    {
00903        name += "Final";
00904    }
00905
00906    if (this->mesh().relaxField(name))
00907    {
00908        relax(this->mesh().fieldRelaxationFactor(name));
00909    }
00910 }


thanks so much
you are right and it is true about p.relax()
what about UEqn.relax ?
in icoFoam the UEqn does not relaxed
but in pisoFoam and all iteration of pimpe loop it relaxed ?

do you know its reason ?

Best Regards

akidess August 5, 2013 05:16

Relaxing a fvMatrix is different. You boost the diagonal term for the linear solver and iterate until convergence. This should always be ok in my opinion, no matter what you do with the outer loops. If you really want to be careful, you can relax all outer iterations except the final one by using the appropriate settings in the fvSolution file (e.g. relax U, but not UFinal).

- Anton

mechy August 5, 2013 07:26

OK thanks
in pimpleFoam OF-1.6ext at last iteration of pimple loop the RF for UEqn is set to 1.
however, I agree with you

Best Regards

openfoammaofnepo August 5, 2013 15:59

Hi All,

In the OF211 tutorials, the under relaxation factors are still there in controls dictionary. So does it affect the relaxation of the outer loop (PIMPLE loops)? When nOuterCorrectors=1, the under-relaxation factor should be 1? Thank you very much for any comments.

Quote:

Originally Posted by andre.weiner (Post 443685)
Hello,

Neither SIMPLE (where under-relaxation is applied) nor PISO (where its not necessary) is designed particularly for steady or unsteady flows. In unsteady RANS simlations you just solve to steady state for each timestep.
PIMPLE works the same as PISO, but you can start the iteration process from the beginning with the final results of the PISO-alorithm (so you can also use under-relaxation, but its not necessary).
This is a very short explanation, but i hope i could help you.

Best regards, Andre


openfoammaofnepo August 19, 2013 19:32

Dear akidess,

So based on what you mentioned in this post, we can still use the under-relaxation for the unsteady simulations?

Besides, do you know the relation between under-relaxation factors and iteration times? Actually in openfoam, there seems no such criterions to judge if the solutions are convegent or not within one time step. For example, if I set nOuterCorrectors=5, the solutions are not convengent while if I set nOuterCorrectors=50, actually the solution will not be convengent either. So how to set the iteration times and reasonable under-relaxation factors?

Thank you very much.

Quote:

Originally Posted by ;443828
Mechy you are right that in a transient simulation, you should not use underrelaxation on the final iteration (using PISO/PIMPLE). And thus, OpenFOAM doesn't :) In older OpenFOAM versions, you could see an "if" clause preventing underrelaxation on the last iteration (if I remember correctly). In newer versions, GeometricFields are smart:
Code:

00889 template<class Type, template<class> class PatchField, class GeoMesh>
00890 void Foam::GeometricField<Type, PatchField, GeoMesh>::relax()
00891 {
00892    word name = this->name();
00893
00894    if
00895    (
00896        this->mesh().data::template lookupOrDefault<bool>
00897        (
00898            "finalIteration",
00899            false
00900        )
00901    )
00902    {
00903        name += "Final";
00904    }
00905
00906    if (this->mesh().relaxField(name))
00907    {
00908        relax(this->mesh().fieldRelaxationFactor(name));
00909    }
00910 }



akidess August 21, 2013 08:24

Yes, you should be able to use underrelaxation even in unsteady simulations. That's pretty much the idea of the PIMPLE algorithm as far as I know.

I'm not quite sure what you mean with the relation between URF and iteration times. Assuming you mean the number of iterations you'll need to get convergence and the URF minimizing that number, that's something you can't easily predict (if possible at all). PISO was developed with the goal to get rid of the underrelaxation necessary using SIMPLE, and thus attempting to achieve optimal convergence.

- Anton

Quote:

Originally Posted by openfoammaofnepo (Post 446773)
Dear akidess,

So based on what you mentioned in this post, we can still use the under-relaxation for the unsteady simulations?

Besides, do you know the relation between under-relaxation factors and iteration times? Actually in openfoam, there seems no such criterions to judge if the solutions are convegent or not within one time step. For example, if I set nOuterCorrectors=5, the solutions are not convengent while if I set nOuterCorrectors=50, actually the solution will not be convengent either. So how to set the iteration times and reasonable under-relaxation factors?

Thank you very much.


RodriguezFatz September 5, 2013 03:40

Hi,

When I use pimpleFoam with "nOuterCorrectors 1" setting, this should be the same as pisoFoam. But I figured out, that pimple doesn't seem to recognize the relaxationFactors I set. For pimple I get the same results as for piso with all relaxation factors set to 1. Do I have to tell pimple explicitly to use them?

Philipp.


Edit:
Ok, I solved it. To everyone who encounters this:

It seems, that pimpleFoam needs a declaration that looks like:
Code:

relaxationFactors
{
    fields
    {
        "p.*"          0.3;
        "nuSgs.*"      0.5;
    }
    equations
    {
        "U.*"          0.5;
        "k.*"          0.5;
        "omega.*"      0.5;
    }
}

Whereas pisoFoam also works with:
Code:

relaxationFactors
{
    fields
    {
        p              0.3;
        nuSgs          0.5;
    }
    equations
    {
        U              0.5;
        k              0.5;
        omega          0.5;
    }
}


galap March 20, 2014 04:31

Quote:

Originally Posted by RodriguezFatz (Post 450003)
Hi,

When I use pimpleFoam with "nOuterCorrectors 1" setting, this should be the same as pisoFoam. But I figured out, that pimple doesn't seem to recognize the relaxationFactors I set. For pimple I get the same results as for piso with all relaxation factors set to 1. Do I have to tell pimple explicitly to use them?

Philipp.


Edit:
Ok, I solved it. To everyone who encounters this:

It seems, that pimpleFoam needs a declaration that looks like:
Code:

relaxationFactors
{
    fields
    {
        "p.*"          0.3;
        "nuSgs.*"      0.5;
    }
    equations
    {
        "U.*"          0.5;
        "k.*"          0.5;
        "omega.*"      0.5;
    }
}

Whereas pisoFoam also works with:
Code:

relaxationFactors
{
    fields
    {
        p              0.3;
        nuSgs          0.5;
    }
    equations
    {
        U              0.5;
        k              0.5;
        omega          0.5;
    }
}


Be careful, the use of .* will force the solver to relax both fields and equations also in the final iteration. This should not be done in transient simulations.

use

"(p)"

instead

or

"(U|k|omega)"

RodriguezFatz March 20, 2014 07:36

Allright, I better change it in my original post! Thanks a lot.

... for some reason there is no "EDIT" button in that post, so I can't. Be carefull.

Tobias Adam June 24, 2014 10:33

As I understood: Piso=no underrelaxation,
Pimple= underrelaxation except for final iteration. Sometimes one does not need underrelaxation at all.
Does underrelaxation speed up pimple or just make it more stable?
Which values are usually used fur the underrelaxation and what kind of field is "nuSgs"? Do I need this one for incompressible flow with k-omega-modell?

Best regards Tobi

RodriguezFatz June 24, 2014 10:40

Hi Tobias,

The first two things are correct.
As far as I know, underrelaxation is always used to make an algorithm more stable. Sometimes it can happen that you become faster using it. But that is just by pure chance, because you "accidentally" hit the right value.
The last point: I wondered about that, too. I guess, only the actual variables (such as u, p, omega, k) will use the underrelaxation, but maybe someone can correct me. (Perhaps just run a case with and without it and see, if the residuals change).

Tobias Adam June 24, 2014 10:52

Thanks for your answer :-)

Firstly I´m going to try without nuSg.
Would you say, that the relaxation-factors from above are good, or would you use the factors used for simple:
p=0.3
(U|k|omega)=0.7

Best regards
Tobi

RodriguezFatz June 24, 2014 11:04

I normally run pimple and simple with the latter, but as I said: Just try. If it is not stable, you need to reduce. If it is stable it should usually converge faster the higher the underrelaxation factors are.

HanSolo123 June 25, 2014 04:14

Quote:

Originally Posted by Tobias Adam (Post 498456)
Which values are usually used fur the underrelaxation and what kind of field is "nuSgs"? Do I need this one for incompressible flow with k-omega-modell?

nuSGS is the turbulent viscosity for Large Eddy Simulations of incompressible flows.
Therefore you dont need it when using RANSE k-omega-modell.

RodriguezFatz June 25, 2014 04:16

Yes Hans, thats true, but what about setting a "nut" underrelaxation parameter? Does that have any influence ? And if so, why would you do that, if already "k" and "epsilon" or "k" and "omega" are underrelaxated.

HanSolo123 June 25, 2014 04:22

In k-omega model, nut is calculated from k and omega in an algebraic equation. So I think defining a relaxation factor for nut makes no sense.

Just my thoughts.


All times are GMT -4. The time now is 19:11.