|
[Sponsors] |
Pressure difference as an input to simpleFoam |
![]() |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
![]() |
![]() |
#1 |
New Member
Ahmad Mahmoud
Join Date: Aug 2021
Posts: 2
Rep Power: 0 ![]() |
I have a problem where I am required to simulate the flow through a reconstructed geometry of a human vessel (pipe flow), where the pressure at the inlet and at the outlet is known, in order to find the resultant flow rate.
My question is how should I set up a case in openFoam using the simpleFoam solver, where the pressures are the input and no velocity is specified. I have tried doing this by setting the velocity boundary condition to zero gradient at both ends, and the pressure as fixed value for both values, but the results were usually unstable and did not converge satisfactorily. I have tried with k-epsilon turbulence models as well as k-omega SST and even fully laminar, but none of them would converge. What appropriate boundary conditions should I use and how can I improve the stability and convergence of the problem? Thank in advance! |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Member
Francisco T
Join Date: Nov 2011
Location: Melbourne, Australia
Posts: 64
Blog Entries: 1
Rep Power: 15 ![]() |
That seems correct. Check the file attached, which is a microchannel (100microns x 20) the velocity is generated correctly with pressure. This case is laminar.
microch_vel.png microchannel100x20Pressure.zip Perhaps you can try laminar first and then add turbulence later? What issues are you having? Cheers Francisco |
|
![]() |
![]() |
![]() |
![]() |
#3 |
Member
Andreas P.
Join Date: May 2017
Posts: 41
Rep Power: 9 ![]() |
Maybe you can try the pressureInletUniformVelocity instead of zeroGradient for one side. This sets velocity to a constant value over the whole inlet in one direction, which made simulations stable in my case...
https://www.openfoam.com/documentati...d.html#details |
|
![]() |
![]() |
![]() |
![]() |
#4 | |
New Member
Ahmad Mahmoud
Join Date: Aug 2021
Posts: 2
Rep Power: 0 ![]() |
Quote:
What value would I set i to. Note that I do not have vales for the velocity or the flux, that is the value i am after. |
||
![]() |
![]() |
![]() |
![]() |
#5 |
Member
Andreas P.
Join Date: May 2017
Posts: 41
Rep Power: 9 ![]() |
The "value" field ist just a dummy field for this boundary condition, that will be overwritten by the calculation of the boundary condition. So you can just set it to 0.
|
|
![]() |
![]() |
![]() |
![]() |
#6 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 821
Rep Power: 16 ![]() |
Another suggestion is to apply a total pressure boundary condition at the upstream end; the ESI documentation page (https://www.openfoam.com/documentati...tions-subsonic) suggests that this gives good stability ... my experience is a bit mixed though. Let us know what ends up working for you.
|
|
![]() |
![]() |
![]() |
![]() |
#7 |
Senior Member
|
Aha!
What has your experience with subsonic cases been? I am working on a jet-in-co-flow with transonic jet to (hopefully) clarify convergence issues. What are in your experience are point to look into? Would pressure-velocity coupled solver help in these cases? Thx, Domenico. |
|
![]() |
![]() |
![]() |
![]() |
#8 | |
New Member
Zhen Liao
Join Date: Apr 2022
Posts: 16
Rep Power: 5 ![]() |
Quote:
Have you solved the problem yet? What boundary conditions are appropriate? These days I met the same stability and convergence problem when I simulated the plane-Poiseuille flow (plane-parallel plates with pressure gradient). I chose the simpleFoam solver, and set simulationType as laminar in the turbulenceProperties file, and the boundary and initial conditions are showed in the followed figure. According to my result, it didn’t converge even after 200000 time steps (attached figure 2). But, one good point is the simulated outlet flux is matched quite well with the calculated flux by the theoretical equation (Cubic law: v=-△Pw^2/(12μL) (m/s)). |
||
![]() |
![]() |
![]() |
![]() |
#9 | |
New Member
Zhen Liao
Join Date: Apr 2022
Posts: 16
Rep Power: 5 ![]() |
Quote:
https://drive.google.com/drive/folde...Th?usp=sharing |
||
![]() |
![]() |
![]() |
![]() |
#10 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 821
Rep Power: 16 ![]() |
If you look at the log file that you posted, you'll see that it is doing zero iterations on the solvers for Ux and p ... which means that it has stopped solving. You need to adjust the solver tolerances to force it to solve to a tighter residual level, or add a minIter line in the solver instructions to force it to always do at least 1 iteration. That will keep it solving ... up to the limit posed by your grid design. Hope that helps.
|
|
![]() |
![]() |
![]() |
![]() |
#11 | |
New Member
Zhen Liao
Join Date: Apr 2022
Posts: 16
Rep Power: 5 ![]() |
Quote:
Actually I conducted some other cases by setting different tolerances. As you can see from the attached figure, if the tolerances are bigger (cases name highlight by yellow), it can converge very fast, but the outlet flux didn’t match the theoretical value well (the theoretical averaged flow rate v = 0.4464 m/s); while if the tolerances are smaller, it’ll converge very hard. And how to add a minIter line in the solver intructions? I also a little confused about the exact meaning of “No Iterations X” in the log file. As you can see in my results, X can equal to nonzero in the converged cases. BTW, I wonder what’s the difference between the “tolerance” and “residualControl”? What are the exact meanings of “tolerance”, “relTol” and “residualControl”? What do these three values control? What settings are appropriate for them? Are there any tips or rules for people to obey? |
||
![]() |
![]() |
![]() |
![]() |
#12 | |
New Member
Zhen Liao
Join Date: Apr 2022
Posts: 16
Rep Power: 5 ![]() |
Quote:
I tried the pressureInletUniformVelocity type for the inlet (cases name highlight by green), it indeed converges very fast, but the calculated outlet flow rate didn’t match the theoretical value (v = 0.4464 m/s) well. I also tried the pressureInletVelocity type (cases name highlight by blue), it seems still has the stability and convergence problem. |
||
![]() |
![]() |
![]() |
![]() |
#13 | |
New Member
Zhen Liao
Join Date: Apr 2022
Posts: 16
Rep Power: 5 ![]() |
Quote:
I wonder which solver did you use for your case? simpleFoam, pisoFoam or pimpleFoam? I'm a little confused because I see seetings for PISO, SIMPLE & PIMPLE in the fvSolution file. |
||
![]() |
![]() |
![]() |
![]() |
#14 | |||
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 821
Rep Power: 16 ![]() |
Quote:
Code:
p { solver GAMG; tolerance 1e-08; relTol 0.01; smoother GaussSeidel; minIter 1; } Quote:
Quote:
|
||||
![]() |
![]() |
![]() |
![]() |
#15 | |
New Member
Zhen Liao
Join Date: Apr 2022
Posts: 16
Rep Power: 5 ![]() |
Quote:
Thank you very much for your patience! I have gone through the User Guide, it didn’t introduce much about the “No Iterations” and tolerance. I’ll refer to the book you recommended. According to my limited understanding, the values of “No Iterations” will lower from a high value towards to 0, right? So, when the values of Ux & p equal to 0, does it means Ux & p have converged (i.e., stopped solving/iterating)? So a better result maybe that when the whole simulation is converged, all the “No Iterations” values equal to 0? I mean, each variables (Ux, Uy, p) converged, then the whole simulation converged? And I have run some cases by adding the minIter and lowering the tolerances, hope they will show better results. |
||
![]() |
![]() |
![]() |
![]() |
#16 | |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 821
Rep Power: 16 ![]() |
The main issue is that although the residual values are normalised, their magnitude can vary from problem to problem, so a solver tolerance value that works for one problem may not be effective in another. That's why you need to keep an eye on your log file and adjust your solver settings from case to case.
Quote:
For most SIMPLE simulations, you should have a small number of velocity and turbulence inner iterations (maybe even just one) and rather more pressure iterations - sometimes a few hundred. This should be the case all the way through to "convergence", i.e. until you decide that the solution is not changing significantly and you can stop the run. To decide the latter, use the residuals of course, but also monitor quantities that are of interest to you (eg velocity in a key point in the flow, macro quantity like drag on a wing, etc etc). |
||
![]() |
![]() |
![]() |
![]() |
#17 | |
Senior Member
Josh Williams
Join Date: Feb 2021
Location: Scotland
Posts: 114
Rep Power: 6 ![]() |
Quote:
In my experience with pressure driven flow, it is best when the inlet is pressureInletVelocity and the outlet is pressureInletOutletVelocity. |
||
![]() |
![]() |
![]() |
![]() |
#18 |
New Member
Zhen Liao
Join Date: Apr 2022
Posts: 16
Rep Power: 5 ![]() |
Hi Tobermory,
You're right, the number of iterations do not need to drop to zero, I misunderstood this point. Thank you very much for your patient and careful reply! And I found that for my cases, if I set tolerances to 10e-8, residualControls to 10e-6, they can converge much better. |
|
![]() |
![]() |
![]() |
![]() |
#19 |
New Member
Zhen Liao
Join Date: Apr 2022
Posts: 16
Rep Power: 5 ![]() |
Hi Josh,
Thank you for you advice! According to my newest result, if I set inlet is pressureInletVelocity and the outlet is zeroGradient, and set tolerances to 10e-8, residualControls to 10e-6, it can converge better and match the theoretical value well. I'll try to set the outlet to pressureInletOutletVelocity to see if it can perform better! |
|
![]() |
![]() |
![]() |
![]() |
#20 |
Senior Member
Josh Williams
Join Date: Feb 2021
Location: Scotland
Posts: 114
Rep Power: 6 ![]() |
I am working on something similar; flow in human airways taken from CT scans, with time-varying pressure defined at outlets. For a simple one bifurcation case, the BCs I mentioned above work very well (as I showed). But when the geometry gets more complex it fails (timestep gets very small as few cells at the outlet have big courant number).
Is your geometry complex like this? What fvSchemes are you using? I think my velocity BCs and pressure BCs are okay, so I think there is something else causing this. |
|
![]() |
![]() |
![]() |
Tags |
boundary condition, internal flow, pipe flow, simplefoam convergence, simplefoam pressure bc |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Difference between p (pressure) and static pressure | PeterShi | OpenFOAM Post-Processing | 2 | March 19, 2019 16:23 |
pressure in incompressible solvers e.g. simpleFoam | chrizzl | OpenFOAM Running, Solving & CFD | 13 | March 28, 2017 05:49 |
Pressure difference at INLET and OUTLET. | lovegne | FLUENT | 2 | January 27, 2017 07:28 |
Neumann pressure BC and velocity field | Antech | Main CFD Forum | 0 | April 25, 2006 02:15 |
Hydrostatic pressure in 2-phase flow modeling (CFX4.2) | HB &DS | CFX | 0 | January 9, 2000 13:19 |