Skip to content

Boundary Conditions

Cartesian meshes — four sides set via input.txt:

bc_N = wall
bc_S = wall
bc_W = neumann
bc_E = ssh#1.5

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).


Tolosa-lct extends the Tolosa-sw BC types with wave maker and relaxation zone conditions:

TypePrescribes computationRequired input
wall (reflection)
neumann (zero gradient)
periodiccoupled to opposite boundary
qconstant discharge from prescribed tag q#value or bc_<name>.txt
q(t)time-varying dischargesamebc_<name>.txt
sshconstant tag ssh#value, bc_user(), or bc_<name>.txt
ssh(t)time-varying samebc_<name>.txt
hconstant depthsame as sshtag h#value, bc_user(), or bc_<name>.txt
h(t)time-varying depthsamebc_<name>.txt
ratcurvestage–discharge table from tablebc_<name>.txt
tide from tidal harmonicssame as sshtide.list + forcing.<name>tide.a/.b
ssht from spatially-varying time seriessame as sshssht_edge_at_bc.a/.b
ssht/tidesame as sshall of the above
wavespectral wave maker from file from wave spectrumforcing.wave_spectrum.a/.b
wave/sshtwave maker + sshtsameforcing.wave_spectrum.a/.b + ssht_edge_at_bc.a/.b
wave/tidewave maker + tidal harmonicssameforcing.wave_spectrum.a/.b + tide.list
wave/ssht/tidewave maker + ssht + tidesameall of the above
r(L)#user#tagsponge/relaxation zone, length Lsmooth transition to bc_user() over distance Lbc_user()
rssh#η#Lsponge relaxation toward constant sameinline values
sshs(L)#user#tagwave + sponge absorption zonewave maker with outgoing absorption over length Lbc_user()
ale(L)#user#tagactive wave generation (ALE), length Lcontrolled incident wave profile over Lbc_user() (requires ALE=yes)

The outgoing Riemann invariant is preserved for all SSH/depth-type conditions.


Inline constant — append #value to the BC type:

bc_W = ssh#1.5 ! constant SSH of 1.5 m
bc_E = q#100.0 ! constant discharge of 100 m³/s

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

Time 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.


tide.list lists the constituents, one per line after a --- separator:

---
M2 255555 28.98410420 0.9081 0.037 349.0 0.000 0.0
S2 273555 30.00000000 0.4227 0.000 0.0 0.000 0.0
K1 165555 15.04106864 0.5305 0.115 45.0 -0.115 -45.0

Columns: 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 and is disabled on restart.


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.


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 zones smoothly transition the solution from the interior state to a prescribed target over a distance L:

  • r(L)#user#tag — target value from bc_user(tag), applied as a sponge of length L
  • rssh#η#L — target is a constant SSH η, length L inline
  • sshs(L)#user#tag — combines wave maker with outgoing absorption; simultaneously generates waves and damps reflections over length L

The relaxation shape is controlled by frelax (default exp6).


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).