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

Active wave absorption - variation of cell size

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 21, 2021, 04:35
Default Active wave absorption - variation of cell size
  #1
Member
 
Felix S.
Join Date: Feb 2021
Location: Germany, Braunschweig
Posts: 88
Rep Power: 6
Felix_Sp is on a distinguished road
Hello again,

So I have a problem with B 98 4 (Dirichlet-boundary-condition with AWA) in combination with B 103 8/10 (variation of cell size in zones).

For the background: I am trying to simulate a really long shallow wave (wave period T=60s, therefore wave length L=104m, because I assume shallow water waves, B 92 1, wave height H=0.031m and water depth h=0.31m), which runs up a uniform slope.

It becomes obvious that applying B 98 2 (or 1 if it still works) increases cell count significantly. So far I am just simulating in 2D, but at a later stage I want to extend my simulation to a 3D-domain.

So now to my problem. Assuming a Dirichlet boundary condition is not possible, as the full reflection of the long wave messes up the boundary condition (the reflection cannot be seen inside the wave gauge data of the numerical simulation). Which means for me, I can just use AWA. It can be seen by validation of run-up, flow velocity and wave gauges that this depicts my situation really well (I used a uniform mesh). To increase accuracy (esp. of run-up, since the water depth is really shallow on the beach) I tried to refine the mesh around the water surface and in the run-up region in z-direction. The simulation runs until approx t=45 s and then a sudden peak in air velocity arises at the boundary, messing up the inlet condition (see the picture; I clipped the water surface with a uniform colour and the air phase with velocity). Simulations with uniform mesh size are running smoothly.

Long story short: I don't know whether this is a bug or AWA cannot be used for meshes with various cell sizes at the boundary. If there are any other tips anyone can give me regarding my problem, I would also appreciate the help!

I also added a simulation with non-uniform mesh and a uniform mesh, if you want to reproduce the issue to the files.

Happy holidays everyone, and thanks in advance for your help!

Edit: Forgot to mention that I use the CFD-module.
Attached Images
File Type: png air_velocity_peak.png (62.8 KB, 51 views)
File Type: jpg grid.jpg (171.5 KB, 37 views)
Attached Files
File Type: zip simulations.zip (1.8 KB, 8 views)

Last edited by Felix_Sp; December 21, 2021 at 07:44.
Felix_Sp is offline   Reply With Quote

Old   December 21, 2021, 17:41
Default
  #2
Senior Member
 
Arun Kamath
Join Date: Nov 2014
Location: Trondheim, Norway
Posts: 265
Rep Power: 14
kamath is on a distinguished road
Firstly, I would recommend B 98 3 (I am unsure how well B 98 4 works)

Even if you have shallow water waves, B 92 1 follows linear wave theory, so make sure that your wave is within the linear wave theory limits (Le Méhauté's chart), or use cnoidal theory.

B 98/ 99 1 works, but now follows (https://doi.org/10.1016/j.oceaneng.2019.106210)

Assuming Dirichlet condition does not work= then you can't use B 98 3/4.
So, I don't understand what you mean here, as your choices contradict your assumptions. Or may be you meant to type Relaxation method?

That said, for shallow water/ long waves, B 99 3 is excellent.

Before I go further into your query, I am curious as to why you would use a beach when you are studying wave run up? Wouldn't that interfere with the run up?

The crash you are experiencing is probably due to cell shapes? Grid refinement/ stretching needs a little work to ensure a good cell shape and avoid sudden jumps in the cell sizes.
In this regard, I would recommend trying B 101/2/3 11. That should give you a better mesh, though a slightly lower control on the number of cells.

Hope that helps!
__________________
Arun
X years with REEF3D
kamath is offline   Reply With Quote

Old   December 22, 2021, 04:05
Default
  #3
Member
 
Felix S.
Join Date: Feb 2021
Location: Germany, Braunschweig
Posts: 88
Rep Power: 6
Felix_Sp is on a distinguished road
Hey, thanks for the reply!

Quote:
Even if you have shallow water waves, B 92 1 follows linear wave theory, so make sure that your wave is within the linear wave theory limits (Le Méhauté's chart), or use cnoidal theory.
I am well aware that I am in the region of cnoidal wave theory. The problem is, that the study I am trying to recreate still uses sinusoidal waves as input waves. This means for me, that to recreate the physical data set, I somehow need to apply the same boundary condition.

Quote:
B 98/ 99 1 works, but now follows (https://doi.org/10.1016/j.oceaneng.2019.106210 )
That is good to know! It seems that one can shorten the wave generation zone and does not need two wave lengths as stated in the user manual any more, but rather half a wave length? I will have a look at that!

Quote:
Assuming Dirichlet condition does not work= then you can't use B 98 3/4.
So, I don't understand what you mean here, as your choices contradict your assumptions. Or may be you meant to type Relaxation method?
I basically meant, that using B 98 3 does only produce velocities and surface elevations, which are comparable to the physical data set if I depict the whole wave in the domain (i.e have a channel of at least 104 m + some slope length). B 98 4 does for a shorter channel length of 10 m or 20 m. Using relaxation method 2 as input works also fine for a channel length of 104 m but, not for a shorter channel length. I obviously only tried B 98 2, 3, 4 so far.

Quote:
Before I go further into your query, I am curious as to why you would use a beach when you are studying wave run up? Wouldn't that interfere with the run up?
I think the misunderstanding is, that I did not mean a numerical beach, but the physical beach! In my simulation, I always set B 99 to 0 and C 14 in DiveMesh to 2. I am always talking about the wave generation boundary condition. My geometrical situation is maybe comparable to the tutorial "9.12 Shoaling over Irregular Topography". It is a channel with uniform depth and a 1:40 slope at the end.

Quote:
The crash you are experiencing is probably due to cell shapes? Grid refinement/ stretching needs a little work to ensure a good cell shape and avoid sudden jumps in the cell sizes.
In this regard, I would recommend trying B 101/2/3 11. That should give you a better mesh, though a slightly lower control on the number of cells.
That could be true. The thing is that the simulation runs fine on the grid, when I change the inlet boundary condition to B 98 3, but does crash for B 98 4.


In total, I think that I am struggling in depicting the reflection on the beach correctly. Since I cannot depict the full wave length in the domain, as it is too long (and my computational power is limited), I am somehow trying to shorten the channel.


Sorry for the long text!



Thanks for your help again!

Last edited by Felix_Sp; December 28, 2021 at 12:01.
Felix_Sp is offline   Reply With Quote

Old   December 28, 2021, 14:34
Default
  #4
Member
 
Felix S.
Join Date: Feb 2021
Location: Germany, Braunschweig
Posts: 88
Rep Power: 6
Felix_Sp is on a distinguished road
So as a little update:

It seems as the simulation on the uniform mesh is stable, but nonetheless wrong. Which in the end confirms your considerations:

Quote:
Firstly, I would recommend B 98 3 (I am unsure how well B 98 4 works)
I spend the day in the source code of REEF3D (the iowave_active-wavegen.cpp) and the wave generation of olaFlow https://doi.org/10.1016/j.coastaleng.2012.07.002 to compare both. I don't know whether I understood everything correctly, but my impression was, that while the velocity is adapted for active wave absorption, the surface elevation at the boundary is not adapted in REEF3D. This is the case in olaFlow or IHFoam. If I am wrong, I would be happy about a correction.

The problem is now, that I cannot simulate a channel with a length of at least 52 m + some slope (B 98 1 seemed alright) in three dimensions.

The summation of the problems are as follows:
  • B 98 1: too many cells
  • B 98 2: too many cells
  • B 98 3: problem with reflection for a shorter channel, e.g. water level decrease, or if whole channel is depicted too many cells
  • B 98 4: not working
If anyone has any news or other ideas on how I could solve this problem, I would be happy about replies. It seems as this is so far not solvable (besides by programming your own boundary condition) in REEF3D.


I added the compared files in the annex (had to change the .cpp to .C). For the Foam-guys and -gals: The correction of .alpha starts around line 600 and the correction of the velocity around line 700.


Thanks everyone!
Attached Files
File Type: c waveAlphaFvPatchScalarField.C (24.0 KB, 0 views)
File Type: c waveVelocityFvPatchVectorField.C (26.2 KB, 0 views)
File Type: c iowave_active-wavegen.C (8.9 KB, 6 views)

Last edited by Felix_Sp; December 28, 2021 at 16:32.
Felix_Sp is offline   Reply With Quote

Old   January 6, 2022, 05:50
Default Implementation
  #5
Member
 
Felix S.
Join Date: Feb 2021
Location: Germany, Braunschweig
Posts: 88
Rep Power: 6
Felix_Sp is on a distinguished road
Hello again, everyone (and happy new year)!

My supervisor encouraged me to at least post this little experiment of mine.
After a lot of headaches, I created a boundary condition which is similar to the original one but produces stable and somewhat good results for me.
First of all I think that this implementation is WRONG!!! If you use it, please do not blame me .

In the end, I created it mainly to understand the process and maybe give a hint on what I think is missing in the current implementation.

The idea was to measure the water surface one cell further in the domain and then apply the theoretical water surface plus the needed velocity. I also tried to apply it to the ghost cells only, but this had no effect on my simulation, whatsoever.

I feel like I really do not understand how to apply the correct surface elevation as a boundary condition. Furthermore, I do not know whether I have to change additional parameters (like pressure etc.) when I move the surface velocity or whether this is implicitly given. I also get small spurious surface velocities at the inlet (shown in the picture; they are also present in olaFlow, but somewhat less). The free surface is updated in line 200. It is only tested in a 2D environment and I do not have a lot of velocity-data to test it.

In any case, I do not know whether this helps anyone or if anyone can help me with the correct implementation, but sharing does no harm (changed the ending from .cpp to .C again).

Hope you all have a wonderful day (and if anyone has any comments, I would appreciate them )!
Attached Images
File Type: jpg surface_velocities.jpg (21.1 KB, 25 views)
Attached Files
File Type: c iowave_active-wavegen.C (6.3 KB, 7 views)
Felix_Sp is offline   Reply With Quote

Reply


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
UDF in case with DPM modle POSTHU Fluent UDF and Scheme Programming 0 March 3, 2021 08:21
[Other] cfMesh cell size behaviour PhilipF OpenFOAM Meshing & Mesh Conversion 0 March 1, 2021 12:22
[Other] dynamicTopoFVMesh and pointDisplacement RandomUser OpenFOAM Meshing & Mesh Conversion 6 April 26, 2018 08:30
Cell size near boundary layer Zerit FLOW-3D 1 August 19, 2013 09:19
active wave absorb(about wave tank) zhaochuangang ANSYS 0 September 22, 2010 03:29


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