|
[Sponsors] |
Where do we read relaxationFactors in fvSolution in the codes? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
May 24, 2011, 06:34 |
Where do we read relaxationFactors in fvSolution in the codes?
|
#1 |
Member
|
Hi Foamers,
I am curious about where do we read relaxationFactors in system/fvSolution in the solvers? For example, in simpleFoam, I can not see any dictionary is defined to look up those numbers. I guess it may read those numbers when we are trying to solve eqns. For example, in "UEqn.H", does the line Code:
UEqn.relax(); Thx // Kai |
|
May 24, 2011, 12:13 |
|
#2 |
Member
|
It is said "The user can specify the relaxation factor for a particular field by specifying first the word associated with the field, then the factor. The user can view the relaxation factors used in a tutorial example of simpleFoam for incompressible, laminar, steady-state flows."
It is not clear how to update the field during calculation although it seems that the relaxation factor is connected with the particular field automatically. For example, if I create a field Gamma, and it will be updated every interation, say, Code:
Gamma=a value Even for the alpha, U, p, k, epsilon, after solving the PDEs, Code:
alphaEqn.solve(); // Kai |
|
May 24, 2011, 14:41 |
|
#3 |
Senior Member
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 22 |
I was just reading up on that myself.
Relaxation factors are specified in the controlDict file, under a subdictionary called 'relaxationFactors'. It contains a list of field names, with the associated relaxation factors. eg. (and I'm guessing a little here): Code:
relaxationFactors { U 0.7; T 0.5; } |
|
May 24, 2011, 16:45 |
|
#4 |
Member
|
||
May 24, 2011, 16:54 |
|
#5 |
Senior Member
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 22 |
fvMatrix::relax is overridden. If you provide it with a scalar - relax(factor) - it will relax the matrix with the given factor. If you don't, here's what it does:
From fvMatrix.C: Code:
template<class Type> void Foam::fvMatrix<Type>::relax() { if (psi_.mesh().relax(psi_.name())) { relax(psi_.mesh().relaxationFactor(psi_.name())); } } You could figure this out from reading the source code, which is a little tricky until you get used to it. From a practical perspective, you can use relax by either putting: Code:
PEqn.relax() // Look up factor from controlDict PEqn.relax(factor) // Use the factor provided Am I answering the question? |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Is it worth it? | Jason Bardis | Main CFD Forum | 47 | July 27, 2011 05:52 |
Phase locked average in run time | panara | OpenFOAM | 2 | February 20, 2008 15:37 |
Comparison of CFD Codes | Kerem | Main CFD Forum | 9 | May 9, 2003 05:29 |
New List of Free CFD Codes | Bert Laney | Main CFD Forum | 5 | September 15, 1999 16:24 |
Anyone used Ansys/Flotran - cf. with other codes? | S. Langsford | Main CFD Forum | 3 | October 19, 1998 21:51 |