CHLNDDEV / OceanMesh2D

A two-dimensional triangular mesh generator with pre- and post-processing utilities written in pure MATLAB (no toolboxes required) designed specifically to build models that solve shallow-water equations or wave equations in a coastal environment (ADCIRC, FVCOM, WaveWatch3, SWAN, SCHISM, Telemac, etc.).
https://github.com/sponsors/krober10nd
GNU General Public License v3.0
183 stars 65 forks source link

Error in specifying riverine boundary segments! #166

Closed Jiangchao3 closed 3 years ago

Jiangchao3 commented 3 years ago

Hey, @CHLNDDEV and @krober10nd , I encountered a problem when making boundary conditions. I tried to add a flux boundary (riverine flow), as shown in the first figure. There are two triangles and three vertices on the left side. The number of the three vertices are marked aside, as shown in the second figure. When I set 1183 for the value of vstart and set 1182 for the value of vend, the result is as shown in the third figure. When I set 1183 for the value of vstart and set 1167 for the value of vend, it went wrong as shown in the fourth figure. I want to know how to set the river boundary correctly. I noticed that there is no detailed description in the userguide or the previous discussions. Many thanks to you!

image

image

image

image

WPringle commented 3 years ago

I also encountered this before but would good to find out exactly what is causing this. What happens when you set the third entry to 0?

krober10nd commented 3 years ago

Yes, the last segment needs to be flipped with order=1 but should work with order 0. Echoing William's comments, I'd like to see what happens.

krober10nd commented 3 years ago

This fix was merged in. Please let me know how it works!

Jiangchao3 commented 3 years ago

Yes, now it does work well! Thank you very much!

image

Jiangchao3 commented 3 years ago

hi, @krober10nd , when I use the command make_bc(m,'outer',1), the result is always right as shown in the figure above, no matter setting the vstart=1183 vend=1182 or setting the vstart=1182 vstart=1183. However, when I use the command make_bc(m,'outer',0), no matter setting vstart=1183 vend=1182 or setting the vstart=1182 vend=1183, the result is shown as the figure below:

QQ图片20201224115640

So, I don't understand the meaning of the direction of clockwise and anti-clockwise.

image

krober10nd commented 3 years ago

I’m not sure what you’re saying. If the boundaries are correctly labeled with the first option, why bother with the other option?

Jiangchao3 commented 3 years ago

Yes, you are right, I just have a try with a curiosity.