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#1.5Gmsh 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”Tolosa-lct extends the Tolosa-sw BC types with wave maker and relaxation zone conditions:
| 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 | |
wave | spectral wave maker from file | forcing.wave_spectrum.a/.b | |
wave/ssht | wave maker + ssht | same | forcing.wave_spectrum.a/.b + ssht_edge_at_bc.a/.b |
wave/tide | wave maker + tidal harmonics | same | forcing.wave_spectrum.a/.b + tide.list |
wave/ssht/tide | wave maker + ssht + tide | same | all of the above |
r(L)#user#tag | sponge/relaxation zone, length L | smooth transition to bc_user() over distance L | bc_user() |
rssh#η#L | sponge relaxation toward constant | same | inline values |
sshs(L)#user#tag | wave + sponge absorption zone | wave maker with outgoing absorption over length L | bc_user() |
ale(L)#user#tag | active wave generation (ALE), length L | controlled incident wave profile over L | bc_user() (requires ALE=yes) |
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, x, y, b). The global tc (current time in seconds) is available:
MODULE real(rp) FUNCTION bc_user( tag , x , y , b ) character(len=*), intent(in) :: tag real(rp) , intent(in), optional :: x , y , b 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.
Spectral Wave Maker (wave)
Section titled “Spectral Wave Maker (wave)”The wave BC type prescribes a wave field from a pre-computed spectrum stored in forcing.wave_spectrum.a/.b. The .b file contains the number of boundary edges ne, record dates, the peak frequency f_peak, the number of frequency components f_nb, and the frequency values. The .a binary stores node pairs and complex amplitudes per frequency.
The wave BC is ramped up over nb_period_ramp_wbc wave periods. The flux integration uses nb_pt_sampling_wbc quadrature points per edge.
Relaxation / Sponge Zones (r, rssh, sshs)
Section titled “Relaxation / Sponge Zones (r, rssh, sshs)”Relaxation zones smoothly transition the solution from the interior state to a prescribed target over a distance L:
r(L)#user#tag— target value frombc_user(tag), applied as a sponge of lengthLrssh#η#L— target is a constant SSHη, lengthLinlinesshs(L)#user#tag— combines wave maker with outgoing absorption; simultaneously generates waves and damps reflections over lengthL
The relaxation shape is controlled by frelax (default exp6).
Active Wave Generation (ale)
Section titled “Active Wave Generation (ale)”ale(L)#user#tag uses the ALE (Active Layer Emission) method to generate a prescribed incident wave profile over a zone of length L. Requires compilation with ALE=yes. The wave profile is supplied by bc_user(tag).