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

Additional package for converting .mat msh object into Telemac input files (slf and cli) #275

Closed lhtraymond closed 1 year ago

lhtraymond commented 1 year ago

Hello! It is my first time using OceanMesh2D and I found it superior to certain meshing software designated for Telemac simulation such as Blue Kenue. However, it seems to me that OceanMesh2D can only generate input files that are compatible with ADCIRC only, which was a bit unfortunate considering that I will do simulations on Telemac.

Are there any plans for including this feature in the future? Or, are there any known alternative solutions to convert the .mat msh object into .slf (selafin) and .cli (boundary conditions) file?

Thank you very much!

Onur-Kurum commented 1 year ago

Hi @lhtraymond! Glad you are finding OM2D to be useful and yes, it is superior to anything out there :) Once you generate your mesh and write your m out as .14, you can use BlueKenue to create your TELEMAC mesh and cli files.

In BlueKenue: 1) File - Import - ADCIRC Hydrodynamics (it will let you load a fort.14 file) 2) File - New - Selafin Object 3) Add variable (BOTTOM) to your new Selafin Object, choose the ADCIRC .14 mesh as input and copy values from that mesh.

There you have it, your .slf file ready to go. You can do the spatial projection (if you need to) in BK too (e.g., wgs84to UTMxx). 4) File - New - Boundary Condition (CONLIM) to create your cli file associated with your new slf.

Cheers Onur

krober10nd commented 1 year ago

@lhtraymond thank you for the kind words.

Yes, as Onur points out we typically convert the mesh from ADCIRC format using BlueKenue. This also enables us to reproject to UTM coordinate systems.

One thing to keep in mind is that TELEMAC's numerics generally require finer resolution in the deeper parts of the domain to avoid excessive diffusion and numerical (non-fatal) instabilities than typical ADCIRC requires. You can achieve this by bounding the maximum element size by depth or by using depth bounds in the Courant limiter in edgefx.

lhtraymond commented 1 year ago

Hi @krober10nd and @Onur-Kurum ,

Thank you for your reply. It was really helpful. After I import the .14 mesh to BK and do the spatial projection to UTM coordinate system, is it normal that the geometry and mesh appears to be distorted?

Onur-Kurum commented 1 year ago

Very normal. Please do keep in mind that for large model extents that goes over multiple UTM zones you actually don't want to convert to UTM. Telemac can run on spherical coordinates (except GAIA).