CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Post-Processing

mass imbalance / div(U) vs div(phi)

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By hjasak

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 21, 2022, 03:33
Default mass imbalance / div(U) vs div(phi)
  #1
Senior Member
 
Join Date: Dec 2019
Location: Cologne, Germany
Posts: 355
Rep Power: 8
geth03 is on a distinguished road
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 Meaning of "fvc::div(phi)" , 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.
Attached Images
File Type: jpg plot_paraview.jpg (37.2 KB, 22 views)
File Type: png terminal_output.png (30.9 KB, 13 views)
geth03 is offline   Reply With Quote

Old   June 22, 2022, 04:57
Default
  #2
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,905
Rep Power: 33
hjasak will become famous soon enough
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
jherb and geth03 like this.
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk

Last edited by hjasak; June 22, 2022 at 08:52.
hjasak is offline   Reply With Quote

Old   June 22, 2022, 12:27
Default
  #3
Senior Member
 
Join Date: Dec 2019
Location: Cologne, Germany
Posts: 355
Rep Power: 8
geth03 is on a distinguished road
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.
geth03 is offline   Reply With Quote

Old   August 5, 2023, 15:14
Default
  #4
New Member
 
Shenhui Ruan
Join Date: Nov 2021
Location: Karlsruhe
Posts: 14
Rep Power: 4
fly_light is on a distinguished road
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.
fly_light is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
DPMFoam - Serious Error --particle-laden flow in simple geometric config benz25 OpenFOAM Running, Solving & CFD 27 December 19, 2017 20:47
mass imbalance at the inlet, interface, outlet CFDturbomachinery CFX 2 October 30, 2014 11:54
Mass imbalance in fast chem. reaction Laexzzz FLUENT 3 March 16, 2014 23:19
Integral of mass Imbalance drops with time TfG FLUENT 0 April 3, 2009 11:38
OutletBoundary Condition Causes Mass Imbalance Andy Main CFD Forum 0 March 11, 2004 14:05


All times are GMT -4. The time now is 01:34.