
[Sponsors] 
October 20, 2010, 11:49 
Problem regarding solution underrelaxation

#1 
Member
Join Date: Sep 2010
Posts: 35
Rep Power: 8 
Hi Foamers,
I am modeling subcooled boiling and condensation using a two phase EulerEuler approach. So i solve mass, momentum and energy conservation equations for both phases. I checked several times my model and i am pretty sure that it is physically correct. I mean, the equations i implemented make sense. However my simulation (a simple 2D channel) crashed very quickly... I think this is due to numerical calculation reasons, so i used relaxation factors, in order to improve the stability of the computation. Here are the solvers and relaxation factors i set: Code:
solvers { p GAMG { tolerance 1e10; relTol 0; smoother DIC; //GaussSeidel; nPreSweeps 0; nPostSweeps 2; nFinestSweeps 2; cacheAgglomeration true; nCellsInCoarsestLevel 10; agglomerator faceAreaPair; mergeLevels 1; }; Ua PBiCG { preconditioner DILU; tolerance 1e05; relTol 0.5; }; Ub PBiCG { preconditioner DILU; tolerance 1e05; relTol 0; }; alpha PBiCG { preconditioner DILU; tolerance 1e10; relTol 0; }; beta PBiCG { preconditioner DILU; tolerance 1e10; relTol 0; }; Ha PBiCG { preconditioner DILU; tolerance 1e5; relTol 0; }; Hb PBiCG { preconditioner DILU; tolerance 1e5; relTol 0; }; DS PBiCG { preconditioner DILU; tolerance 1e5; relTol 0; }; Theta PBiCG { preconditioner DILU; tolerance 1e05; relTol 0; }; k PBiCG { preconditioner DILU; tolerance 1e05; relTol 0; }; epsilon PBiCG { preconditioner DILU; tolerance 1e05; relTol 0; }; } PISO { nCorrectors 2; nNonOrthogonalCorrectors 0; nAlphaCorr 2; correctAlpha no; pRefCell 0; pRefValue 0.0; } relaxationFactors { alpha 0.3; DS 0.3; p 0.3; Ua 0.3; Ub 0.3; Ha 0.3; Hb 0.3; } Code:
GAMG: Solving for p, Initial residual = 1, Final residual = 5.7155e11, No Iterations 93 > FOAM FATAL ERROR: previous iteration field IOobject: volScalarField p "/home/michta/OpenFOAM/michta1.7.x/run/EulerEulerBoilingFoam/EulerEulerBoilingFoam/referenceCase/0" not stored. Use field.storePrevIter() at start of iteration. From function GeometricField<Type, PatchField, GeoMesh>::prevIter() const in file /home/michta/OpenFOAM/OpenFOAM1.7.x/src/OpenFOAM/lnInclude/GeometricField.C at line 863. FOAM aborting Thanks in advance! Best, /Edy 

October 20, 2010, 13:18 

#2 
Senior Member
Ben K
Join Date: Feb 2010
Location: Ottawa, Canada
Posts: 140
Rep Power: 11 
You may have other problems as well, but in order to use damping factors, you need to store the previous solution. Just place:
FIELD.storePrevIter(); in your solver before solving for the equation. 

October 20, 2010, 13:22 

#3 
Member
Join Date: Sep 2010
Posts: 35
Rep Power: 8 
Hi,
Thanks for your answer. But i applied the relaxation on the equation instead of applying it directly on the field, it should work as well, right? Here is my piece of code : Code:
fvScalarMatrix pEqn ( fvm::laplacian(Dp, p) == fvc::div(phi) ); pEqn.setReference(pRefCell, pRefValue); pEqn.relax(); pEqn.solve(); /Edy 

October 20, 2010, 13:24 

#4 
Member
Join Date: Sep 2010
Posts: 35
Rep Power: 8 
Because for the other fields (velocity, enthalpy, k, epsilon), i also apply the relaxation on the equation, not directly on the field, and I do not have this error message...


October 21, 2010, 08:59 

#5 
Senior Member
Ben K
Join Date: Feb 2010
Location: Ottawa, Canada
Posts: 140
Rep Power: 11 
Hmm...you're right...I'm not sure what the problem is. Maybe try underrelaxing the other way to see if that works?


October 21, 2010, 09:15 

#6 
Member
Join Date: Sep 2010
Posts: 35
Rep Power: 8 
Hi!
Your way works, mine does not, i dont understand why... However even with this underrelaxation, my simulation crashed, so i will check my code, once again.... Thanks for the help! Best /Edy 

March 21, 2013, 13:38 

#7  
Senior Member
Join Date: Nov 2012
Posts: 168
Rep Power: 5 
Hi All,
I also had a problem about the underrelax factor in openfoam. In my simulation case, I used kepsilon and rhoSimplecFoam. However, for the relaxation factors of k and epsilon, I need to reduce the factors to very small, less than 0.1. And the iteration step is zero. If I slightly increase the relaxation factors, the simulation will blow up due to large k or epsilon. Does anybody know what is the underlying reason behind this problem? Quote:


August 8, 2013, 03:01 

#8 
Senior Member
Anne Gerdes
Join Date: Aug 2010
Location: Hamburg
Posts: 168
Rep Power: 8 
You have to insert
HTML Code:
p.storePrevIter(); So try to insert it before HTML Code:
#include "pEqn.H" 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
smoothSolver diverges  solution in using PBiCG solver?  makaveli_lcf  OpenFOAM Running, Solving & CFD  3  September 11, 2013 12:44 
Fluent VOF Volume of Fluid Realistic Solution Problem  wormik  FLUENT  3  June 21, 2009 07:04 
Discretization problem in Solution controls  Tamm  FLUENT  0  July 15, 2005 07:07 
Periodic flow boundary condition problem  sudha  FLUENT  3  April 28, 2004 08:40 
Symmetric problem  Asymmetric prediction  Mark  Main CFD Forum  14  January 29, 2001 14:21 