anuga.Flather_external_stage_zero_velocity_boundary

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

Bases: Boundary

Weakly-reflecting open boundary using a Flather-type characteristic approach.

Sets the exterior stage via a function of time and assumes zero exterior velocity. Interior values are taken from the domain. The boundary conserved quantities are then computed from characteristic-like variables, making this boundary weakly reflecting — outgoing waves leave with minimal spurious reflection while incoming wave forcing is prescribed.

The approach is similar (but not identical) to that described on page 239 of:

@Article{blayo05,
  title   = {Revisiting open boundary conditions from the point of
             view of characteristic variables},
  author  = {Blayo, E. and Debreu, L.},
  journal = {Ocean Modelling},
  year    = {2005},
  volume  = {9},
  pages   = {231--252},
}

Algorithm

  1. The exterior stage is set from function(t); exterior velocity is zero; interior stage and velocity are taken from the domain edge values.

  2. Characteristic-like variables are computed depending on whether flow is incoming or outgoing (see Blayo & Debreu 2005).

  3. The boundary conserved quantities (stage, x-momentum, y-momentum) are recovered from these characteristic variables.

param domain:

The domain to which this boundary is attached.

type domain:

anuga.Domain

param function:

A function f(t) returning the exterior stage at model time t. Typically a file_function() time series.

type function:

callable

param default_boundary:

Stage value returned when model time exceeds the range of function (e.g. when a file-function time series ends). 0.0 corresponds to ambient sea level / no wave forcing. Default 0.0.

type default_boundary:

float, optional

Examples

>>> import anuga
>>> domain = anuga.rectangular_cross_domain(10, 10)
>>> Bf = anuga.Flather_external_stage_zero_velocity_boundary(
...     domain, lambda t: 0.1, default_boundary=0.0)
>>> domain.set_boundary({'left': Bf, 'right': Bf, 'top': Bf, 'bottom': Bf})
__init__(domain=None, function=None, default_boundary=0.0)[source]

Initialise a Flather-type open boundary.

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

  • function (callable) – Exterior stage function f(t).

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

Raises:

Exception – If domain or function is None.

Methods

__init__([domain, function, default_boundary])

Initialise a Flather-type open boundary.

evaluate(vol_id, edge_id)

evaluate_segment(domain, segment_edges)

Applied in vectorized form for speed.

get_boundary_values([t])

get_time()

evaluate(vol_id, edge_id)[source]
evaluate_segment(domain, segment_edges)[source]

Applied in vectorized form for speed. Gareth Davies 14/07/2016