|
[Sponsors] |
set fvMatrix coefficients equal to those of another cell |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
July 31, 2011, 03:37 |
set fvMatrix coefficients equal to those of another cell
|
#1 |
New Member
Austin Kimbrell
Join Date: Feb 2011
Location: Tennessee, USA
Posts: 8
Rep Power: 15 |
Hello all,
I have a problem in which I want to set the solution dependency of a particular subset of cells to that of another subset of cells, i.e. I need to set the fvMatrix coefficients in UEqn for a particular subset equal to a different subset, iterating per cell. I have done considerable reading about the addressing format for the lduMatrix but it isn't clear to me whether I can do what I need. Also I have looked at the setValues function in fvMatrix but that involves setting the value within the cell to a constant value. I want to preserve the dependency of the other cell on its neighbors when the equation is solved. Is this possible using the current mechanics of the fvMatrix, or would I need to create my own addressing system to allow me to do this? Any help would be great, I am kind of stuck and my thesis is dependent on getting this to work. Thanks, Austin |
|
August 1, 2011, 15:59 |
|
#2 |
Senior Member
Santiago Marquez Damian
Join Date: Aug 2009
Location: Santa Fe, Santa Fe, Argentina
Posts: 452
Rep Power: 24 |
Austin, changing the coeffs in a fvMatrix is possible like in negSumDiag (lduMatrixOperations.C) method, for example. In this method info from non-diagonal coeffs is readed and subtracted from diagonal coeffs.
Code:
00050 void Foam::lduMatrix::negSumDiag() 00051 { 00052 const scalarField& Lower = const_cast<const lduMatrix&>(*this).lower(); 00053 const scalarField& Upper = const_cast<const lduMatrix&>(*this).upper(); 00054 scalarField& Diag = diag(); 00055 00056 const labelUList& l = lduAddr().lowerAddr(); 00057 const labelUList& u = lduAddr().upperAddr(); 00058 00059 for (register label face=0; face<l.size(); face++) 00060 { 00061 Diag[l[face]] -= Lower[face]; 00062 Diag[u[face]] -= Upper[face]; 00063 } 00064 } Feel free to do more questions. Regards.
__________________
Santiago MÁRQUEZ DAMIÁN, Ph.D. Research Scientist Research Center for Computational Methods (CIMEC) - CONICET/UNL Tel: 54-342-4511594 Int. 7032 Colectora Ruta Nac. 168 / Paraje El Pozo (3000) Santa Fe - Argentina. http://www.cimec.org.ar |
|
August 8, 2011, 02:12 |
|
#3 |
New Member
Austin Kimbrell
Join Date: Feb 2011
Location: Tennessee, USA
Posts: 8
Rep Power: 15 |
Thank you for the bit of code, it was most helpful.
After further searching I came upon a sample solver on the openfoamwiki site called icoBlockedCellFoam which also does similar operations on the fvMatrix coefficients. Between your code and this other code I have been able to understand what the coefficients are doing within the matrix. Fortunately I have also discovered that the method I am trying to implement does not in fact require me to operate on these coefficients directly - instead I can operate on the actual values of phi and U to obtain the needed results. |
|
August 8, 2011, 09:32 |
|
#4 |
Senior Member
Santiago Marquez Damian
Join Date: Aug 2009
Location: Santa Fe, Santa Fe, Argentina
Posts: 452
Rep Power: 24 |
Austin, good to hear you managed the problem.
Best wishes with your thesis.
__________________
Santiago MÁRQUEZ DAMIÁN, Ph.D. Research Scientist Research Center for Computational Methods (CIMEC) - CONICET/UNL Tel: 54-342-4511594 Int. 7032 Colectora Ruta Nac. 168 / Paraje El Pozo (3000) Santa Fe - Argentina. http://www.cimec.org.ar |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Cell Reynolds Number | laliong | Main CFD Forum | 12 | September 17, 2019 04:18 |
low-level use of fvMatrix | Conny_T | OpenFOAM Programming & Development | 3 | September 20, 2010 15:54 |
How to show the transient case? | H.P.LIU | Phoenics | 7 | July 13, 2010 05:31 |
How to look at the coefficients from fvMatrix | marco7 | OpenFOAM Running, Solving & CFD | 2 | September 11, 2008 04:58 |
How to set environment variables | kanishka | OpenFOAM Installation | 1 | September 4, 2005 11:15 |