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

Relaxation Factors for Transient solvers

Register Blogs Community New Posts Updated Threads Search

Like Tree9Likes
  • 4 Post By eugene
  • 5 Post By hjasak

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 26, 2006, 18:25
Default Hello again, I was wonderi
  #1
Senior Member
 
Philippose Rajan
Join Date: Mar 2009
Location: Germany
Posts: 552
Rep Power: 25
philippose will become famous soon enough
Hello again,
I was wondering... does it make sense to add relaxation factors for a transient turbulent solver such as turbFoam?

Does it effect the temporal characteristics of the simulation in anyway?

Usually when I use simpleFoam for solving steady state turbulent systems, I need to reduce the relaxation factors for the system to converge.

I was trying a transient simulation using turbFoam, and am landing up with a situation similar to in simpleFoam when the relaxation factors are too high.... but relaxation factors are not currently implemented in turbFoam.

Thanks in advance and have a nice day!

Philippose
philippose is offline   Reply With Quote

Old   November 27, 2006, 13:24
Default If you make your timestep smal
  #2
Senior Member
 
Eugene de Villiers
Join Date: Mar 2009
Posts: 725
Rep Power: 21
eugene is on a distinguished road
If you make your timestep smaller you should get a similar result to making the relaxation factor smaller in steady state. You cant have a relaxation factor in transient runs, because then your solution wont be time-accurate, and you will violate continuity.
eugene is offline   Reply With Quote

Old   November 27, 2006, 13:32
Default Actually, if you run transient
  #3
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,905
Rep Power: 33
hjasak will become famous soon enough
Actually, if you run transient SIMPLE, you need relaxation factors (and iterations within a time-step) as usual. Look for various versions of transientSimpleFoam hanging about. That should also help you with transient start-up and cases where you wish to run with a large Co number.

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   December 1, 2006, 07:39
Default Hey Hrv, Would you happen t
  #4
Senior Member
 
Philippose Rajan
Join Date: Mar 2009
Location: Germany
Posts: 552
Rep Power: 25
philippose will become famous soon enough
Hey Hrv,
Would you happen to have a copy of the code for transientSimpleFoam? Is there a general source for such experimental or old openFoam code?

I had modified the turbFoam solver to include relaxation, but if this violates continuity, I guess the results wouldnt be too sensible.

One other question.... does is make sense to use the timeVaryingUniformFixedValue condition for pressure at an inlet in combination with the simpleFoam solver?

For example.... if I say, that for the first 1500 iterations the pressure remains constant... that would give the solver enough iterations to converge, and then... slowly vary the pressure.

My goal is only to run a parametric study for various values of inlet pressure, and it does not have to be temporally accurate. I used the transient solver turbFoam only because I thought using the timeVaryingUniformFixedValue condition with a steady state solver may not make sense.

Have a nice day!

Philippose
philippose is offline   Reply With Quote

Old   December 2, 2006, 04:54
Default Enjoy: http://www.cfd-online.
  #5
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,905
Rep Power: 33
hjasak will become famous soon enough
Enjoy: transientSimpleFoam_HJ_1Dec2006.tgz .

I have serious doubts about your boundary conditions: specifying the pressure at the inlet. It can be done, but care is needed in setting it up. I hope you know what is required.

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   December 4, 2006, 13:10
Default Hello Hrv, Thanks for the
  #6
Senior Member
 
Philippose Rajan
Join Date: Mar 2009
Location: Germany
Posts: 552
Rep Power: 25
philippose will become famous soon enough
Hello Hrv,
Thanks for the transientSimpleFoam solver. I guess I need to make myself a little clearer on what I have been trying.... So here goes :-)!

I have a hydraulic valve, with an axial inlet and a radial outlet configuration. The incoming oil flows axially into a hollow spool, and from there flows out radially via 6 holes (whose effective areas depend on the spool position) to a channel which is at tank pressure.

I want to simulate the flow through this system, and correlate the results with results I have from measurements of the real valve.

During the measurements, we hold a fixed pressure difference across the valve, and measure the oil flow for different spool positions.

Using OpenFOAM (particularly, the simpleFoam solver), I simulated this system with the following boundary conditions for the inlet and outlet:

inlet:
type: pressureInlet
pressure: fixedValue
velocity: pressureInletVelocity
epsilon: fixedValue
k: fixedValue

outlet:
type: pressureOutlet
pressure: fixedValue
velocity: zeroGradient
epsilon: zeroGradient
k: zeroGradient

For the inlet I use a value of 689 (which is 6bar normalised to a density of 870kg/m^3), and since its an incompressible solver, I use a value of 0 for the outlet.

Using this setup, I have simulated all the spool positions I need with flow results which match to within 1.5 to 2 l/min with the measured values.

Now I want to extend this simulation in three ways:

1. (Short term goal) I need to simulate the system for more pressure values, but dont want to do a complete 2500 iteration simulation for each pressure... so I thought I could use the last iteration of the above simulations as a starting point for a transient simulation where I can vary the inlet pressure during the simulation, giving me a complete pressure sweep in one simulation.

2. (Long term goal) I would like to create a moving mesh where I can hold the pressure constant but change the spool position, but thats something I need to spend some more time on before I manage to get results.

3. (Longer term goal :-)!!) The system is actuated using a solenoid. I would like to create a system where the forces on the spool due to static pressure and flow are calculated during the simulation, which are in turn used for a force balance with a given solenoid force resulting in the actual spool position for the next time step.

Points 2 and 3 are things I need to start thinking of once I get point 1 working. I already wrote a post-processor in openFOAM for calculating the resultant static pressure forces on a set of given patches in a set of given directions, controlled via a dictionary file (If anyone wants to take a look at it, I will be only happy to share the code :-)!).

Hope I have shed some light on the whole issue.... do you think there might be a problem using pressure as the inlet condition?

I would like to take this opportunity to thank you and the complete OpenFOAM team and community for the amazing support, and ofcourse... the clean, well organised and robust code structure!!

Have a nice day!

Philippose
philippose is offline   Reply With Quote

Old   December 4, 2006, 17:14
Default Hi, I am carrying out a tra
  #7
Member
 
Ankur Gupta
Join Date: Mar 2009
Posts: 38
Rep Power: 17
ankgupta8um is on a distinguished road
Hi,

I am carrying out a transient LES simulation, and there I am solving for a scalar that evolves in a steady state fashion at every time step, i.e., the equation for my scalar is:
fvm::laplacian(diff,G) - fvm::Sp(abs,G) == Source

where, G is the scalar I am solving for,
diff and abs are material property parameters,
and, source is the source term.

The equation for G is very sensitive and needs to be solved with under-relaxing the changes in G from one iteration to the next. How can I use the under-relaxation factors for the above equation? I mean, what is the syntax to incorporate under-relaxation while solving for G ?? I came across G.relax() and G.prevStorIter() functions, but have no idea about how to use them in my code ??
Any help regarding this would be highly appreciated.

Regards,
Ankur
ankgupta8um is offline   Reply With Quote

Old   December 4, 2006, 17:17
Default G.relax() will do it. The und
  #8
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,905
Rep Power: 33
hjasak will become famous soon enough
G.relax() will do it. The under-relaxation foacto is read from a dictionary.

Enjoy,

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   December 4, 2006, 17:20
Default Sorry, I am being silly: G.rel
  #9
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,905
Rep Power: 33
hjasak will become famous soon enough
Sorry, I am being silly: G.relax() will explicitly relax the variable using the value you've stored using storePrevIter().

If you want to under-relax the matrix by boosting the diagonal, make the equation:

fvScalarMatrix GEqn
(
fvm::laplacian(diff,G)
- fvm::Sp(abs,G)
== Source
);


and relax the equation:

GEqn.relax();

Apologies,

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   February 1, 2008, 01:10
Default Hi, all: I am also having s
  #10
Member
 
roy fokker
Join Date: Mar 2009
Posts: 44
Rep Power: 17
dbxmcf is on a distinguished road
Hi, all:

I am also having some problems with transientSimpleFoam which is downloaded here, I think the most different thing with the steady-state SimpleFoam is, it has nCorr, which is the "inner" iterations (according to Ferziger and Peric, 2002, pp173), the iteration number that is WITHIN each real time step. My question is, what value should nCorr be? I have read the post here:

http://www.cfd-online.com/OpenFOAM_D...es/1/4608.html.

However, if use the PISO values, it should be nCorrectors = 2, but does 2 inner iterations guarantee a "Convergence" within that real time step (inner step)? i.e. Is the 2 steps enough? In other words, what controls the convergence of each inner iteration process in TransientSimpleFoam? Or should we evaluate some kind of ContinuityErr?

BTW, I think this also relates to the relaxation factors, doesn't it?

Hope I have made the problem clear. Thanks!
dbxmcf is offline   Reply With Quote

Old   December 21, 2010, 03:20
Default
  #11
Member
 
George Pichurov
Join Date: Jul 2010
Posts: 52
Rep Power: 15
jorkolino is on a distinguished road
Quote:
Originally Posted by hjasak View Post
Sorry, I am being silly: G.relax() will explicitly relax the variable using the value you've stored using storePrevIter().

If you want to under-relax the matrix by boosting the diagonal, make the equation:

fvScalarMatrix GEqn
(
fvm::laplacian(diff,G)
- fvm::Sp(abs,G)
== Source
);


and relax the equation:

GEqn.relax();

Apologies,

Hrv
Hi,

what happens next with the relaxation coefficient supplied in a dictionary, how it affects the solution? I have the observation that Relaxation coefficient of 1 suppresses the solution by quite a bit, which differs from my expectations that RF = 1 should not change it at all
jorkolino is offline   Reply With Quote

Old   May 1, 2011, 16:21
Default
  #12
Senior Member
 
Join Date: Sep 2010
Posts: 226
Rep Power: 16
T.D. is on a distinguished road
Hi all,
I have 3 equations that are coupled together. First One is the momentum eqn in (U) is stationary no convection (stokes), and the others, one before it (Y) and another after it (C) that are transient convective (contain term fvm::ddt() + fvm::div(Phi, _).

The problem is when using the simpleFoam solver for the implementation i succeeded to converge with 4 relaxation factors being used: 3 for the eqns (U,Y,C) + 1 for pressure.

But my solution is time affected, and whenever i try not to use relaxation factors for (Y,C), it diverges.

I don't really understand the effective or how to use the relaxtion factors for different equations that are coupled together, especially, when some of them are stationary and the others are transient. what to do????????????????

thanks a lot

T.D.
T.D. is offline   Reply With Quote

Old   November 8, 2011, 20:27
Default
  #13
Member
 
Robin Gilbert
Join Date: Jan 2010
Posts: 66
Rep Power: 16
robingilbert is on a distinguished road
deleted---

Last edited by robingilbert; November 10, 2011 at 17:42.
robingilbert is offline   Reply With Quote

Old   April 26, 2012, 04:26
Default
  #14
Senior Member
 
Illya Shevchuk
Join Date: Aug 2009
Location: Darmstadt, Germany
Posts: 176
Rep Power: 16
linch is on a distinguished road
Hi foamers,

I also have a question concerning relaxation (OF 2.1.x). I solve a couple equations affecting the momentum eqn. The whole system doesn't converge very well, so I'm using under-relaxation and PIMPLE-loop to help it. But I observe a little bit strange behavior of the solution residuals. For example, providing a relaxation factor of 0.7 to the UEqn (no momentum predictor) causes the system to converge much faster. At some point convergence criteria are satisfied, nothing happens any more, no equations are being solved so the solution is converged. But in the last PIMPLE-Iteration, where relaxation factors are automatically being set to 1, residuals jump again, and that is what I don't understand.

I would expect such behavior if the last time step and not the last iteration is used for relaxation. Something I do is wrong, but I don't know what. Any ideas?

Best regards,
Ilya
linch is offline   Reply With Quote

Old   July 22, 2013, 06:02
Default
  #15
Senior Member
 
Join Date: Nov 2012
Posts: 171
Rep Power: 13
hz283 is on a distinguished road
Hello,

If what eugene said is correct, why does openfoam still provide the relaxation factors for the transient solvers (like in fireFoam solver):

relaxationFactors
{
fields
{
}
equations
{
"(U|k).*" 1;
"(CH4|O2|H2O|CO2|hs|epsilon).*" 1.0;
}
}

Besides, could you please give me some hints about the difference between fields and equations relaxations? A little confused......

hz283

Quote:
Originally Posted by eugene View Post
If you make your timestep smaller you should get a similar result to making the relaxation factor smaller in steady state. You cant have a relaxation factor in transient runs, because then your solution wont be time-accurate, and you will violate continuity.
hz283 is offline   Reply With Quote

Old   March 10, 2014, 10:49
Default
  #16
Member
 
Heliana Cardenas
Join Date: Jul 2013
Posts: 30
Rep Power: 12
heliana60 is on a distinguished road
Hello there!

I am using the viscoelasticFluidFoam solver and I am lost regarding the relaxation factors. I see how the affect my transients and steady state as well. I really don't know how to choose them, and I never get the "correct steady state" when I compare to analytical results... Help :/
heliana60 is offline   Reply With Quote

Old   March 20, 2014, 02:18
Default
  #17
Member
 
Fabian E.
Join Date: Nov 2009
Posts: 38
Rep Power: 16
galap is on a distinguished road
problem solved. take a look into: http://www.cfd-online.com/Forums/ope...tml#post481037

Last edited by galap; March 20, 2014 at 04:32.
galap is offline   Reply With Quote

Old   March 20, 2014, 02:23
Default
  #18
Member
 
Fabian E.
Join Date: Nov 2009
Posts: 38
Rep Power: 16
galap is on a distinguished road
Quote:
Originally Posted by heliana60 View Post
Hello there!

I am using the viscoelasticFluidFoam solver and I am lost regarding the relaxation factors. I see how the affect my transients and steady state as well. I really don't know how to choose them, and I never get the "correct steady state" when I compare to analytical results... Help :/
The relaxation factors should only affect the stability in steady-state solutions. Probably you have some transient effects in it?
galap is offline   Reply With Quote

Old   March 20, 2014, 03:43
Default
  #19
Member
 
Heliana Cardenas
Join Date: Jul 2013
Posts: 30
Rep Power: 12
heliana60 is on a distinguished road
Hi Galap,

I am using this solver to evaluate transients, and when I remove the relaxation factors and go to low time step (which I have read should have the same effect as having relax factors) I still find a different time-scale. Do you know this solver?

cheers, heliana
heliana60 is offline   Reply With Quote

Old   March 20, 2014, 04:39
Default
  #20
Member
 
Fabian E.
Join Date: Nov 2009
Posts: 38
Rep Power: 16
galap is on a distinguished road
Quote:
Originally Posted by heliana60 View Post
Hi Galap,

I am using this solver to evaluate transients, and when I remove the relaxation factors and go to low time step (which I have read should have the same effect as having relax factors) I still find a different time-scale. Do you know this solver?

cheers, heliana
No sorry, I do not know this solver. I could fix my problem: http://www.cfd-online.com/Forums/ope...mple-loop.html
galap 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
Under relaxation factors ro FLUENT 3 April 17, 2008 13:44
Relaxation factors Vidya Raja FLUENT 7 September 26, 2006 20:00
Under-relaxation factors pUl| FLUENT 4 April 9, 2005 13:56
Different Under Relaxation Factors Ertan FLUENT 7 November 11, 2004 04:07
Relaxation Factors Tim Phoenics 3 June 30, 2004 02:03


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