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

Mass conservation in REEF3D_CFD

Register Blogs Community New Posts Updated Threads Search

Like Tree5Likes
  • 1 Post By kamath
  • 1 Post By valgrinda
  • 1 Post By valgrinda
  • 1 Post By kamath
  • 1 Post By kamath

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 2, 2022, 16:53
Question Mass conservation in REEF3D_CFD
  #1
New Member
 
Nicolás Badano
Join Date: Sep 2010
Posts: 16
Rep Power: 17
nbadano is on a distinguished road
Hello! I'm trying to evaluate if REEF3D_CFD is suitable for some channel flow hydrodynamic problems I need to simulate.

After compiling it, I started by simulating the dam break with obstacle tutorial cases to see how the model run. What I noticed immediately is that in that case the water fraction does not seem to conserve.

At the start of the simulation the water volume is 0.350 m3, and after 2 seconds of simulations, using the default method Level Set method (with 3rd order TVD runge kutta for time discretization, and WENO5 FLUX for convection), it has gone down to 0.267 m3 (24% error).

I tried refining the mesh in half (from 128k cells to 1024k cells), keeping the same Level Set method, but that after 2 sec the fluid fraction still goes down to 0.301 m3 (14% error; 1st order convergence?).

I also tried switching to the VOF formulation (3rd-order TVD Runge-Kutta for time discretization and HRIC modified for convection) in the finer mesh,but the conservation error after 2 sec is 19%.

So, my questions are: where do this conservations errors come from? Are they inherent to the IB method used to represent the obstacle? (probably not, see edit). Any way to reduce them significatively?

Thank you in advance.

Edit:

- I uploaded the test cases to a GitHub repo in case somebody wants to inspect them: https://github.com/nicolasbadano/REEF3D_Tests
- I used the current REEF3D version, cloned from the master branch of the github repo: https://github.com/REEF3D/REEF3D . Seems to be identical to REEF3D 22.04.1
- I did a new test removing the obstacle, to eliminate any influence of the IB method, I still got 14% error after 2 sec
- I attached a table summing up the results for the different tests
Attached Images
File Type: jpg damBreakWithObstacle-lsVsVOF.0000.jpg (43.2 KB, 32 views)
File Type: jpg damBreakWithObstacle-lsVsVOF.0100.jpg (63.1 KB, 41 views)
File Type: jpg damBreakWithObstacle-lsVsVOF.0200.jpg (57.2 KB, 33 views)
File Type: png conservationErrorsSummary.png (18.5 KB, 27 views)

Last edited by nbadano; October 2, 2022 at 21:29. Reason: Added additional information
nbadano is offline   Reply With Quote

Old   October 4, 2022, 03:55
Default
  #2
Senior Member
 
Arun Kamath
Join Date: Nov 2014
Location: Trondheim, Norway
Posts: 265
Rep Power: 13
kamath is on a distinguished road
Hi Nicolas,

The usual suspect is the grid size, but you seemed to have checked atleast two grids.

Next, you seem to be using obstacles defined by O. Please switch to S. (Will update the manual)


I will look into it.
__________________
Arun
X years with REEF3D
kamath is offline   Reply With Quote

Old   October 4, 2022, 10:33
Default
  #3
New Member
 
Nicolás Badano
Join Date: Sep 2010
Posts: 16
Rep Power: 17
nbadano is on a distinguished road
Thank you Arun, nice to meet you. Thanks for taking the time to look at this.

I did an extra test, concentrating in the case without the obstacle. Hence it's just a simple dam break case, with two discretizations: coarse (Lx/dx = 80; 128k cells) and fine (Lx/dx = 160; 1024k cells).

After 1.5s I'm still getting 8% error on the first mesh and 5% error in the second one). Furthermore, the fine mesh is getting unstable shortly after that time. The conservation errors look too high for such a simple test with such a short simulation time.

I added in attachment a summary for this tests. I also added the cases themselves to the same repository.

Let me know how I can help; I'm genuinely very interested in REEF3D, I'll be happy to contribute in any way I can.

In the meantime I'll repeat the tests with different discretization schemes.
Attached Images
File Type: png conservationErrorsSummaryNoObstacle.png (12.1 KB, 17 views)
nbadano is offline   Reply With Quote

Old   October 5, 2022, 03:22
Default
  #4
Senior Member
 
Arun Kamath
Join Date: Nov 2014
Location: Trondheim, Norway
Posts: 265
Rep Power: 13
kamath is on a distinguished road
Thanks Nicolas.
Could you please check with k-w (T 30 2) turbulence and D 10 5 for convection as well.
3rd RK should be ok for time.
__________________
Arun
X years with REEF3D
kamath is offline   Reply With Quote

Old   October 5, 2022, 09:12
Default
  #5
Senior Member
 
Arun Kamath
Join Date: Nov 2014
Location: Trondheim, Norway
Posts: 265
Rep Power: 13
kamath is on a distinguished road
Hi Nicolas,
I just used your files with the following changes:
control.txt- S in place of O, B 1 0.01

ctrl.txt- T 10 2, T 30 2

I see vol1 reducing from 0.35 to 0.34 from t=0 to t=2s and no further change.
nbadano likes this.
__________________
Arun
X years with REEF3D
kamath is offline   Reply With Quote

Old   October 5, 2022, 11:12
Default
  #6
New Member
 
Nicolás Badano
Join Date: Sep 2010
Posts: 16
Rep Power: 17
nbadano is on a distinguished road
Thank you Arun.

I can confirm that just switching O to S, and the turbulence model to k-omega (T 10 2, T 30 2) greatly reduces the conservation error on the fine mesh I used, from 14% to 4% after 2 sec.

The k-omega model leads to much higher eddy viscosity than the URANS k-e I was using, so the free surface is much smoother (see the attached screenshot). I suspect this is what explains most of the effect.

So, I have three questions:

- Is "T 30 2" really necessary? I can't find any place in the source code (master branch) where it's read. "T 10" is read in "read_control.cpp", line 1474.

- From these experiments, it seems that the free surface has to be "smooth" relative to the cell size for the phase fraction to be conserved accurately. Do you think this is a fair assessment?

- Do you think this limitation could be lifted somehow with some improvement in the model?

Thank you very much again for your time
Attached Images
File Type: jpg damBreakWithObstacle-lsVsVOF_uranskeVsko.jpg (61.4 KB, 28 views)
nbadano is offline   Reply With Quote

Old   October 9, 2022, 05:52
Default
  #7
Super Moderator
 
Hans Bihs
Join Date: Jun 2009
Location: Trondheim, Norway
Posts: 377
Rep Power: 17
valgrinda is on a distinguished road
Hi Nicolas,

maybe have a look at options F 46 and F 47.
nbadano likes this.
__________________
Hans Bihs
Team REEF3D
www.reef3d.com
valgrinda is offline   Reply With Quote

Old   October 9, 2022, 08:49
Default
  #8
Super Moderator
 
Hans Bihs
Join Date: Jun 2009
Location: Trondheim, Norway
Posts: 377
Rep Power: 17
valgrinda is on a distinguished road
By the way, very interesting to see you using VOF. We have not really tested it that much, so good to see you get some results with it. Our VOF algorithm follows a pretty basic approach - as in your case combining HRIC with standard interface compression. I assume there is still a lot of improvement possible if some time and work is invested. Is this research you would be interested in? We also have a PLIC implementation, using the normal calculation based on the level set function. Again, we have not really followed up on this, but I am still intrigued at getting this done and finding out what can be achieved with a properly tested VOF scheme.
nbadano likes this.
__________________
Hans Bihs
Team REEF3D
www.reef3d.com
valgrinda is offline   Reply With Quote

Old   October 10, 2022, 03:44
Default
  #9
Senior Member
 
Arun Kamath
Join Date: Nov 2014
Location: Trondheim, Norway
Posts: 265
Rep Power: 13
kamath is on a distinguished road
Quote:
Is "T 30 2" really necessary? I can't find any place in the source code (master branch) where it's read. "T 10" is read in "read_control.cpp", line 1474.
You are right, I am not sure why I said that.
I meant to ask you to choose the k-w model, which is done with T 10 2 anyway.
nbadano likes this.
__________________
Arun
X years with REEF3D
kamath is offline   Reply With Quote

Old   October 10, 2022, 18:39
Default
  #10
New Member
 
Nicolás Badano
Join Date: Sep 2010
Posts: 16
Rep Power: 17
nbadano is on a distinguished road
Quote:
Originally Posted by valgrinda View Post
Hi Nicolas,

maybe have a look at options F 46 and F 47.
Thank you Hans, this seems to resolve continuity problems perfectly according to my new batch of tests!

I redid the previous simulations, without and with obstacle (with S 10), both with the default options (no Picard iterations) and with Picard iterations, using:

F 46 3
F 47 5 (5 iterations, no idea if this is reasonable or not).

Basically, after 1 sec the simulations without iterations had continuity errors of 4% and 12%. With iterations those errors went down to 0% (according to the reported precision)!

In the attached table I present the summary for this tests. In the attached figure I show results for t=1s; from left to right this are:
- Without obstacle, no Picard Iterations
- Without obstacle, 5 Picard Iterations
- With obstacle, no Picard Iterations
- With obstacle, 5 Picard Iterations
Attached Images
File Type: jpg SecondBatchResults.jpg (64.9 KB, 28 views)
File Type: png SecondBatchSummary.png (23.9 KB, 24 views)
nbadano is offline   Reply With Quote

Old   October 10, 2022, 19:03
Default
  #11
New Member
 
Nicolás Badano
Join Date: Sep 2010
Posts: 16
Rep Power: 17
nbadano is on a distinguished road
Quote:
Originally Posted by valgrinda View Post
By the way, very interesting to see you using VOF. We have not really tested it that much, so good to see you get some results with it. Our VOF algorithm follows a pretty basic approach - as in your case combining HRIC with standard interface compression. I assume there is still a lot of improvement possible if some time and work is invested. Is this research you would be interested in? We also have a PLIC implementation, using the normal calculation based on the level set function. Again, we have not really followed up on this, but I am still intrigued at getting this done and finding out what can be achieved with a properly tested VOF scheme.
First of all, thank you for developing and letting us use REEF3D. I feel it has much potential.

I use OpenFOAM almost exclusively, but I think that creating conformal meshes is overkill for some consulting open channel flow cases, in which extreme precision is not required. These meshes and solvers have significant costs in terms of man-hours and run time.

Therefore, I've been looking for an alternative model based on the IB method, and REEF3D looks almost perfect for these applications.

I intend to do various validations tests, and this issue with mass conservation was the first thing to grab my attention. I'll report back the results from this tests in case you think they are interesting.

VOF and PLIC look like interesting capabilities for these applications, but I don't think they are absolute requirements. I just tested VOF because I thought that the level set implementation was maybe the source of the errors.

In order to proceed with the validation tests, I still have a couple of issues I need to deal with:

- first and foremost, the manual seems to imply that geometry can be loaded as STL, but I haven't seen a way to do that apart from the 6DoF code. Is this the only intended way?

- I've had many simulations become unstable due to the generation of high velocities near the free surface. I've learnt to deal with this problems OpenFOAM, but I'm not sure how to tackle them yet in REEF3D. Any advice related to this?

Thanks in advance!
nbadano is offline   Reply With Quote

Old   October 11, 2022, 05:28
Default
  #12
Senior Member
 
Arun Kamath
Join Date: Nov 2014
Location: Trondheim, Norway
Posts: 265
Rep Power: 13
kamath is on a distinguished road
Quote:
first and foremost, the manual seems to imply that geometry can be loaded as STL, but I haven't seen a way to do that apart from the 6DoF code. Is this the only intended way?
There is small inconsistency in how REEF3D handles objects in the domain. In all cases except floating bodies, the objects are defined and entered into the grid from DiveMESH, the mesh generator.
So, to include stl objects into REEF3D, which are not floating bodies, check options S1-S9 in the DiveMESH manual, which you then include in control.txt

Quote:
I've had many simulations become unstable due to the generation of high velocities near the free surface. I've learnt to deal with this problems OpenFOAM, but I'm not sure how to tackle them yet in REEF3D. Any advice related to this?
This is probably due to overproduction of turbulence at the free surface under complex deformations?
You can activate the free surface turbulence damping algorithm. The paper shows various test cases, but practically:
use T 36 2
set T 37 to 0.07* local water depth (for open channel flow)
For waves, the model is not that sensitive to the values of T 37 and I have tended to use T 37 =0.07 generally or 0.035 for large plunging breaking waves.

Hope that helps
nbadano likes this.
__________________
Arun
X years with REEF3D
kamath is offline   Reply With Quote

Old   October 11, 2022, 14:56
Default
  #13
New Member
 
Nicolás Badano
Join Date: Sep 2010
Posts: 16
Rep Power: 17
nbadano is on a distinguished road
Thank you Arun! I'll try these fixes soon.
nbadano is offline   Reply With Quote

Reply

Tags
level set, mass conservation, reef3d, vof


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Check for mass conservation shuuyaan Fluent Multiphase 9 April 10, 2020 12:48
Match Pressure Inlet/Outlet Boundary Condition Mass Flow Rate MSchneid Fluent UDF and Scheme Programming 3 February 23, 2019 06:00
Can FVM have mass sinks/ mass conservation problems? whuup FLUENT 0 March 8, 2014 18:48
lost of mass conservation jjchristophe FLUENT 0 June 18, 2010 05:44
Mass Conservation in LES Jaswant Main CFD Forum 8 July 4, 2005 22:32


All times are GMT -4. The time now is 22:50.