
[Sponsors] 
March 25, 2020, 19:21 
Incompressible div(U) validation errors

#1 
New Member
Finn Boire
Join Date: Mar 2020
Posts: 2
Rep Power: 0 
Thanks in advance for the potential help. I'm relatively new to OpenFoam, so I'm really sorry if this is a stupid mistake. I can't seem to find the same problem online, but I've been searching for a couple days.
I've been trying to apply some diagnostic/validation tests to incompressible pimpleFoam configurations and have been finding some anomalous results. For any incompressible fluid, div(U) should be 0 or very near it. From what I understand, the pimpleFoam solver uses the div(U) > 0 condition as it solves the pressure field, and it certainly seems to be doing that, because in each step the time continuity errors are very small (order 10^17 or so). However, when I use funkySetFields/postProcess to compute the div(U) field at a given logged time, the values are much larger (on order 1 or even larger). I've tried it on my own configurations, along with several of the pimpleFoam/pisoFoam tutorials, and all of them result in large div(U) fields. To compute the field, I've been using these commands: Code:
funkySetFields time 0: create field divU expression "div(U)" Code:
postProcess func "div(U)" I've been using a Gaussian divergence scheme with linear interpolation in system/fvSchemes for div(U). Attached are some images of the div(U) field in different pimpleFoam tutorial cases in paraView. Also, here are some excerpts of logs from the pimpleFoam runner on channel395: Code:
PIMPLE: iteration 1 smoothSolver: Solving for Ux, Initial residual = 0.0117778, Final residual = 5.81593e06, No Iterations 2 smoothSolver: Solving for Uy, Initial residual = 0.0603226, Final residual = 2.72548e06, No Iterations 3 smoothSolver: Solving for Uz, Initial residual = 0.0585004, Final residual = 2.7339e06, No Iterations 3 Pressure gradient source: uncorrected Ubar = 0.1335, pressure gradient = 2.76228e05 GAMG: Solving for p, Initial residual = 0.146204, Final residual = 0.0126411, No Iterations 1 time step continuity errors : sum local = 1.14563e05, global = 8.27789e20, cumulative = 2.0927e18 Pressure gradient source: uncorrected Ubar = 0.1335, pressure gradient = 2.76872e05 GAMG: Solving for p, Initial residual = 0.0163918, Final residual = 4.2532e07, No Iterations 5 time step continuity errors : sum local = 4.5834e10, global = 1.12784e19, cumulative = 2.20548e18 Pressure gradient source: uncorrected Ubar = 0.1335, pressure gradient = 2.76392e05 ExecutionTime = 14.27 s ClockTime = 14 s fieldAverage fieldAverage1 write: Calculating averages Courant Number mean: 0.30284 max: 0.540451 Time = 5.4 PIMPLE: iteration 1 smoothSolver: Solving for Ux, Initial residual = 0.0118056, Final residual = 5.80108e06, No Iterations 2 smoothSolver: Solving for Uy, Initial residual = 0.0603712, Final residual = 2.65463e06, No Iterations 3 smoothSolver: Solving for Uz, Initial residual = 0.0584964, Final residual = 2.67235e06, No Iterations 3 Pressure gradient source: uncorrected Ubar = 0.1335, pressure gradient = 2.76884e05 GAMG: Solving for p, Initial residual = 0.146366, Final residual = 0.0127159, No Iterations 1 time step continuity errors : sum local = 1.15734e05, global = 1.22909e19, cumulative = 2.32839e18 Pressure gradient source: uncorrected Ubar = 0.1335, pressure gradient = 2.77468e05 GAMG: Solving for p, Initial residual = 0.0165409, Final residual = 5.45694e07, No Iterations 5 time step continuity errors : sum local = 5.65104e10, global = 1.5652e20, cumulative = 2.34404e18 Pressure gradient source: uncorrected Ubar = 0.1335, pressure gradient = 2.76982e05 ExecutionTime = 14.61 s ClockTime = 15 s fieldAverage fieldAverage1 write: Calculating averages Courant Number mean: 0.302862 max: 0.539102 Time = 5.6 

March 26, 2020, 16:43 

#2 
Senior Member
Herpes Free Engineer
Join Date: Sep 2019
Posts: 313
Rep Power: 3 
 Do you execute `div` FO on converged cases? The reason of the question is that the divergence of velocity is expected to reduce to zero, but the intermediate steps might not well resort to zerodivergence. For `steadystate` cases, `bounded` keyword can be added to the divergence scheme, please see example.
 Which versions do you use? Have you tested different versions, and obtained similar results?
__________________
The OpenFOAM community is the biggest contributor to OpenFOAM, not a person A or B: User guide/Wiki1/Wiki2/Code guide/Code Wiki H.Nilsson/J.Guerrero/G.Holzinger/J.Nagy/B.Santos OpenFOAM Governance and Technical Committees Report bugs/Request features: OpenFOAM (ESIOpenCFDTrademark) Report bugs/Request features: FOAMExtend (WikkiFSB) Report bugs: OpenFOAM (Foundation) How to create a Minimal, Reproducible Example 

March 26, 2020, 19:36 

#3  
New Member
Finn Boire
Join Date: Mar 2020
Posts: 2
Rep Power: 0 
Thanks for the response!
Quote:
Quote:
Quote:
Quote:
Again, thank you so much for the response! I'm really hoping we can figure this out! 

March 27, 2020, 06:50 

#4 
Senior Member
Herpes Free Engineer
Join Date: Sep 2019
Posts: 313
Rep Power: 3 
>> My understanding is that at the end of any timestep, the zerodiv condition should be met, but I very well could be wrong.
I think that might be the subtlety. To my understanding, div(U)=0 can be reached for an incompressible flow computation at the end of a converged simulation. Quoting from this link: "For numerical solution of incompressible flows, div(U)=0 at convergence, at which point the third term on the right hand side is zero. Before convergence is reached, however, div(U)=0 and in some circumstances it is better to include the term within a numerical solution because it helps maintain boundedness of the solution variable and promotes better convergence." So, I assume you measure "div(U)=0" at the end of each timestep, rather than at the end of a simulation?
__________________
The OpenFOAM community is the biggest contributor to OpenFOAM, not a person A or B: User guide/Wiki1/Wiki2/Code guide/Code Wiki H.Nilsson/J.Guerrero/G.Holzinger/J.Nagy/B.Santos OpenFOAM Governance and Technical Committees Report bugs/Request features: OpenFOAM (ESIOpenCFDTrademark) Report bugs/Request features: FOAMExtend (WikkiFSB) Report bugs: OpenFOAM (Foundation) How to create a Minimal, Reproducible Example 

Tags 
divergence free, pimplefoam 
Thread Tools  Search this Thread 
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
[solidMechanics] Support thread for "Solid Mechanics Solvers added to OpenFOAM Extend"  bigphil  OpenFOAM CC Toolkits for FluidStructure Interaction  537  March 11, 2020 06:53 
Transient simulation not converging  skabilan  OpenFOAM Running, Solving & CFD  14  December 16, 2019 23:12 
[OpenFOAM] Take derivative of mean velocity in paraFoam  hiuluom  ParaView  13  April 26, 2016 06:44 
InterFoam negative alpha  karasa03  OpenFOAM  7  December 12, 2013 03:41 
How to write k and epsilon before the abnormal end  xiuying  OpenFOAM Running, Solving & CFD  8  August 27, 2013 15:33 