|
[Sponsors] |
Discretisation of fvm::div(). Why is negSumDiag() necessary? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
July 6, 2017, 14:25 |
Discretisation of fvm::div(). Why is negSumDiag() necessary?
|
#1 |
Member
Join Date: Mar 2015
Posts: 35
Rep Power: 11 |
Dear Foamers,
I am trying to use the fvMatrix-class for solving a sparse equation system in my model that can not be written in terms of fvm::laplacian oder fvm::div. Therfore I tried to understand the implementation of fvm::laplacian and fvm::div, to get confident with upper(), lower() and diag(). During my study I completly understood fvm::laplacian, but i get in trouble with fvm::div. Imagine a simple 1D mesh with a simple advection of concentration by velocity U (phi on faces). Using Finite-Volume-Method for cell number 2 (so directly between cell 1 and cell 3), I would come up with the equations and discretisation in line 1 to 3 of the attached figure (weights for surface-interpolation are 0.25 and 0.75 to make the difference clear). But using the negSumDiag() in fvm::div Code:
for (register label face=0; face<l.size(); face++) { Diag[l[face]] -= Lower[face]; Diag[u[face]] -= Upper[face]; } I don't understand, how this can be the correct implementation of Finite-Volume-Method for the divergence-operator. Obviously it is correct, but I can not see my error in writing down the equations and the matrix. Thanks for every reply. |
|
July 8, 2017, 00:04 |
|
#2 | |
New Member
WangYi
Join Date: Dec 2015
Location: Xi'an China
Posts: 7
Rep Power: 10 |
Quote:
|
||
July 10, 2017, 12:19 |
|
#3 |
Member
Join Date: Mar 2015
Posts: 35
Rep Power: 11 |
Thanks for your answer, youmengtear.
Do you mean the sign of phi_i_j? phi_i_j is defined as u_face*n_face, where n_face is the vector pointing outward the cell (not mesh.Sf()). So phi_i_j could be negative but that would not solve the problem. When "phi_i_j*(c_i*weight + c_j*(1-weight))" is formed into a matrix equation, phi_i_j could not transfrom the "+" of interpolation into a "-", while the other C_value is not transformed, I guess. |
|
July 10, 2017, 18:59 |
|
#4 | |
New Member
WangYi
Join Date: Dec 2015
Location: Xi'an China
Posts: 7
Rep Power: 10 |
Quote:
|
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
higher order discretisation scheme | Simon Smokes | Main CFD Forum | 2 | August 23, 2014 07:19 |
8th order polynomial function(VOF smoothening) + ENO discretisation | bharat.cmeri | FLUENT | 1 | July 4, 2012 11:51 |
Wrong fvm::div assembling | santiagomarquezd | OpenFOAM Bugs | 90 | December 27, 2010 12:54 |
Second Order Discretisation with Porous Media | giogio | FLUENT | 1 | March 21, 2008 12:29 |
FEM discretisation for eps-equation | Sigit | Main CFD Forum | 3 | October 26, 2000 11:49 |