|
[Sponsors] |
April 16, 2015, 05:45 |
setReference in fvMatrix.C
|
#1 |
New Member
Andre Weiner
Join Date: Aug 2012
Posts: 29
Rep Power: 13 |
Hello Foamers!
The method setReference is widely used in OpenFOAM, for instance to set a reference pressure in simulations without a boundary with fixed pressure value. It's body looks the following: Code:
line 517-520 in fvMatrix.C { source()[celli] += diag()[celli]*value; diag()[celli] += diag()[celli]; } Many thanks in advance! Best, Andre |
|
April 24, 2015, 06:59 |
|
#2 | |
Senior Member
Dongyue Li
Join Date: Jun 2012
Location: Beijing, China
Posts: 838
Rep Power: 17 |
Quote:
oh this image is way too big...Sorry about that, Im shocked... |
||
April 24, 2015, 11:30 |
|
#3 |
New Member
Andre Weiner
Join Date: Aug 2012
Posts: 29
Rep Power: 13 |
Ciao sharonyue!
Thanks a lot for your small example. I tried to formulate it a little bit more general For each cell center P with the neighbours nb we can write the equation or What we want is to set for a given P To incorporate this condition into outer algebraic system, first we multiply by To this equation we now add (1) (we are adding 0) and get which is reordered This approach almost seems to simple and effective to be true On the one hand you do not destroy the conditioning of the Matrix by applying some huge value to the diagonal and the source, and on the other hand the symmetry of the matrix is conserved (it would be also possible to set the off-diagonal coefficients to zero). Thanks again for the support! Best, Andre |
|
April 25, 2015, 04:19 |
|
#4 |
Senior Member
Dongyue Li
Join Date: Jun 2012
Location: Beijing, China
Posts: 838
Rep Power: 17 |
Quote:
Never too old to learn CFD. haha. Best, dongyue |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Some misleading about the treatment of coupled boundary | liuhuafei | OpenFOAM Bugs | 6 | February 20, 2018 10:11 |
Poisson eq w setReference works serial diverges in parallel | tehache | OpenFOAM Running, Solving & CFD | 5 | August 29, 2012 09:41 |
Appropriate boundary conditions for external incompressible flow | mattamos | OpenFOAM Running, Solving & CFD | 7 | July 28, 2005 12:03 |