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

InterFoam: Different results in OF5 and OF6

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree5Likes
  • 1 Post By wyldckat
  • 2 Post By snak
  • 1 Post By vatavuk
  • 1 Post By wyldckat

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 27, 2018, 12:09
Default InterFoam: Different results in OF5 and OF6
  #1
Senior Member
 
Paulo Vatavuk
Join Date: Mar 2009
Location: Campinas, Brasil
Posts: 176
Rep Power: 11
vatavuk is on a distinguished road
Dear Foamers,

I ran the weirOverflow tutorial in OF5 and OF6 and got slightly different results. In the image below there are the two screen captures (for alpha.water) that correspond to the time = 8 s in OF5 and OF6. In OF6 the water seems more attached to the wall and in OF5 the water separates from the wall.

What is really strange is that I sent a report about this in OpenFOAM Issue tracking system and the developer answered that he could not reproduce the problem because he got the same results in both versions and others that he tested. See https://bugs.openfoam.org/view.php?id=3011

To understand what is happening I ask if anyone can run this tutorial in OF6 and tell if they got the same results I got for t=8s. The tutorial can be found at tutorials/multiphase/interFoam/RAS/weirOverFlow




All the best,
Paulo

Last edited by vatavuk; July 28, 2018 at 11:15.
vatavuk is offline   Reply With Quote

Old   July 30, 2018, 03:53
Default
  #2
Member
 
cyss38's Avatar
 
Cyrille Bonamy
Join Date: Mar 2015
Location: Grenoble, France
Posts: 36
Rep Power: 5
cyss38 is on a distinguished road
I have run the tutorial with openfoam-5.0 and openfoam-6.

I found exactly the same results as you...
In OF6 the water is attached to the wall contrary to the OF5 simulation...

I don't understand why and i don t know which result is the good one...
cyss38 is offline   Reply With Quote

Old   July 30, 2018, 07:46
Default
  #3
Senior Member
 
Paulo Vatavuk
Join Date: Mar 2009
Location: Campinas, Brasil
Posts: 176
Rep Power: 11
vatavuk is on a distinguished road
Hi Cyrille,

Thanks for confirming the results. I was thinking that it could be something related to my installation. I will report this problem again to the OpenFOAM issue tracking system to see if the developers can help us.

Best regards,
Paulo
vatavuk is offline   Reply With Quote

Old   August 15, 2018, 11:59
Default
  #4
Senior Member
 
Paulo Vatavuk
Join Date: Mar 2009
Location: Campinas, Brasil
Posts: 176
Rep Power: 11
vatavuk is on a distinguished road
Hi Foamers,

Uptdating the information. I sent a new report to OpenFOAM issue tracking see https://bugs.openfoam.org/view.php?id=3028#c9900.

For some mysterious reason the developer is not being able to reproduce our results, so he will not be able to help us.

I suppose this problem could be solved comparing the source code of versions 5 and 6 of interFoam and analyzing the differences until the source of the problem is found. At this moment, I don't have time to do this.

My suggestion to the users is to be careful with possible strange behaviour in version 6 of interFoam. Any help with this is welcome.

Best Regards,
Paulo
vatavuk is offline   Reply With Quote

Old   August 20, 2018, 22:30
Default
  #5
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,470
Blog Entries: 41
Rep Power: 115
wyldckat is a glorious beacon of lightwyldckat is a glorious beacon of lightwyldckat is a glorious beacon of lightwyldckat is a glorious beacon of lightwyldckat is a glorious beacon of lightwyldckat is a glorious beacon of light
Greetings to all!

I was curious about this and took a somewhat quick look into this.

The first detail is that the bug reports were always closed, because only the end result at 60s was being looked at. Quoting from here: https://bugs.openfoam.org/view.php?id=3011#c9867
Quote:
[...] and get the same results in all 4 cases: the water is initially detached from the wall but by the end of the run is attached.
Given that the "maxCo" is restricted to 0.2, the results should be time accurate in either simulation, however only the end result was checked.

The list of changes made to the folder "applications/solvers/multiphase/interFoam" can be seen online here: https://github.com/OpenFOAM/OpenFOAM...hase/interFoam

As visible there, the code changes that likely affected this were:
  1. interDyMFoam was merged into interFoam.
  2. Before that, interDyMFoam had several changes between OpenFOAM 5 and 6, which included mass conservation and proper MRF handling, which may have affected the modeling methodology.
Now, the problem here is how to verify if there is in fact an error in modeling in either OpenFOAM 5 or 6. For that, either:
  1. The equations would have to be studied manually;
  2. Or monitoring for mass conservation, to see if there are any mass conservation issues.
  3. Or we need validation data, to be able to tell apart which one is closest to reality.
Visually, if seems to me like the OpenFOAM 6 version is properly conserving mass, while 5.x seems like it's generating some extra water in the vortex between the inclined wall and the jet stream...
But upon closer inspection, at 4s the front of the wave is somewhat different and has a higher speed in OpenFOAM 5.x. Therefore, it is possible that the inlet flow rate may be too close to the instable flow region where it can easily jump or not from the top if there is more or less X m3/s coming in.

I haven't run more simulations on this case, given that I haven't been working on this topic and am not familiar enough on what to expect here.

Best regards,
Bruno
vatavuk likes this.
__________________
wyldckat is offline   Reply With Quote

Old   November 16, 2018, 07:24
Default
  #6
Member
 
shinji nakagawa
Join Date: Mar 2009
Location: Japan
Posts: 40
Rep Power: 12
snak is on a distinguished road
Hi All,

I made a quick test with capillaryRise tutorial case.

Water in the thin cavity keeps oscillating with OpenFOAM 5.
With OpenFOAM 6, the oscillation is damped down and this seems to be comparatively realistic
The history of the averaged water level is shown in the following graphs.



This change is initiated with the following commit and the cause of the difference in the weirOverflow tutorial too.
https://github.com/OpenFOAM/OpenFOAM...b4438a3a038c1b


The comment of the commit is
Code:
commit da787200a6b208cf3fc4dfaa48b4438a3a038c1b
 Author: Henry Weller <http://openfoam.org>
Date:   Mon Jan 8 21:35:00 2018 +0000

    ddtScheme::fvcDdtPhiCoeff: Improved formulation providing better stability/accuracy balance

    Resolves problem with pressure "staggering" when running with a very Courant
     number.
The difference will not be a bug. It will be an improved result.


I have not yet figured out the meanings of the code change itself.


I would appreciate it if somebody could explain the theories behind the code-change.
vatavuk and wyldckat like this.

Last edited by snak; November 16, 2018 at 08:31.
snak is offline   Reply With Quote

Old   December 3, 2018, 07:43
Default
  #7
Senior Member
 
Paulo Vatavuk
Join Date: Mar 2009
Location: Campinas, Brasil
Posts: 176
Rep Power: 11
vatavuk is on a distinguished road
Hi Bruno and Shinji,

Many thanks for the help in understanding this problem.

As Shinji has shown, the modifications in version 6 improve the results for the capillaryRise tutorial. About the weirOverflow tutorial it is difficult to say if the results improved or not.

In the next months I intend to do some tests using interFoam in classic hydraulic flows. In the tests I will include comparisons of versions 5 and 6, this may give additional information about which version has better behavior.

About the commit that Shinji identified as being the source of the differences, I know the code only superficially but it seems that it changes the functions fvcDdtPhiCorr and fvcDdtUjCorr which are used to calculate the time derivative in specific situations. fvc is an explicit calculation opposed to fvm which updates a matrix. Ddt is time derivative. Phi is the mass flow across a face. Uf, I think means face velocity.

All the Best,
Paulo
snak likes this.
vatavuk is offline   Reply With Quote

Old   December 4, 2018, 18:00
Default
  #8
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,470
Blog Entries: 41
Rep Power: 115
wyldckat is a glorious beacon of lightwyldckat is a glorious beacon of lightwyldckat is a glorious beacon of lightwyldckat is a glorious beacon of lightwyldckat is a glorious beacon of lightwyldckat is a glorious beacon of light
Quick answer @snak: Given your feedback on this, I've taken another look at this commit and all signs point to this being an innocently simple correction to the code: It now uses the values from the correct time step when making corrections that are based on the previous time step.
For example, this correction:
Code:
-               this->fvcDdtPhiCoeff(rhoU0, phi.oldTime())
+               this->fvcDdtPhiCoeff(rhoU0, phi.oldTime(), rho.oldTime())
This to me implies that:
  • the original code was assuming that "rho" from the current time step would be used with "phi" from the previous time step;
  • the new code now uses "phi" and "rho" from the previous time step.
All of the changes in that commit do related corrections, which seems to imply that this correction is critical for high Courant numbers, where the larger time steps create a much higher discrepancy between time steps.


If you have the time/curiosity, try running the case with a smaller time step or "maxCo", to see if both results improve.




@Paulo: Validation data/cases are always welcome!
snak likes this.
wyldckat is offline   Reply With Quote

Old   December 5, 2018, 10:34
Default
  #9
Member
 
shinji nakagawa
Join Date: Mar 2009
Location: Japan
Posts: 40
Rep Power: 12
snak is on a distinguished road
Hi, Paulo and Santos,

Thank you very much for your feedback.

Info from both of you is very much informative and help me and my colleagues.

I will do some more test and will share results.

CapillaryRise tutorial uses the parallel walls. A tube using the cylindrical coordinates shows the same tendency. However, oscillation is converged rapidly in the tube with OpenFOAM 6.

Thanks again,
snak is offline   Reply With Quote

Reply

Tags
interfoam

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
Pingbacks are On
Refbacks are On



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