CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

solution depends on relaxationFactors

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 23, 2015, 05:45
Default solution depends on relaxationFactors
  #1
Senior Member
 
Przemek
Join Date: Jun 2011
Posts: 249
Rep Power: 15
gaza is on a distinguished road
Hi All
Is it possible that solution depends on relaxation factor value?
__________________
best regards
pblasiak
gaza is offline   Reply With Quote

Old   July 23, 2015, 06:00
Default
  #2
New Member
 
Lucas
Join Date: Jun 2015
Posts: 20
Rep Power: 10
Edeluc is on a distinguished road
Hello gaza,

Implicit solution methods use relaxation factors to slow down / fasten the process of convergence. Taking an under relaxation factor into consideration: If you choose it to be too high, your whole simulation might be unstable and divergence appears. If you choose it to be too small you will reach convergence very slowly.The solution itself does not depend on the relaxation factors. It only determines if and how fast you reach your solution.
Taking a look at your convergence criteria or the maximum amount of iterations might be a first try to get a better solution, if you only consider the solution process.
Of course your boundary and initial conditions also affect your solution.
Edeluc is offline   Reply With Quote

Old   July 23, 2015, 06:16
Default
  #3
Senior Member
 
Przemek
Join Date: Jun 2011
Posts: 249
Rep Power: 15
gaza is on a distinguished road
Hi Edulec
Yes I agree with you. But my solution changes when I change values near T

relaxationFactors
151 {
152 fields
153 {
154 p_rgh 0.3;
155 }
156 equations
157 {
158 "U.*" 0.5;
159 "T.*" 0.8;
160 T 0.8;
161 }
162 }

So what can be wrong?
__________________
best regards
pblasiak
gaza is offline   Reply With Quote

Old   July 23, 2015, 06:46
Default
  #4
New Member
 
Lucas
Join Date: Jun 2015
Posts: 20
Rep Power: 10
Edeluc is on a distinguished road
Hello Gaza,

Do you specify a maximum amount of iterations for the solver or a convergence criteria (or both and the solver takes, whatever he reaches first)?
If you kept the maximum amount of iterations, as well as your convergence criteria the same, but changed the relaxation factors the solution can be changed, because you reach convergence (and therefore also a different numerical value) faster/slower.
Edeluc is offline   Reply With Quote

Old   July 23, 2015, 07:10
Default
  #5
Senior Member
 
Przemek
Join Date: Jun 2011
Posts: 249
Rep Power: 15
gaza is on a distinguished road
Hi Edullec,
Yes I did it. Here is my fvSolution file
solvers
{
"alpha.water.*"
{
cAlpha 1;
nAlphaCorr 1;
nAlphaSubCycles 1;
alphaOuterCorrectors 1;

MULESCorr no;
nLimiterIter 1;

solver smoothSolver;
smoother symGaussSeidel;
tolerance 1e-8;
relTol 0;
};

"U.*"
{
solver smoothSolver;
smoother symGaussSeidel;
tolerance 1e-6;
relTol 0;
};

// T
// {
// solver smoothSolver;
// smoother symGaussSeidel;
// tolerance 1e-6;
// relTol 0;
// };
T
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-6;
relTol 0;
};
TFinal
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-6;
relTol 0;
};
// TFinal
// {
// solver smoothSolver;
// smoother symGaussSeidel;
// tolerance 1e-6;
// relTol 0;
// };
rhoFinal
{
solver smoothSolver;
smoother symGaussSeidel;
tolerance 1e-6;
relTol 0;
};

p_rgh
{
solver GAMG;
tolerance 1e-8;
relTol 0.1;

smoother DICGaussSeidel;
nPreSweeps 0;
nPostSweeps 2;

cacheAgglomeration true;

nCellsInCoarsestLevel 10;
agglomerator faceAreaPair;
mergeLevels 1;

maxIter 150;
};

p
{
$p_rgh;
relTol 0;
};

pcorr
{
$p_rgh;
relTol 0;
};

p_rghFinal
{
solver PCG;
preconditioner
{
preconditioner GAMG;

tolerance 1e-6;
relTol 0;

nVcycles 2;

smoother DICGaussSeidel;
nPreSweeps 0;
nPostSweeps 2;
nFinestSweeps 2;

cacheAgglomeration true;
nCellsInCoarsestLevel 10;
agglomerator faceAreaPair;
mergeLevels 1;
};
tolerance 1e-7;
relTol 0;
maxIter 120;
};
}

potentialFlow
{
nNonOrthogonalCorrectors 3;
pRefCell 0;
pRefValue 0;
}

PIMPLE
{
momentumPredictor no;
nOuterCorrectors 1;
nCorrectors 3;
nNonOrthogonalCorrectors 0;

pRefCell 0;
pRefValue 0;
}


relaxationFactors
{
fields
{
p_rgh 0.3;
}
equations
{
"U.*" 0.5;
"T.*" 0.6;
T 0.6;
}
}
__________________
best regards
pblasiak
gaza is offline   Reply With Quote

Old   July 23, 2015, 07:44
Default
  #6
Senior Member
 
Przemek
Join Date: Jun 2011
Posts: 249
Rep Power: 15
gaza is on a distinguished road
Does anybody know why solution depends on relaxation factor?
__________________
best regards
pblasiak
gaza is offline   Reply With Quote

Old   July 23, 2015, 15:44
Default
  #7
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,272
Rep Power: 34
arjun will become famous soon enougharjun will become famous soon enough
Quote:
Originally Posted by gaza View Post
Does anybody know why solution depends on relaxation factor?
if it is not converged it depends on urf.

Many times people when they compare solution they just check if residuals are dropped by certain level but most of the time reported residuals are normalised and also residuals are sum of errors so there are many ways to get the same residual.

If you have result converged to machine precision and then if you see results differ it could be bug.
arjun is offline   Reply With Quote

Old   July 24, 2015, 05:57
Default
  #8
Senior Member
 
Przemek
Join Date: Jun 2011
Posts: 249
Rep Power: 15
gaza is on a distinguished road
Hi Arjun,
I have such equation:

fvScalarMatrix TEqn
(
fvm::ddt(rhoCp, T)
+ fvm::div(rhoPhiCpf, T)
- fvm::laplacian(kappaf, T)
==
source
);
I found out that solution for this equation does not depend on relaxationFactor. However temperature goes out of boundary conditions limit (e.g. I have 400K at the wall -> temperature increases to 600K).
On the other hand I found out that if change equation into (3rd line):

fvScalarMatrix TEqn
(
fvm::ddt(rhoCp, T)
+ fvm::div(rhoPhiCpf, T)
- fvm::Sp(fvc::ddt(rhoCp) + fvc::div(rhoPhiCpf), T)
- fvm::laplacian(kappaf, T)
==
source
);
my solution is bounded but it depends on relaxationFactors. Do you know what can be the reason?
__________________
best regards
pblasiak
gaza is offline   Reply With Quote

Old   July 24, 2015, 12:33
Default
  #9
New Member
 
David
Join Date: Mar 2014
Posts: 8
Rep Power: 12
David-G is on a distinguished road
It is probably because you have not reached true convergence, so what you think is the solution is not the true solution.
David-G is offline   Reply With Quote

Old   July 27, 2015, 04:56
Default
  #10
Senior Member
 
Przemek
Join Date: Jun 2011
Posts: 249
Rep Power: 15
gaza is on a distinguished road
Hi David-G and Desmund
Thank you for your replies.
@David
I set up fvSolution residuals on 1e-6. Number of iterations for T Eqn is only 1.
So if it is not converged, how can I do it?

@Desmund
I changed interPhaseChangeFoam solver in that way that I added TEqn.H just after
UEqn.H. The same is in the compressibleInterFoam so I think it is correct?
__________________
best regards
pblasiak
gaza 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
grid dependancy gueynard a. Main CFD Forum 19 June 27, 2014 21:22
Why 3D solid-pore geometry showing diverged solution? Sargam05 OpenFOAM 0 December 3, 2012 15:45
Analytic solution for 2D steady Euler equations jojo81 Main CFD Forum 0 October 15, 2012 12:05
IcoFoam parallel woes msrinath80 OpenFOAM Running, Solving & CFD 9 July 22, 2007 02:58
Wall functions Abhijit Tilak Main CFD Forum 6 February 5, 1999 01:16


All times are GMT -4. The time now is 04:57.