anuga.Characteristic_wave_boundary

class anuga.Characteristic_wave_boundary(domain=None, function=None, background_stage=0.0, default_boundary=0.0)[source]

Bases: Boundary

Nonlinear characteristic open boundary with prescribed incoming wave.

Prescribes the incoming Riemann invariant from a wave perturbation and extrapolates the outgoing Riemann invariant from the interior, solving the characteristic equations exactly (no linearisation).

The ghost state is derived from:

c_ghost     = (v_n_int + 2*c_int - 2*c0 + 4*c_wave) / 4
v_n_ghost   = c0 - 2*c_wave + v_n_int/2 + c_int
h_ghost     = c_ghost**2 / g
stage_ghost = h_ghost + bed

where c0 = sqrt(g*h0) is the background wave speed (computed from background_stage at each cell), c_wave = sqrt(g*h_wave) is the prescribed wave speed, and v_n is the outward-normal velocity.

The wave function returns a perturbation from background_stage (not an absolute stage). This is important: the background depth h0 = background_stage − bed is used to set the incoming Riemann invariant assuming no outgoing wave at the exterior.

Compared to Absorbing_wave_boundary:

  • Better for large-amplitude waves (η ~ h) where linearisation error in the Flather form is significant.

  • The face stage is not guaranteed to equal wave(t) exactly; the characteristic condition controls energy transport rather than stage directly.

  • For small-amplitude waves (η ≪ h) both classes give similar results.

Parameters:
  • domain (anuga.Domain) – The domain to which this boundary is attached.

  • function (callable) – f(t) returning the stage perturbation at time t.

  • background_stage (float, optional) – Still-water stage around which the perturbation is measured. Defaults to 0.0 (sea level).

  • default_boundary (float, optional) – Perturbation returned when model time is out of range. Default 0.0.

__init__(domain=None, function=None, background_stage=0.0, default_boundary=0.0)[source]

Methods

__init__([domain, function, ...])

evaluate(vol_id, edge_id)

Return ghost-cell state from nonlinear characteristic decomposition.

evaluate_segment(domain, segment_edges)

Vectorised form for speed.

get_boundary_values([t])

get_time()

evaluate(vol_id, edge_id)[source]

Return ghost-cell state from nonlinear characteristic decomposition.

evaluate_segment(domain, segment_edges)[source]

Vectorised form for speed.