Boundary Conditions
For Gmsh meshes, boundary conditions are set by naming Physical Groups in the .geo file. Tolosa-sw matches the Physical Group name against the known BC types listed below.
See also the Boundary Conditions page for the complete BC reference including tidal and time-varying types.
BC Types Reference
Section titled “BC Types Reference”| BC Type | Syntax | Description |
|---|---|---|
| Rigid wall | wall | No-normal-flow (reflection) |
| Neumann | neumann | Zero normal gradient |
| Tidal harmonics | tide | All constituents from tide.list |
| Tidal harmonics (N first) | tide#N | Only the first N tidal constituents |
| Constant discharge | q#X | Constant discharge X (m³/s) |
| Discharge from file | q | Reads tabulated file bc_q.txt |
| Discharge from user function | q#user | Calls bc_user() in m_user_data.f90 |
| Constant SSH | ssh#X | Constant sea surface height X (m) |
| SSH from file | ssh | Reads tabulated file bc_ssh.txt |
| SSH from user function | ssh#user | Calls bc_user() in m_user_data.f90 |
| Constant depth | h#X | Constant water depth X (m) |
| Depth from file | h | Reads tabulated file bc_h.txt |
| Depth from user function | h#user | Calls bc_user() in m_user_data.f90 |
| Rating curve | ratcurve | Stage–discharge table from bc_<name>.txt |
Examples
Section titled “Examples”Wall + Discharge + Tide (Gironde test case)
Section titled “Wall + Discharge + Tide (Gironde test case)”Physical Curve("wall", 5) = {1, 3}; ! bank boundariesPhysical Curve("q#1000", 6) = {2}; ! river head: 1000 m³/sPhysical Curve("tide#15", 7) = {4}; ! ocean: 15 tidal constituentsTime-Varying Discharge
Section titled “Time-Varying Discharge”Use BC name q (without #value) and provide a bc_q.txt file:
Physical Curve("q", 6) = {2};bc_q.txt format (time in seconds, discharge in m³/s):
$ q(t)0. 800.3600. 1000.7200. 1200.86400. 1000.Constant SSH at Open Boundary
Section titled “Constant SSH at Open Boundary”Physical Curve("ssh#0.5", 7) = {4}; ! constant SSH of 0.5 mUser-Defined SSH (time-varying via bc_user)
Section titled “User-Defined SSH (time-varying via bc_user)”Physical Curve("ssh#user", 7) = {4};Then implement in m_user_data.f90:
MODULE real(rp) FUNCTION bc_user( tag ) character(len=*), intent(in) :: tag select case( tag ) case('ssh') bc_user = 0.5_rp * sin( 2._rp * pi / 44712._rp * tc ) case default call end_program('unknown bc tag: '//tag) end selectEND FUNCTION bc_user