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
178 stars 64 forks source link

Mesh dense changes significantly #304

Closed aribal2018 closed 6 months ago

aribal2018 commented 6 months ago

Dear All,

I am working in a bay and creating the mesh using OceanMesh2D. At the open ocean, I set the maximum resolution to be 2.5 km and the coastline is 100 meters.

As seen from my attached figure, the meshes are almost homogenous from the left until the middle of the bay (circled red). Then, the resolutions of the mesh suddenly change along the coastline which is probably one km from the coastline. In my opinion, this sudden change is probably not good.

mesh

I am actually expecting that the dense of the mesh start increasing when entering the bay. Say, for example, I will expect that the dense of the mesh will start to increase from the longitude 237.5 until the coastline. By doing this, there will be a "smooth" change in the mesh resolutions.

Therefore, I was wondering if there an option to do that. Hope this makes sense. Thank you very much.

krober10nd commented 6 months ago

Adjust the gradation rate to a lower value, such as 0.05 or 0.075, and/or constrain the minimum mesh element size according to depth. For syntax guidance on depth-based bounding, refer to the Galveston Bay example.

aribal2018 commented 6 months ago

Hi Keith,

Happy New Year.

I looked at the example but I still could not get the mesh that I am expecting. I tried: fh = edgefx('geodata',gdat,'dis',0.3,'fs',3,'max_el_ns',200,'max_el',100,'g',0.1);

This actually violate the value of the grade which is supposed to be between 0.2 and 0.3. The mesh is slightly improved but the transition is still very high.

image

About nine years ago, I created a mesh using SMS and the transition is very good. I hope I can use OceanMesh2D to get a similar results.

mesh

As can be seen from this mesh, the mesh transition location change is quite far from the island. Hence, the transition from coarser mesh to the finer mesh is quite smooth.

I do hope, I can get a similar results using OceanMesh2D as this method is quite convenient to use.

krober10nd commented 6 months ago

You can change the g parameter to any value you want to achieve any level of mesh smoothness. In the code snippet, you've selected a value of 0.1 for g and saying it should be between 0.2 & 0.3? Please explore the values.