Skip to content

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 TypeSyntaxDescription
Rigid wallwallNo-normal-flow (reflection)
NeumannneumannZero normal gradient
Tidal harmonicstideAll constituents from tide.list
Tidal harmonics (N first)tide#NOnly the first N tidal constituents
Constant dischargeq#XConstant discharge X (m³/s)
Discharge from fileqReads tabulated file bc_q.txt
Discharge from user functionq#userCalls bc_user() in m_user_data.f90
Constant SSHssh#XConstant sea surface height X (m)
SSH from filesshReads tabulated file bc_ssh.txt
SSH from user functionssh#userCalls bc_user() in m_user_data.f90
Constant depthh#XConstant water depth X (m)
Depth from filehReads tabulated file bc_h.txt
Depth from user functionh#userCalls bc_user() in m_user_data.f90
Rating curveratcurveStage–discharge table from bc_<name>.txt

Wall + Discharge + Tide (Gironde test case)

Section titled “Wall + Discharge + Tide (Gironde test case)”
Physical Curve("wall", 5) = {1, 3}; ! bank boundaries
Physical Curve("q#1000", 6) = {2}; ! river head: 1000 m³/s
Physical Curve("tide#15", 7) = {4}; ! ocean: 15 tidal constituents

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.
Physical Curve("ssh#0.5", 7) = {4}; ! constant SSH of 0.5 m

User-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 select
END FUNCTION bc_user