pressure distribution in water flow, differences in icoFoam and COMSOL
3 Attachment(s)
Hello,
I simulate flow in an open stream over repeating streambed geometries (sinusoidal geometry of ripples). I used COMSOL some weeks ago and tried to do the same job in OpenFOAM. Now, I'm a bit confused about the different results, even I use similar (boundary) conditions. The general model setup: Water is entering the domain in an parabolic velocity profile at the left boundary and leaves it at the right. Top bc is symmetryPlane and bottom is noslip bc. In OF I use icoFoam, COMSOL is also laminar flow. The results: The velocity fields are looking quite similar, whereas pressure (p) distributions show differences: In flow experiments and literature the highest pressure occurs at the stoss side of the ripple (plane against flow direction), and low pressure on the lee side (plane in flow direction). COMSOL shows exactly this behavior, but OF does not. In OF, lowest pressure values are exactly at the crest of the ripple. Highest values are in the "valleys". Also the pressure magnitude differs: In COMSOL it accounts for 200 Pa, in OF it is only 2e3 Pa and pressure is negative (!?) at left inlet. The relative pressure distribution does not depend on velocity. Maybe (and hopefully) the differences are related to calculations concerning Bernoullis eq: p = p_dynamic + p_hydrostatic ? Btw: sigmayy = wallGradU(y) * nu (=1e6) shows a distribution similar to COMSOL and as expected, but with a magnitude of 5e3 Pa. Please look at my attached files: The first one shows the velocity and pressure distribution in COMSOL, red is high, blue is low value. The other two pictures show U and p in OF, blue is low, green is high value. Can somebody explain these differences? Thanks, Nico 
Hi Nico
icoFoam has the switch momentumPrediction. Is this turned on? It seems like seperation is not occuring in one of the cases hence the shift in pressure distribution. / Niels 
hi Niels,
never heard of this, where can I switch it "on"? Thanks! Nico 
Take a look in the fvSolution file in the system folder.
/ Niels 
Thats my fvsolution file:
Code:
FoamFile 
Sorry, the switch has been removed from 1.6, so it is probably not in 1.7 either.
Could you post more detailed vector plots of the velocity field on the lee side from both models?  Niels 
2 Attachment(s)
I hope this is ok. For more comsoldetails I have to switch to windows...
Thanks for your help, Niels. Nico 
Hi Nico
Based on the pictures the ripples in COMSOL and OF are not identical, having a troughtocrest over length ratio of 0.88 and 0.67 respectively, hence you are comparing apples and pears. This also explains the difference in pressure distribution. / Niels 
Hi Niels,
yes that's true, but geometry of the ripples does not influence the location of the highest pressure on the stoss side. I changed geometry often, and tried it also with more "realistic" round ripples. It seems like the pfield in OF is rather a pure hydostatic pressure than the addition of dynamic and hydrostatic pressure. I'm also wondering about the sigmayy values, that show at least the right distribution, apart from a reliable magnitute (approx. 50  100 Pa). Nico 
To solve the momentum predictor add
momentumPredictor on; to the PISO subdictionary in fvSolution. The switch is still in the code, just not in the tutorial. 
Sorry... icoFoam, and I was thinking to pisoFoam. Please, ignore my previous post :)
icoFoam always solves the momentum predictor in 1.7.x 
Maybe the unconsidered gravitiy force in icoFoam could be a reason for my different results?

Hi
Have you tried switching off gravity in COMSOL then? If you are comparing total pressure with excess pressure, then there most be significant differences. / Niels 
Hello,
in most of the cases, including posted pic above, gravity was switched off in COMSOL. But in general, for me it's not completely clear, when and then why gravity force should be considered in CFD (Sorry for this beginners question). Nico 
3 Attachment(s)
Hello again,
I played a bit with the pressure data of my results. By calculating p = p_dynamic + p_hydrostatic I obtain pressure data as I expect it. In the first picture the pressure output p calculated by OF is shown: Lowest pressure at the highest point and highest pressure at the lowest point. In graph1 the dark blue line indicates the pressure distribution (p) of the bottom plane and shows same distribution as the picture. The green line is the linear interpolation between maxima and minima of the pressure data. This should describe p_hydrostatic. In the next step I subtract p_hydrostatic from p (blue minus green line). The result is shown in graph2 by the light blue line. In respect to p = p_dynamic + p_hydrostatic this indicates p_dynamic. But on the lee side dynamic pressure should be negative, due to the downstream velocity. Considering this, the highest pressure is located on the stoss side, while the lowest is on the lee side (red dashed line). With this result the values and the distribution of p_dynamic are in the magnitude of the COMSOL model and the literature. A more or less sinusoidal pressure distribution occurs. So far so good. For my further simulations mainly the dynamic pressure is of importance. My question: How can I modify icoFoam / pisoFoam to obtain only dynamic pressure? Any comment on my post is welcome. Thank you. Nico 
All times are GMT 4. The time now is 13:52. 