CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (https://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   mass imbalance / div(U) vs div(phi) (https://www.cfd-online.com/Forums/openfoam-post-processing/243480-mass-imbalance-div-u-vs-div-phi.html)

geth03 June 21, 2022 03:33

mass imbalance / div(U) vs div(phi)
 
2 Attachment(s)
hi all,

i searched up the forum about this issue, but could not find a satisfactory explanation.

i would like to know what the mass imbalance is in every iteration step for a steady state calculation with simpleFoam.

1.normally, for an incompressible, steady state case the continuity equation would be: div(U)=0. from the computational side this equation should be div(U)=r, meaning there should be a residual r in every iteration.

2. Integral of div(U) over a control volume is equal to integral over the bounding surface of this control volume when Gauss theorem is applied:
Integral(div(U))dV=Integral(U_f*vector_n)dS, further this Integral can be discretized for a polyhedra -> SumOverAllFaces(U_f*vector_n*faceArea). This sum should be 0 ideally, but will give a residual r for every iteration step, which could be viewed as the mass imbalance for each cell.
i want to compute and output exactly this value.

so the question is, what do i need to do to compute this mass imbalance.
i know that there is the postprocessing utility "div". i did execute div(U) and div(phi) for icofoam. both values differ from each other (in this thread https://www.cfd-online.com/Forums/op...c-div-phi.html , post #20, it is claimed that both should give the same value). the dimension for both is 1/second.
i did calculate div(U) values with excel for this case manually, and got the same values which are shown in paraview.

i hope anybody can tell me how to compute the mass imbalance correctly.

hjasak June 22, 2022 04:57

fvc::div(phi) is the right thing to do. If you need a smaller error, tighten the pressure solver tolerance.

Face flux phi is the face representation of the velocity field and this is what we apply the div(u) constraint on.

Hrv

geth03 June 22, 2022 12:27

Thank you Prof. Jasak.

What confuses me is that div(phi) has the dimension "per second" in the output-file. I don't know how to interpret that, do i need to multiply that value with the cell volume to get the volume flux imbalance and maybe that again with the density to get the mass imbalance in kg/second?

Thanks again for any advice.

fly_light August 5, 2023 15:14

Hello geth03,

You can read the following two answers:
Meaning of "fvc::div(phi)"
the difference between div(U) and div(phi)

They already talked a lot.


All times are GMT -4. The time now is 18:28.