|
[Sponsors] |
March 18, 2019, 12:00 |
pisoFoam - Momentum equation
|
#1 |
Senior Member
Guilherme
Join Date: Apr 2017
Posts: 225
Rep Power: 10 |
Hi,
Earlier today I noticed a detail in the UEqn file in the pisoFoam folder (OF 5.0), the code is below: Code:
MRF.correctBoundaryVelocity(U); fvVectorMatrix UEqn ( fvm::ddt(U) + fvm::div(phi, U) + MRF.DDt(U) + turbulence->divDevReff(U) == fvOptions(U) ); UEqn.relax(); fvOptions.constrain(UEqn); if (piso.momentumPredictor()) { solve(UEqn == -fvc::grad(p)); fvOptions.correct(U); } Thanks |
|
March 19, 2019, 02:15 |
|
#2 |
Member
Anonymous
Join Date: Aug 2016
Posts: 75
Rep Power: 9 |
Hi,
There are two types of relaxations: 1) Field relaxation: modifies the field directly by limiting the amount by which a variable changes from iteration to iteration. If you look at fvSolution, you can find that there is a "relaxationFactors" sub-dict under which you can mention the relaxation factors for each field you are solving for. Please note that only steady-state simulations can benefit from relaxation. This type of relaxation is explicit. 2) Equation relaxation: In this case, you can directly modify the solution matrix before next iteration. UEqn.relax() refers to relaxing the equation in this way. You can use any value between 0 and 1 in the paranthesis after UEqn.relax. This helps increase the diagonal dominance of the system of equations and thus improves stability. This is implicit. |
|
March 19, 2019, 07:38 |
|
#3 | ||
Senior Member
Guilherme
Join Date: Apr 2017
Posts: 225
Rep Power: 10 |
Quote:
Thanks for your reply, it was quite enlightening, but I still have some doubts. I will add a piece of my code and make a comment, I would like you to comment if I understood your explanation well. Because I did simulations using the PISO solver (LES simulation) and left the term relaxationFactors within my fvSolution, so I was afraid that this might have affected the results. Code:
PISO { momentunPredictor no; nCorrectors 2; nNonOrthogonalCorrectors 1; pRefCell 0; pRefValue 0; } SIMPLE { nNonOrthogonalCorrectors 1; pRefCell 0; pRefValue 0; consistent yes; residualControl { p 1e-6; U 1e-6; } } relaxationFactors { fields //Field relaxation; { p 0.8; } equations //Equation relaxation; { U 0.8; } } Could this amount have negatively affected the results of my simulation? or, is there an ideal value to consider? Thanks *One note I'd like to put. In the codes it is visible the term UEqn.relax(), kEqn.ref().Relax()... and among others, these terms refer to relaxation of the equation. But what about the FIELD?! I believe that in newer versions of OF this does not exist anymore... In previous versions it was used: Quote:
|
|||
March 19, 2019, 14:02 |
|
#4 |
Member
Anonymous
Join Date: Aug 2016
Posts: 75
Rep Power: 9 |
Your first question about relaxing p or U in an LES simulation: there is no point in relaxing a transient simulation. It yields a wrong instantaneous representation of the flow field, if you relax in transient simulation. In these cases, you can just decrease the timestep to stabilize your simulation.
In other words, relaxing a transient simulation is totally out of place. About your second question that in OF5, they have removed eqn.relax(). In the relaxation factors subdict in fvSolution, you have both types of relaxations - field and equation. So if you don't use eqn.relax, you can still do that in the relaxationFactors subdict. Thanks, |
|
March 20, 2019, 06:12 |
|
#5 |
Senior Member
Guilherme
Join Date: Apr 2017
Posts: 225
Rep Power: 10 |
Yes I agree with you. What happened was really a glitch from my understanding of OpenFOAM. I left the relaxation term in the fvSolution file believing that the PISO solver would not use it (only SIMPLE). Sad.
|
|
April 14, 2019, 08:47 |
|
#6 |
Senior Member
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 21 |
You can use relaxation in transient simulations if you use the PIMPLE algorithm to increase stability, if you want to increase your time step. Look for examples in the tutorial directory of OpenFOAM using any of the *Pimple solvers.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Need help in adding terms to momentum equation of interFoam | behzad-cfd | OpenFOAM Programming & Development | 2 | April 18, 2020 14:52 |
Domain Reference Pressure and mass flow inlet boundary | AdidaKK | CFX | 75 | August 20, 2018 05:37 |
mass flow in is not equal to mass flow out | saii | CFX | 12 | March 19, 2018 05:21 |
Comparing residuals of momentum and energy equation | skarma | FLUENT | 4 | November 25, 2017 22:03 |
Coefficients discretized momentum equation | michujo | Main CFD Forum | 4 | June 20, 2012 01:33 |