rompy.swan.components.physics.OBSTACLE#

pydantic model rompy.swan.components.physics.OBSTACLE[source]#

Subgrid obstacle.

OBSTACLE ->TRANSM|TRANS1D|TRANS2D|GODA|DANGREMOND REFL [reflc] ->RSPEC|RDIFF &
    (FREEBOARD [hgt] [gammat] [gammar] QUAY) LINE < [xp] [yp] >

With this optional command the user provides the characteristics of a (line of) sub-grid obstacle(s) through which waves are transmitted or against which waves are reflected (possibly both at the same time). The obstacle is sub-grid in the sense that it is narrow compared to the spatial meshes; its length should be at least one mesh length.

The location of the obstacle is defined by a sequence of corner points of a line. The obstacles interrupt the propagation of the waves from one grid point to the next wherever this obstacle line is located between two neighbouring grid points (of the computational grid; the resolution of the obstacle is therefore equal to the computational grid spacing). This implies that an obstacle to be effective must be located such that it crosses at least one grid line. This is always the case when an obstacle is larger than one mesh length.

Notes

  • The advise is to define obstacles with the least amount of points possible.

  • SWAN checks if the criterion reflc^2 + trcoef^2 LE 1 is fulfilled.

Examples

In [91]: from rompy.swan.components.physics import OBSTACLE

In [92]: obs = OBSTACLE(
   ....:     transmission=dict(model_type="transm", trcoef=0.5),
   ....:     reflection=dict(reflc=0.5),
   ....:     line=dict(xp=[174.1, 174.2, 174.3], yp=[-39.1, -39.1, -39.1]),
   ....: )
   ....: 

In [93]: print(obs.render())
OBSTACLE TRANSM trcoef=0.5 REFL reflc=0.5 LINE 174.1 -39.1 174.2 -39.1 174.3 -39.1
Fields:
Validators:
field freeboard: FREEBOARD | None = None#

Freeboard

Validated by:
field line: LINE = None#

Line of obstacle

Validated by:
field model_type: Literal['obstacle', 'OBSTACLE'] = 'obstacle'#

Model type discriminator

Validated by:
field reflection: REFL | None = None#

Wave reflection

Validated by:
field reflection_type: RSPEC | RDIFF | None = None#
Validated by:
field transmission: TRANSM | TRANS1D | TRANS2D | GODA | DANGREMOND | None = None#
Validated by:
cmd() str[source]#

Command file string for this component.

validator hgt_consistent  »  all fields[source]#

Warns if hgt has different values in DAM and FREEBOARD specifications.