rompy.swan.components.startup.SET#

pydantic model rompy.swan.components.startup.SET[source]#

SWAN setting commands.

SET [level] [nor] [depmin] [maxmes] [maxerr] [grav] [rho] [cdcap] &
    [inrhog] [hsrerr] NAUTICAL|->CARTESIAN [pwtail] [froudmax] [icewind]

With this optional command the user assigns values to various general parameters.

Notes

The error level maxerr is coded as follows:

  • 1: warnings

  • 2: errors (possibly automatically repaired or repairable by SWAN)

  • 3: severe errors

Default values for pwtail depend on formulations of physics:

  • command GEN1: pwtail = 5

  • command GEN2: pwtail = 5

  • command GEN3 KOMEN: pwtail = 4

  • command GEN3 WESTH: pwtail = 4

  • command GEN3 JANSSEN: pwtail = 5

Examples

In [230]: from rompy.swan.components.startup import SET

In [231]: set = SET(level=0.5, direction_convention="nautical")

In [232]: print(set.render())
SET level=0.5 NAUTICAL

In [233]: set = SET(
   .....:     level=-1.0,
   .....:     nor=90,
   .....:     depmin=0.01,
   .....:     maxerr=3,
   .....:     grav=9.81,
   .....:     rho=1025,
   .....:     cdcap=2.5e-3,
   .....:     inrhog=0,
   .....:     hsrerr=0.1,
   .....:     direction_convention="nautical",
   .....: )
   .....: 

In [234]: print(set.render())
SET level=-1.0 nor=90.0 depmin=0.01 maxerr=3 grav=9.81 rho=1025.0 cdcap=0.0025 inrhog=0 hsrerr=0.1 NAUTICAL
Fields:
Validators:
field cdcap: float | None = None#

The maximum value for the wind drag coefficient. A value of 99999 meansno cutting off the drag coefficient. A suggestion for this parameter is cdcap = 2.5x 10-3 (SWAN default: 99999)

Constraints:
  • ge = 0.0

field depmin: float | None = None#

Threshold depth (in m). In the computation any positive depth smaller than depmin is made equal to depmin (SWAN default: 0.05)

Constraints:
  • ge = 0.0

field direction_convention: Literal['nautical', 'cartesian'] [Required]#

Direction convention: nautical indicates that the Nautical convention for wind and wave direction (SWAN input and output) will be used, cartesian indicates that the Cartesian convention for wind and wave direction will be used. For definition, see Section 2.5 or Appendix A (SWAN default: cartesian)

field froudmax: float | None = None#

Is the maximum Froude number (U/√gd with U the current and d the water depth). The currents taken from a circulation model may mismatch with given water depth d in the sense that the Froude number becomes larger than 1. For this, the current velocities will be maximized by Froude number times sqrt(gh) (SWAN default: 0.8)

Constraints:
  • ge = 0.0

field grav: float | None = None#

The gravitational acceleration (in m/s2) (SWAN default: 9.81)

Constraints:
  • ge = 0.0

field hsrerr: float | None = None#

The relative difference between the user imposed significant wave height and the significant wave height computed by SWAN (anywhere along the computational grid boundary) above which a warning will be given. This relative difference is the difference normalized with the user provided significant wave height. This warning will be given for each boundary grid point where the problem occurs (with its x- and y-index number of the computational grid). The cause of the difference is explained in Section 2.6.3. To suppress these warnings (in particular for nonstationary computations), set hsrerr at a very high value or use command OFF BNDCHK (SWAN default: 0.10) (ONLY MEANT FOR STRUCTURED GRIDS)

Constraints:
  • ge = 0.0

field icewind: Literal[0, 1] | None = None#

Controls the scaling of wind input by open water fraction. Default value of zero corresponds to the case where wind input is scaled by the open water fraction. If icewind = 1 then sea ice does not affect wind input directly. (Though there is still indirect effect via the sea ice sink term; see command SICE) (SWAN default: 0)

field inrhog: Literal[0, 1] | None = None#

To indicate whether the user requires output based on variance or based on true energy (see Section 2.5). inrhog = 0: output based on variance, inrhog = 1: output based on true energy (SWAN default: 0)

field level: float | None = None#

Increase in water level that is constant in space and time can be given with this option, level is the value of this increase (in m). For a variable water level reference is made to the commands INPGRID and READINP (SWAN default: 0)

field maxerr: Literal[1, 2, 3] | None = None#

During pre-processing SWAN checks input data. Depending on the severity of the errors encountered during this pre-processing, SWAN does not start computations. The user can influence the error level above which SWAN will not start computations (at the level indicated the computations will continue) (SWAN default: 1)

field maxmes: int | None = None#

Maximum number of error messages during the computation at which the computation is terminated. During the computational process messages are written to the print file (SWAN default: 200)

Constraints:
  • ge = 0

field model_type: Literal['set', 'SET'] = 'set'#

Model type discriminator

field nor: float | None = None#

Direction of North with respect to the x-axis (measured counterclockwise); default nor = 90, i.e. x-axis of the problem coordinate system points East. When spherical coordinates are used (see command COORD) the value of nor may not be modified

Constraints:
  • ge = -360.0

  • le = 360.0

field pwtail: int | None = None#

Power of high frequency tail; defines the shape of the spectral tail above the highest prognostic frequency fhigh (see command CGRID). The energy density is assumed to be proportional to frequency to the power pwtail. If the user wishes to use another value, then this SET command should be located in the command file after GEN1, GEN2 or GEN3 command (these will override the SET command with respect to pwtail)

Constraints:
  • ge = 0

Validated by:
field rho: float | None = None#

The water density (in kg/m3) (SWAN default: 1025)

Constraints:
  • ge = 0.0

cmd() str[source]#

Return the string or list of strings to render the component to the CMD.

validator pwtail_after_gen  »  pwtail[source]#