Boundary Conditions
Assigning BC Types
Section titled “Assigning BC Types”Cartesian meshes — four sides set via input.txt:
bc_N = wallbc_S = wallbc_W = neumannbc_E = ssh(t)Gmsh meshes — the BC type is the name of the physical group in the .msh file. For types that require data, the string is also used as the file name stem (e.g. physical group inlet → file bc_inlet.txt).
BC Types Reference
Section titled “BC Types Reference”| Type | Prescribes | Required input | |
|---|---|---|---|
wall | — | — | |
neumann | — | — | |
periodic | — | coupled to opposite boundary | — |
q | constant discharge | tag q#value or bc_<name>.txt | |
q(t) | time-varying discharge | same | bc_<name>.txt |
ssh | constant | tag ssh#value, bc_user(), or bc_<name>.txt | |
ssh(t) | time-varying | same | bc_<name>.txt |
h | constant depth | same as ssh | tag h#value, bc_user(), or bc_<name>.txt |
h(t) | time-varying depth | same | bc_<name>.txt |
ratcurve | stage–discharge table | bc_<name>.txt | |
tide | same as ssh | tide.list + forcing.<name>tide.a/.b | |
ssht | same as ssh | ssht_edge_at_bc.a/.b | |
ssht/tide | same as ssh | all of the above |
The outgoing Riemann invariant
Specifying Values for ssh, h, q
Section titled “Specifying Values for ssh, h, q”Inline constant — append #value to the BC type:
bc_W = ssh#1.5 ! constant SSH of 1.5 mbc_E = q#100.0 ! constant discharge of 100 m³/sUser function — append #user and implement bc_user(tag). The global tc (current time in seconds) is available:
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 ) ! M2-like tide case default call end_program('unknown bc tag: '//tag) end selectEND FUNCTION bc_userTime series file — use types q(t), ssh(t), or h(t), and place bc_<name>.txt in bin/:
$ q(t)0. 100.3600. 200.7200. 250.10800. 300.First column is time in seconds; second column is the BC value. Linear interpolation is applied.
Tidal Harmonic BC (tide)
Section titled “Tidal Harmonic BC (tide)”tide.list lists the constituents, one per line after a --- separator:
---M2 255555 28.98410420 0.9081 0.037 349.0 0.000 0.0S2 273555 30.00000000 0.4227 0.000 0.0 0.000 0.0K1 165555 15.04106864 0.5305 0.115 45.0 -0.115 -45.0Columns: name doodson vit_ang(°/h) coef_pot c1 k1 c2 k2
For each constituent <name>, the pair forcing.<name>tide.a / forcing.<name>tide.b must exist in bin/.
At each boundary edge the prescribed SSH is:
A linear ramp (tide_is_ramp, tide_time_ramp) starts the forcing from zero at
Spatially-Varying SSH Time Series (ssht)
Section titled “Spatially-Varying SSH Time Series (ssht)”ssht_edge_at_bc.a stores the SSH time series per open boundary edge. ssht_edge_at_bc.b lists the record dates (CNES Julian days). Two records are kept in memory and linearly interpolated in time. Compatible with tide (ssht/tide), in which case contributions are summed.