Question on the discretization of momentum equation in icoFoam
I have a puzzle in the discretization of momentum equation in icoFoam.
As we know, the momentum equation was integrated over the control volume, and then discretized into linear equation.
When I dig into the code detail term by term of the UEqn, I found that the left hand part of the equation(fvm::ddt(U) + fvm::div(phi,U) - fvm::laplacian(nu,U)) was integrated and then the coefficient of unknow variables were added into the matrix A.
None of the terms is divided by the control volume.....
code detail of fvm::ddt using Euler scheme:
To the right hand part of the momentum equation, first we integrate the term(fvc::div(p)) over the entire CV. then it was discretized using the Gauss law.
But the result was divided by the volume of the current grid.
code detail of fvc::grad(p) using GraussGrand:
the left hand part must be also divied by the volume in some place, but I can't figure it out...
any hint will be highly appreciated.
perhaps the problem has not been discribed clearly.......
as we know, all the term of the momentum equation must be divided by the cell volumes,
when dig into the detail of the code implementation,
only the R.H.S of U equation was divided by the volume in the discretization process of fvc::grad(p).
How about the L.H.S of the equation?
From the discretization process of fvm::, all the term were integrated over the entire volume. I can't find the code on the division operation for them terms ....
can somebody give any suggestion?
have you read http://openfoamwiki.net/index.php/IcoFoam ?
hope that gets you further
Thanks for your kindly reply,elvis
I am new to OF.
I have read the the detail discription of icoFoam several times.
A long time's debug found that the secret lies in the operation overloading of fvMatrix.
and now I am more clear about the discretization of equations using the language of OpenFOAM.
|All times are GMT -4. The time now is 07:00.|