Where do we read relaxationFactors in fvSolution in the codes?
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 |
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 |
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 |
Quote:
Code:
UEqn.relax();UEqn.solve(); // Kai |
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> 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 Am I answering the question? |
That's great! Thanks
|
All times are GMT -4. The time now is 09:07. |