Skip to content

Domain Definition

This page shows how to create an idealized geometry of the Gironde estuary using Gmsh, an open-source finite element mesh generator.

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:

PointXYZ
1-112000-7550000
2-92000-7700000
3-82000-8100000
4-87000-8120000
5-98724.3-7791760
6-120000-7670000

In the .geo script, define the mesh size first:

lc = 600; lc2 = lc/2; lc3 = lc2/2.5;
//+ Points
Point(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 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.

//+ Splines
Spline(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};

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³/s
  • tide#15 — ocean boundary (spline 4), 15 tidal constituents

Then declare a surface physical group via Modules > Geometry > Physical Groups > Add > Surface.

//+ Physical groups
Physical 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.

Generate the mesh from the command line:

Terminal window
gmsh -2 -format msh2 -algo meshadapt basic_gir_stereo.geo

This creates basic_gir_stereo.msh with an adaptive unstructured triangular mesh.

lc = 600; lc2 = lc/2; lc3 = lc2/2.5;
//+ Points
Point(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};
//+ Splines
Spline(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 groups
Physical Curve("wall", 5) = {1, 3};
Physical Curve("q#1000", 6) = {2};
Physical Curve("tide#15", 7) = {4};
Physical Surface("surf", 8) = {1};