Workings of setValuesFromList
I am trying to understand the function setValuesFromList which is in fvMatrix.C lines 181-267 in OF 2.1.0.
As I understand the core is executed in lines 207 & 208:
However I fail to fully grasp lines 220-232, i.e.,
* What is the meaning of "source_[nei[facei]] -= upper()[facei]*value", does this set the source vector of the neighbor cells, and why does it only subtract and not set?
* Would it not be suffice to just set the neighbor matrix coefficients (a_N) to zero?
Thank you very much, all input is very much appreciated.
I'm not familiar with this part of the code of OpenFOAM, but since we are near the end of 2011 and beginning of 2012 (and if will be like last year), the experts on this subject won't come back for a another few days.
So, based on the following information:
This should get you going forward, at least until someone more experienced can answer you!
Thank you very much Bruno!
May I also take this opportunity to wish you a fantastic 2012 :)
I think I may have figured it out, I will write out my understanding and if someone could please just comment on the correctness..
The discretized FVM equation for each cell can be written out as:
In the ldumatrix these terms correspond to:
= upper() and lower()
and the solution variable corresponds to:
To "force" the solution in the specified cells (cellLabels) to the specified values (values), the following operations are performed on the matrix for each of the concerned equations:
(line: 231 or 244 & 245, depending on matrix symmetry)
This results in the trivial solution of Eq. 1 i.e.,
However, there remains the important aspect of the influence of the fixed cells on their neighbor cells and setting removes this influence (since it is zero'd!). This is where I am very impressed with this code (if I understand it correctly), since before the zero'ing of , the influence of the concerned cells is added to neighbors by modifying the source term for the neighboring cells ( ) using the old value before setting it to zero.
(lines 224 & 228 or 237 & 241 depending on symmetry)
I hope my understanding is correct. Thanks again Bruno for putting me on track.
|All times are GMT -4. The time now is 20:28.|