Numerics¶
PROP and NUMERIC: propagation scheme and numerical settings.
SWAN Numerics Components
This module contains components for configuring the numerical schemes and parameters used in SWAN for wave propagation, frequency shifting, and other numerical aspects.
PROP_TYPE
module-attribute
¶
PROP_TYPE = Annotated[
Union[BSBT, GSE],
Field(
description="Propagation scheme",
discriminator="model_type",
),
]
PROP
pydantic-model
¶
PROP(**data: Any)
Bases: BaseComponent
Propagation scheme.
Notes¶
- The scheme defaults to
S&LandSORDUPfor nonstationary and stationary simulations if not specified. - All schemes (BSBT, SORDUP and S&L) can be used in combination with curvilinear grids. With the higher order schemes (S&L and SORDUP) it is important to use a gradually varying grid otherwise there may be a severe loss of accuracy. If sharp transitions in the grid cannot be avoided it is safer to use the BSBT scheme.
- In the computation with unstructured meshes, a lowest order upwind scheme will be employed. This scheme is very robust but rather diffusive. This may only be significant for the case when swell waves propagate over relative large distances (in the order of thousands of kilometers) within the model domain. However and most fortunately, in such a case this will alleviate the garden-sprinkler effect.
- Alleviating the garden-sprinkler effect by adding some diffusion makes the SWAN
computation conditionally stable. You can either use (i) a smaller time step,
(ii) a lower value of
waveage, (iii) better resolution in the directional space, or (iv) worse resolution in the geographic space, in order of preference, to make the model stable when necessary.
Examples¶
from rompy_swan.components.numerics import PROP
prop = PROP()
print(prop.render())
prop = PROP(scheme=dict(model_type="bsbt"))
print(prop.render())
prop = PROP(
scheme=dict(
model_type="gse",
waveage=dict(delt="PT5H", dfmt="hr"),
),
)
print(prop.render())
Fields:
-
model_type(Literal['prop', 'PROP']) -
scheme(Optional[PROP_TYPE])
NUMERIC
pydantic-model
¶
NUMERIC(**data: Any)
Bases: BaseComponent
Numerical properties.
NUMeric ( STOPC [dabs] [drel] [curvat] [npnts] ->STAT|NONSTAT [limiter] ) &
( DIRimpl [cdd] ) ( SIGIMpl [css] [eps2] [outp] [niter] ) &
( CTheta [cfl] ) ( CSigma [cfl] ) ( SETUP [eps2] [outp] [niter] )
Examples¶
from rompy_swan.components.numerics import NUMERIC
numeric = NUMERIC()
print(numeric.render())
numeric = NUMERIC(
stop=dict(
model_type="stopc",
dabs=0.05,
drel=0.01,
curvat=0.05,
npnts=99.5,
),
dirimpl=dict(cdd=0.5),
sigimpl=dict(css=0.5, eps2=1e-4, outp=0, niter=20),
ctheta=dict(cfl=0.9),
csigma=dict(cfl=0.9),
setup=dict(eps2=1e-4, outp=0, niter=20),
)
print(numeric.render())
NUMERIC
NUMERIC STOPC dabs=0.05 drel=0.01 curvat=0.05 npnts=99.5 DIRIMPL cdd=0.5 SIGIMPL css=0.5 eps2=0.0001 outp=0 niter=20 CTHETA cfl=0.9 CSIGMA cfl=0.9 SETUP eps2=0.0001 outp=0 niter=20
Fields: