Domain Definition
This page shows how to create an idealized geometry of the Gironde estuary using Gmsh, an open-source finite element mesh generator.
Create Geometry
Section titled “Create Geometry”Create Points
Section titled “Create Points”A point is identified by a tag and defined by its coordinates (X, Y, Z) and a target mesh size lc. Open Gmsh and create points via Modules > Geometry > Elementary entities > Add > Point.
Enter the coordinates for the six control points:
| Point | X | Y | Z |
|---|---|---|---|
| 1 | -112000 | -755000 | 0 |
| 2 | -92000 | -770000 | 0 |
| 3 | -82000 | -810000 | 0 |
| 4 | -87000 | -812000 | 0 |
| 5 | -98724.3 | -779176 | 0 |
| 6 | -120000 | -767000 | 0 |
In the .geo script, define the mesh size first:
lc = 600; lc2 = lc/2; lc3 = lc2/2.5;//+ PointsPoint(1) = {-112000, -755000, 0, lc};Point(2) = {-92000.0, -770000, 0, lc2};Point(3) = {-82000.0, -810000, 0, lc3};Point(4) = {-87000.0, -812000, 0, lc3};Point(5) = {-98724.3, -779176, 0, lc2};Point(6) = {-120000, -767000, 0, lc};Using three different mesh sizes (lc, lc2, lc3) creates a finer mesh near the estuary mouth.
Create Edges and Surface
Section titled “Create Edges and Surface”Create splines connecting the points via Modules > Geometry > Elementary entities > Add > Spline. Select the control points for each spline and press e to validate:
- Spline 1: points 1, 2, 3
- Spline 2: points 3, 4
- Spline 3: points 4, 5, 6
- Spline 4: points 6, 1
Then create the surface via Modules > Geometry > Elementary entities > Add > Plane Surface and select the closed loop.
//+ SplinesSpline(1) = {1, 2, 3};Spline(2) = {3, 4};Spline(3) = {4, 5, 6};Spline(4) = {6, 1};Curve Loop(1) = {1, 2, 3, 4};Plane Surface(1) = {1};Boundary Conditions in Gmsh
Section titled “Boundary Conditions in Gmsh”Tolosa-sw identifies boundary conditions by the name of Physical Groups in the .msh file. Declare them via Modules > Geometry > Physical Groups > Add > Curve.
For this test case, declare three curve physical groups (press e to validate each):
wall— both bank splines (1 and 3)q#1000— river head (spline 2), constant discharge of 1000 m³/stide#15— ocean boundary (spline 4), 15 tidal constituents
Then declare a surface physical group via Modules > Geometry > Physical Groups > Add > Surface.
//+ Physical groupsPhysical Curve("wall", 5) = {1, 3};Physical Curve("q#1000", 6) = {2};Physical Curve("tide#15", 7) = {4};Physical Surface("surf", 8) = {1};Save the file as basic_gir_stereo.geo.
Create the Mesh
Section titled “Create the Mesh”Generate the mesh from the command line:
gmsh -2 -format msh2 -algo meshadapt basic_gir_stereo.geoThis creates basic_gir_stereo.msh with an adaptive unstructured triangular mesh.
Complete .geo Script
Section titled “Complete .geo Script”lc = 600; lc2 = lc/2; lc3 = lc2/2.5;//+ PointsPoint(1) = {-112000, -755000, 0, lc};Point(2) = {-92000.0, -770000, 0, lc2};Point(3) = {-82000.0, -810000, 0, lc3};Point(4) = {-87000.0, -812000, 0, lc3};Point(5) = {-98724.3, -779176, 0, lc2};Point(6) = {-120000, -767000, 0, lc};//+ SplinesSpline(1) = {1, 2, 3};Spline(2) = {3, 4};Spline(3) = {4, 5, 6};Spline(4) = {6, 1};Curve Loop(1) = {1, 2, 3, 4};Plane Surface(1) = {1};//+ Physical groupsPhysical Curve("wall", 5) = {1, 3};Physical Curve("q#1000", 6) = {2};Physical Curve("tide#15", 7) = {4};Physical Surface("surf", 8) = {1};