Mesh density as a function of CFL? #112
-
Dear all, Is there an option or plan to have CFL optimised grid? It would be an additional constraint for a given time step. Thanks in advance, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
@ivicajan there's this function to limit the Courant number in the mesh-size function, based on some approximations. OCSMesh/ocsmesh/hfun/raster.py Lines 684 to 690 in 18d15ac Is this what you're looking for or do you want more control over any aspect of it? |
Beta Was this translation helpful? Give feedback.
-
Possibly you have it in your fingers and I would need ages to figure, how to add shape file (such as coastline - poly lines) and define depth for them to be say -1m and add that to the current raster? In my case I have DEM that is quite coarse and adding "poly lines" (as shape file) with some predefined depths would help a lot. Something along: |
Beta Was this translation helpful? Give feedback.
Modifying mesh is not OCSMesh's strongest suit, but you can definitely remesh while specifying initial points (your old mesh nodes). For remesh I haven't yet implemented a clean API in OCSMesh, but you can still use OCSMesh to prepare inputs for Jigsaw (the mesh engine OCSMesh uses).
The scripts below adds a CFL constraint on the mesh size, but doesn't enforce old edges and vertices to be fixed. It just approximates the old mesh size where the CFL is already met.