CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM

why pimple foam used under relaxation in all iteration of pimple Loop ?

Register Blogs Community New Posts Updated Threads Search

Like Tree28Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 4, 2013, 03:04
Default why pimple foam used under relaxation in all iteration of pimple Loop ?
  #1
Senior Member
 
Join Date: Jun 2011
Posts: 163
Rep Power: 15
mechy is on a distinguished road
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
mechy is offline   Reply With Quote

Old   August 4, 2013, 05:38
Default
  #2
New Member
 
Andre Weiner
Join Date: Aug 2012
Posts: 29
Rep Power: 14
andre.weiner is on a distinguished road
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
arashgmn likes this.
andre.weiner is offline   Reply With Quote

Old   August 4, 2013, 09:20
Default
  #3
Senior Member
 
Join Date: Jun 2011
Posts: 163
Rep Power: 15
mechy is on a distinguished road
Quote:
Originally Posted by andre.weiner View Post
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
fumiya likes this.
mechy is offline   Reply With Quote

Old   August 5, 2013, 04:58
Default
  #4
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30
akidess will become famous soon enough
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 }
__________________
*On twitter @akidTwit
*Spend as much time formulating your questions as you expect people to spend on their answer.
akidess is offline   Reply With Quote

Old   August 5, 2013, 05:18
Default
  #5
Senior Member
 
Join Date: Jun 2011
Posts: 163
Rep Power: 15
mechy is on a distinguished road
Quote:
Originally Posted by akidess View Post
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
mechy is offline   Reply With Quote

Old   August 5, 2013, 06:16
Default
  #6
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30
akidess will become famous soon enough
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
__________________
*On twitter @akidTwit
*Spend as much time formulating your questions as you expect people to spend on their answer.
akidess is offline   Reply With Quote

Old   August 5, 2013, 08:26
Default
  #7
Senior Member
 
Join Date: Jun 2011
Posts: 163
Rep Power: 15
mechy is on a distinguished road
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
mechy is offline   Reply With Quote

Old   August 5, 2013, 16:59
Question
  #8
Senior Member
 
Join Date: Jan 2013
Posts: 372
Rep Power: 14
openfoammaofnepo is on a distinguished road
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 View Post
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 is offline   Reply With Quote

Old   August 19, 2013, 20:32
Question
  #9
Senior Member
 
Join Date: Jan 2013
Posts: 372
Rep Power: 14
openfoammaofnepo is on a distinguished road
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 }
openfoammaofnepo is offline   Reply With Quote

Old   August 21, 2013, 09:24
Default
  #10
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30
akidess will become famous soon enough
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 View Post
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.
__________________
*On twitter @akidTwit
*Spend as much time formulating your questions as you expect people to spend on their answer.
akidess is offline   Reply With Quote

Old   September 5, 2013, 04:40
Default
  #11
Senior Member
 
RodriguezFatz's Avatar
 
Philipp
Join Date: Jun 2011
Location: Germany
Posts: 1,297
Rep Power: 27
RodriguezFatz will become famous soon enough
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;
    }
}
bmikuz, sharonyue, jiehgw and 2 others like this.
__________________
The skeleton ran out of shampoo in the shower.
RodriguezFatz is offline   Reply With Quote

Old   March 20, 2014, 05:31
Default
  #12
Member
 
Fabian E.
Join Date: Nov 2009
Posts: 38
Rep Power: 17
galap is on a distinguished road
Quote:
Originally Posted by RodriguezFatz View Post
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)"
galap is offline   Reply With Quote

Old   March 20, 2014, 08:36
Default
  #13
Senior Member
 
RodriguezFatz's Avatar
 
Philipp
Join Date: Jun 2011
Location: Germany
Posts: 1,297
Rep Power: 27
RodriguezFatz will become famous soon enough
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.
__________________
The skeleton ran out of shampoo in the shower.
RodriguezFatz is offline   Reply With Quote

Old   June 24, 2014, 11:33
Default
  #14
Member
 
Tobias Adam
Join Date: Oct 2013
Location: Siegen
Posts: 55
Rep Power: 13
Tobias Adam is on a distinguished road
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
Tobias Adam is offline   Reply With Quote

Old   June 24, 2014, 11:40
Default
  #15
Senior Member
 
RodriguezFatz's Avatar
 
Philipp
Join Date: Jun 2011
Location: Germany
Posts: 1,297
Rep Power: 27
RodriguezFatz will become famous soon enough
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).
utkunun likes this.
__________________
The skeleton ran out of shampoo in the shower.
RodriguezFatz is offline   Reply With Quote

Old   June 24, 2014, 11:52
Default
  #16
Member
 
Tobias Adam
Join Date: Oct 2013
Location: Siegen
Posts: 55
Rep Power: 13
Tobias Adam is on a distinguished road
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
Tobias Adam is offline   Reply With Quote

Old   June 24, 2014, 12:04
Default
  #17
Senior Member
 
RodriguezFatz's Avatar
 
Philipp
Join Date: Jun 2011
Location: Germany
Posts: 1,297
Rep Power: 27
RodriguezFatz will become famous soon enough
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.
__________________
The skeleton ran out of shampoo in the shower.
RodriguezFatz is offline   Reply With Quote

Old   June 25, 2014, 05:14
Default
  #18
New Member
 
Hans Barósz
Join Date: May 2014
Posts: 22
Rep Power: 12
HanSolo123 is on a distinguished road
Quote:
Originally Posted by Tobias Adam View Post
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.
HanSolo123 is offline   Reply With Quote

Old   June 25, 2014, 05:16
Default
  #19
Senior Member
 
RodriguezFatz's Avatar
 
Philipp
Join Date: Jun 2011
Location: Germany
Posts: 1,297
Rep Power: 27
RodriguezFatz will become famous soon enough
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.
__________________
The skeleton ran out of shampoo in the shower.
RodriguezFatz is offline   Reply With Quote

Old   June 25, 2014, 05:22
Default
  #20
New Member
 
Hans Barósz
Join Date: May 2014
Posts: 22
Rep Power: 12
HanSolo123 is on a distinguished road
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.
HanSolo123 is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[blockMesh] error message with modeling a cube with a hold at the center hsingtzu OpenFOAM Meshing & Mesh Conversion 2 March 14, 2012 10:56
[blockMesh] BlockMesh FOAM warning gaottino OpenFOAM Meshing & Mesh Conversion 7 July 19, 2010 15:11
NACA0012 geometry/design software needed Franny Main CFD Forum 13 July 7, 2007 16:57
[blockMesh] Axisymmetrical mesh Rasmus Gjesing (Gjesing) OpenFOAM Meshing & Mesh Conversion 10 April 2, 2007 15:00
[Gmsh] Import gmsh msh to Foam adorean OpenFOAM Meshing & Mesh Conversion 24 April 27, 2005 09:19


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