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 Community New Posts Updated Threads Search

Like Tree8Likes
  • 2 Post By wyldckat
  • 2 Post By snak
  • 1 Post By vatavuk
  • 1 Post By wyldckat
  • 2 Post By kerim

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 27, 2018, 11:09
Default InterFoam: Different results in OF5 and OF6
  #1
Senior Member
 
Paulo Vatavuk
Join Date: Mar 2009
Location: Campinas, Brasil
Posts: 196
Rep Power: 17
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 10:15.
vatavuk is offline   Reply With Quote

Old   July 30, 2018, 02:53
Default
  #2
Member
 
cyss38's Avatar
 
Cyrille Bonamy
Join Date: Mar 2015
Location: Grenoble, France
Posts: 85
Rep Power: 11
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, 06:46
Default
  #3
Senior Member
 
Paulo Vatavuk
Join Date: Mar 2009
Location: Campinas, Brasil
Posts: 196
Rep Power: 17
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, 10:59
Default
  #4
Senior Member
 
Paulo Vatavuk
Join Date: Mar 2009
Location: Campinas, Brasil
Posts: 196
Rep Power: 17
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, 21:30
Default
  #5
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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 and mcfdma like this.
__________________
wyldckat is offline   Reply With Quote

Old   November 16, 2018, 06:24
Default
  #6
Senior Member
 
shinji nakagawa
Join Date: Mar 2009
Location: Japan
Posts: 113
Blog Entries: 1
Rep Power: 18
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 07:31.
snak is offline   Reply With Quote

Old   December 3, 2018, 06:43
Default
  #7
Senior Member
 
Paulo Vatavuk
Join Date: Mar 2009
Location: Campinas, Brasil
Posts: 196
Rep Power: 17
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, 17:00
Default
  #8
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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, 09:34
Default
  #9
Senior Member
 
shinji nakagawa
Join Date: Mar 2009
Location: Japan
Posts: 113
Blog Entries: 1
Rep Power: 18
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

Old   July 9, 2020, 18:05
Default
  #10
Senior Member
 
abdikerim kurbanaliev
Join Date: Jun 2010
Location: Kyrgyzstan, Osh
Posts: 120
Rep Power: 15
kerim is on a distinguished road
Hello everyone,
Despite the fact that this post is already old, I decided to share my calculation results. I performed calculations with different versions of the package and got slightly different results, as noted above. For example, version 1906, 5 and 7 gives approximately the same results, while version 6.0 gives a completely different result. Please see the attached picture. The picture shows that the non-stationary flow turns into a stationary one for about 46 seconds after the start of the motion. However, according to version 6.0, this transition is almost instantaneous, which causes some doubts from a physical point of view. Therefore, I believe that the combination of two methods - interDyMFoam and interFoam for simulations of two-phase flows is not entirely successful. If we had experimental data, we could easily test this point of view. The second conclusion, that comes from the figure, relates to the visualization of the initial distribution of alpha.water. In the case of version 1906, it shows an incorrect alpha distribution, which refers to the first moment of output time.
Kerim
Attached Images
File Type: jpg alpha.jpg (96.6 KB, 66 views)
vatavuk and snak like this.
kerim is offline   Reply With Quote

Old   January 5, 2021, 09:32
Default InterFoam: Different results in OF5 and OF6
  #11
Senior Member
 
abdikerim kurbanaliev
Join Date: Jun 2010
Location: Kyrgyzstan, Osh
Posts: 120
Rep Power: 15
kerim is on a distinguished road
Dear All,
Happy new year to all of you in 2021!
I am struggling to find a source of difference between OF5 and OF6.
Dear Vitavuk were you able to do some tests using interFoam in classic hydraulic flows. I post#7 you said that “In the tests, you will include comparisons of versions 5 and 6, this may give additional information about which version has better behavior”.
In my own post #10, I was wrong saying that the combination of two methods - interDyMFoam and interFoam for simulations of two-phase flows is not entirely successful. Because here we have static mesh.
I have attached three pictures. I have made calculations with different OF versions.
1. alpha1 – OF1906, OF5, OF6, OF7
2. alpha2 – OF4, OF2006, OF8
3. alpha3 – calculation at different mass flow rates – at 7.5, 37.5, 75, and 150 m3/s.

From the above-mentioned pictures, one can see that all versions, except OF6, give us almost the same results.
Question #1. If we suppose that OF6 has improved comparatively oldest versions OF4 and OF5, what we can say about more new versions OF1906, OF2006, OF7, OF8?
Question #2. What is the reason to carry out calculation up to 60s, if we have stationary water flow more early, say around 10s?
Question #3. The calculations at different mass flow rate show that water flow close to the inclined wall. Why?
Attached Images
File Type: jpg alpha1.jpg (96.6 KB, 26 views)
File Type: png alpha2.png (91.1 KB, 24 views)
File Type: png alpha3.png (27.0 KB, 22 views)
kerim is offline   Reply With Quote

Old   January 5, 2021, 10:37
Default
  #12
Senior Member
 
shinji nakagawa
Join Date: Mar 2009
Location: Japan
Posts: 113
Blog Entries: 1
Rep Power: 18
snak is on a distinguished road
Hi,


The ddtScheme has been reverted to previous one with the following commit;


ddtScheme::fvcDdtPhiCoeff: Reverted to previous flux-normalised scheme

https://github.com/OpenFOAM/OpenFOAM...ffef6ac7c5a7a0
snak is offline   Reply With Quote

Old   January 5, 2021, 11:50
Default
  #13
Senior Member
 
abdikerim kurbanaliev
Join Date: Jun 2010
Location: Kyrgyzstan, Osh
Posts: 120
Rep Power: 15
kerim is on a distinguished road
Hi,

Thank you very much for your quick answer.
It saved a lot of our time.
I downloaded OF6 2 days ago for checking any changes.
the results still the same.
Does it mean that no changes have been made in OF6 right?
kerim is offline   Reply With Quote

Old   January 6, 2021, 06:39
Default
  #14
Senior Member
 
shinji nakagawa
Join Date: Mar 2009
Location: Japan
Posts: 113
Blog Entries: 1
Rep Power: 18
snak is on a distinguished road
Hi,

https://github.com/OpenFOAM/OpenFOAM...ffef6ac7c5a7a0
The above commit is dated on 21 Feb 2019 and has a tag "20190304".

https://github.com/OpenFOAM/OpenFOAM...n-7...20190304
The comparison of codes between tags "version-7" and "20190304" shows nothing. You can check differences with the code you are using.

How do I know which version I am currently using?
https://develop.openfoam.com/Develop...urrently-using

OF6 of the initial release will not include the code changes we are talking about. After "Date: Mon Jan 8 21:35:00 2018 +0000" , the source code of OF6 includes the change. It will be better to check the exact version (commit) of OF you are using/looking into. I am not sure exactly from where, how, and which OF6 you downloaded.
snak is offline   Reply With Quote

Old   January 6, 2021, 08:47
Default
  #15
Senior Member
 
abdikerim kurbanaliev
Join Date: Jun 2010
Location: Kyrgyzstan, Osh
Posts: 120
Rep Power: 15
kerim is on a distinguished road
Hi,

On Jan 3, 2021, I downloaded OF6 from this site:

https://openfoam.org/download/6-ubuntu/

I have 18.04 LTS, bionic 64bit operating system.
kerim is offline   Reply With Quote

Old   January 6, 2021, 10:41
Default
  #16
Senior Member
 
shinji nakagawa
Join Date: Mar 2009
Location: Japan
Posts: 113
Blog Entries: 1
Rep Power: 18
snak is on a distinguished road
Hi,

You can check information about OpenFOAM you installed with the following command;


Code:
dpkg -l | grep openfoam
This will tell you the tag like “20190620”. We can see the tags at the following page;
https://github.com/OpenFOAM/OpenFOAM-dev/releases
At this page, you could find the tag you got within the context of history.

We can compare codes under two tags using the following page;
https://github.com/OpenFOAM/OpenFOAM...n-7...20190304

If you prefer working locally, you can check the source codes you have in your system. One of the files we are discussing is /opt/openfoam6/src/finiteVolume/finiteVolume/ddtSchemes/ddtScheme/ddtScheme.C.
snak is offline   Reply With Quote

Old   January 6, 2021, 23:00
Default
  #17
Senior Member
 
abdikerim kurbanaliev
Join Date: Jun 2010
Location: Kyrgyzstan, Osh
Posts: 120
Rep Power: 15
kerim is on a distinguished road
Hello,
Yes, I am doing the same work.
I have finished comparing \applications\solvers\multiphase\interFoam folder for OF5, OF6, and OF7.
Now I'm trying to understand methods of calculation of fvcDdtPhiCoeff as mentioned in post #8.
kerim is offline   Reply With Quote

Old   January 25, 2021, 19:48
Default
  #18
Senior Member
 
abdikerim kurbanaliev
Join Date: Jun 2010
Location: Kyrgyzstan, Osh
Posts: 120
Rep Power: 15
kerim is on a distinguished road
Dear Snak,

Please, explain the physical meaning of the fvcDdtPhiCoeff. How it related to the Euler method in OF?
kerim is offline   Reply With Quote

Old   January 26, 2021, 05:13
Default
  #19
Senior Member
 
shinji nakagawa
Join Date: Mar 2009
Location: Japan
Posts: 113
Blog Entries: 1
Rep Power: 18
snak is on a distinguished road
Hi,


It is discussed here;
DdtPhiCorr
snak is offline   Reply With Quote

Old   January 26, 2021, 17:22
Default
  #20
Senior Member
 
abdikerim kurbanaliev
Join Date: Jun 2010
Location: Kyrgyzstan, Osh
Posts: 120
Rep Power: 15
kerim is on a distinguished road
Snak,
Thanks a lot!
kerim is offline   Reply With Quote

Reply

Tags
interfoam


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



All times are GMT -4. The time now is 03:05.