CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Relaxation Factors for Transient solvers (http://www.cfd-online.com/Forums/openfoam-solving/59183-relaxation-factors-transient-solvers.html)

philippose November 26, 2006 19:25

Hello again, I was wonderi
 
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

eugene November 27, 2006 14:24

If you make your timestep smal
 
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.

hjasak November 27, 2006 14:32

Actually, if you run transient
 
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

philippose December 1, 2006 08:39

Hey Hrv, Would you happen t
 
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

hjasak December 2, 2006 05:54

Enjoy: http://www.cfd-online.
 
Enjoy: http://www.cfd-online.com/OpenFOAM_D...hment_icon.gif 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

philippose December 4, 2006 14:10

Hello Hrv, Thanks for the
 
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

ankgupta8um December 4, 2006 18:14

Hi, I am carrying out a tra
 
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

hjasak December 4, 2006 18:17

G.relax() will do it. The und
 
G.relax() will do it. The under-relaxation foacto is read from a dictionary.

Enjoy,

Hrv

hjasak December 4, 2006 18:20

Sorry, I am being silly: G.rel
 
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

dbxmcf February 1, 2008 02:10

Hi, all: I am also having s
 
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!

jorkolino December 21, 2010 04:20

Quote:

Originally Posted by hjasak (Post 200734)
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 :confused:

T.D. May 1, 2011 16:21

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.

robingilbert November 8, 2011 21:27

deleted---

linch April 26, 2012 04:26

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

hz283 July 22, 2013 06:02

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 (Post 200727)
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.


heliana60 March 10, 2014 11:49

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 :/

galap March 20, 2014 03:18

problem solved. take a look into: http://www.cfd-online.com/Forums/ope...tml#post481037

galap March 20, 2014 03:23

Quote:

Originally Posted by heliana60 (Post 479164)
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?

heliana60 March 20, 2014 04:43

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

galap March 20, 2014 05:39

Quote:

Originally Posted by heliana60 (Post 481026)
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


All times are GMT -4. The time now is 21:10.