|
[Sponsors] |
March 25, 2020, 20:21 |
Incompressible div(U) validation errors
|
#1 |
New Member
F.B.
Join Date: Mar 2020
Posts: 3
Rep Power: 6 |
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.81593e-06, No Iterations 2 smoothSolver: Solving for Uy, Initial residual = 0.0603226, Final residual = 2.72548e-06, No Iterations 3 smoothSolver: Solving for Uz, Initial residual = 0.0585004, Final residual = 2.7339e-06, No Iterations 3 Pressure gradient source: uncorrected Ubar = 0.1335, pressure gradient = 2.76228e-05 GAMG: Solving for p, Initial residual = 0.146204, Final residual = 0.0126411, No Iterations 1 time step continuity errors : sum local = 1.14563e-05, global = -8.27789e-20, cumulative = -2.0927e-18 Pressure gradient source: uncorrected Ubar = 0.1335, pressure gradient = 2.76872e-05 GAMG: Solving for p, Initial residual = 0.0163918, Final residual = 4.2532e-07, No Iterations 5 time step continuity errors : sum local = 4.5834e-10, global = -1.12784e-19, cumulative = -2.20548e-18 Pressure gradient source: uncorrected Ubar = 0.1335, pressure gradient = 2.76392e-05 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.80108e-06, No Iterations 2 smoothSolver: Solving for Uy, Initial residual = 0.0603712, Final residual = 2.65463e-06, No Iterations 3 smoothSolver: Solving for Uz, Initial residual = 0.0584964, Final residual = 2.67235e-06, No Iterations 3 Pressure gradient source: uncorrected Ubar = 0.1335, pressure gradient = 2.76884e-05 GAMG: Solving for p, Initial residual = 0.146366, Final residual = 0.0127159, No Iterations 1 time step continuity errors : sum local = 1.15734e-05, global = -1.22909e-19, cumulative = -2.32839e-18 Pressure gradient source: uncorrected Ubar = 0.1335, pressure gradient = 2.77468e-05 GAMG: Solving for p, Initial residual = 0.0165409, Final residual = 5.45694e-07, No Iterations 5 time step continuity errors : sum local = 5.65104e-10, global = -1.5652e-20, cumulative = -2.34404e-18 Pressure gradient source: uncorrected Ubar = 0.1335, pressure gradient = 2.76982e-05 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, 17:43 |
|
#2 |
Senior Member
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 13 |
- 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 zero-divergence. For `steady-state` 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: User guide/Wiki-1/Wiki-2/Code guide/Code Wiki/Journal Nilsson/Guerrero/Holzinger/Holzmann/Nagy/Santos/Nozaki/Jasak/Primer Governance Bugs/Features: OpenFOAM (ESI-OpenCFD-Trademark) Bugs/Features: FOAM-Extend (Wikki-FSB) Bugs: OpenFOAM.org How to create a MWE New: Forkable OpenFOAM mirror |
|
March 26, 2020, 20:36 |
|
#3 | ||||
New Member
F.B.
Join Date: Mar 2020
Posts: 3
Rep Power: 6 |
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, 07:50 |
|
#4 |
Senior Member
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 13 |
>> My understanding is that at the end of any timestep, the zero-div 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 time-step, rather than at the end of a simulation?
__________________
The OpenFOAM community is the biggest contributor to OpenFOAM: User guide/Wiki-1/Wiki-2/Code guide/Code Wiki/Journal Nilsson/Guerrero/Holzinger/Holzmann/Nagy/Santos/Nozaki/Jasak/Primer Governance Bugs/Features: OpenFOAM (ESI-OpenCFD-Trademark) Bugs/Features: FOAM-Extend (Wikki-FSB) Bugs: OpenFOAM.org How to create a MWE New: Forkable OpenFOAM mirror |
|
April 20, 2020, 20:56 |
|
#5 |
New Member
F.B.
Join Date: Mar 2020
Posts: 3
Rep Power: 6 |
Sorry for not responding for a while.
I might be mixing terms, but yes - I mean "div(U)=0" at the end of each timestep, which doesn't seem to be the case when I compute it. This is a dynamic simulation, which I'm not expecting to converge to a steady state. It's just very surprising that the divergence is nonzero in this incompressible solver. I can't wrap my head around it! |
|
April 21, 2020, 05:00 |
|
#6 |
Senior Member
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 13 |
just numerics/floating point representation of the information - every CFD solver is prone to it. I wouldn't worry about it.
__________________
The OpenFOAM community is the biggest contributor to OpenFOAM: User guide/Wiki-1/Wiki-2/Code guide/Code Wiki/Journal Nilsson/Guerrero/Holzinger/Holzmann/Nagy/Santos/Nozaki/Jasak/Primer Governance Bugs/Features: OpenFOAM (ESI-OpenCFD-Trademark) Bugs/Features: FOAM-Extend (Wikki-FSB) Bugs: OpenFOAM.org How to create a MWE New: Forkable OpenFOAM mirror |
|
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 Fluid-Structure Interaction | 686 | December 22, 2022 10:10 |
Transient simulation not converging | skabilan | OpenFOAM Running, Solving & CFD | 14 | December 17, 2019 00:12 |
[OpenFOAM] Take derivative of mean velocity in paraFoam | hiuluom | ParaView | 13 | April 26, 2016 07:44 |
InterFoam negative alpha | karasa03 | OpenFOAM | 7 | December 12, 2013 04:41 |
How to write k and epsilon before the abnormal end | xiuying | OpenFOAM Running, Solving & CFD | 8 | August 27, 2013 16:33 |