
[Sponsors] 
December 30, 2011, 21:48 
Workings of setValuesFromList

#1 
New Member
lazio
Join Date: Apr 2010
Posts: 22
Rep Power: 8 
Dear Foamers,
I am trying to understand the function setValuesFromList which is in fvMatrix.C lines 181267 in OF 2.1.0. As I understand the core is executed in lines 207 & 208: Code:
psi[celli] = value; source_[celli] = value*Diag[celli]; However I fail to fully grasp lines 220232, i.e., Code:
if (symmetric()) { if (celli == own[facei]) { source_[nei[facei]] = upper()[facei]*value; } else { source_[own[facei]] = upper()[facei]*value; } upper()[facei] = 0.0; } * 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. 

December 31, 2011, 12:17 

#2  
Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 9,800
Blog Entries: 39
Rep Power: 106 
Greetings lrunber,
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:
Should be the reference to the Upper matrix of a symmetric matrix. This way only half of the matrix needs to be stored. Quote:
Quote:
This should get you going forward, at least until someone more experienced can answer you! Best regards, Bruno
__________________


December 31, 2011, 14:30 

#3 
New Member
lazio
Join Date: Apr 2010
Posts: 22
Rep Power: 8 
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: (Eq. 1) In the ldumatrix these terms correspond to: = diag() = upper() and lower() = source_ and the solution variable corresponds to: = psi_ 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: 207) (line: 208) (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. 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
question about uds  tanven  FLUENT  2  July 5, 2015 11:22 
Unanswered question  niklas  OpenFOAM  2  July 31, 2013 16:03 
internal field question  PitzDaily Case  atareen64  OpenFOAM Running, Solving & CFD  2  January 26, 2011 16:26 
CHANNEL FLOW: a question and a request  Carlos  Main CFD Forum  4  August 23, 2002 05:55 
question  K.L.Huang  CDadapco  1  March 29, 2000 04:57 