rompy.swan.subcomponents.numerics.STOPC#
- pydantic model rompy.swan.subcomponents.numerics.STOPC[source]#
Stopping criteria of Zijlema and Van der Westhuysen (2005).
STOPC [dabs] [drel] [curvat] [npnts] ->STAT|NONSTAT [limiter]
With this option the user can influence the criterion for terminating the iterative procedure in the SWAN computations (both stationary and nonstationary). The criterion makes use of the second derivative, or curvature, of the iteration curve of the significant wave height. As the solution of a simulation approaches full convergence, the curvature of the iteration curve will tend to zero. SWAN stops the process if the relative change in Hs from one iteration to the next is less than drel and the curvature of the iteration curve of Hs normalized with Hs is less than curvat or the absolute change in Hs from one iteration to the next is less than dabs. Both conditions need to be fulfilled in more than fraction npnts percent of all wet grid points.
With respect to the QC modelling, another stopping criteria will be employed. Namely, SWAN stops the iteration process if the absolute change in Hs from one iterate to another is less than dabs * Hinc, where Hinc is the representative incident wave height, or the relative change in Hs from one to the next iteration is less than drel. These criteria must be fulfilled in more than npnts percent of all active, well-defined points.
References
Zijlema, M. and Van der Westhuysen, A. (2005). On convergence behaviour and numerical accuracy in stationary SWAN simulations of nearshore wind wave spectra, Coastal Engineering, 52(3), p. 337-256.
Examples
In [312]: from rompy.swan.subcomponents.numerics import STOPC In [313]: stop = STOPC() In [314]: print(stop.render()) STOPC In [315]: stop = STOPC( .....: dabs=0.005, .....: drel=0.01, .....: curvat=0.005, .....: npnts=99.5, .....: mode=dict(model_type="nonstat", mxitns=1), .....: limiter=0.1, .....: ) .....: In [316]: print(stop.render()) STOPC dabs=0.005 drel=0.01 curvat=0.005 npnts=99.5 NONSTATIONARY mxitns=1 limiter=0.1
Show JSON schema
{ "title": "STOPC", "description": "Stopping criteria of Zijlema and Van der Westhuysen (2005).\n\n.. code-block:: text\n\n STOPC [dabs] [drel] [curvat] [npnts] ->STAT|NONSTAT [limiter]\n\nWith this option the user can influence the criterion for terminating the iterative\nprocedure in the SWAN computations (both stationary and nonstationary). The\ncriterion makes use of the second derivative, or curvature, of the iteration curve\nof the significant wave height. As the solution of a simulation approaches full\nconvergence, the curvature of the iteration curve will tend to zero. SWAN stops the\nprocess if the relative change in Hs from one iteration to the next is less than\n`drel` and the curvature of the iteration curve of Hs normalized with Hs is less\nthan `curvat` or the absolute change in Hs from one iteration to the next is less\nthan `dabs`. Both conditions need to be fulfilled in more than fraction `npnts`\npercent of all wet grid points.\n\nWith respect to the QC modelling, another stopping criteria will be employed.\nNamely, SWAN stops the iteration process if the absolute change in Hs from one\niterate to another is less than `dabs` * Hinc, where Hinc is the representative\nincident wave height, or the relative change in Hs from one to the next iteration\nis less than `drel`. These criteria must be fulfilled in more than `npnts`\npercent of all active, well-defined points.\n\nReferences\n----------\n- Zijlema, M. and Van der Westhuysen, A. (2005). On convergence behaviour and\n numerical accuracy in stationary SWAN simulations of nearshore wind wave spectra,\n Coastal Engineering, 52(3), p. 337-256.\n\nExamples\n--------\n\n.. ipython:: python\n :okwarning:\n\n from rompy.swan.subcomponents.numerics import STOPC\n stop = STOPC()\n print(stop.render())\n stop = STOPC(\n dabs=0.005,\n drel=0.01,\n curvat=0.005,\n npnts=99.5,\n mode=dict(model_type=\"nonstat\", mxitns=1),\n limiter=0.1,\n )\n print(stop.render())", "type": "object", "properties": { "model_type": { "default": "stopc", "description": "Model type discriminator", "enum": [ "stopc", "STOPC" ], "title": "Model Type", "type": "string" }, "dabs": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "default": null, "description": "Maximum absolute change in Hs from one iteration to the next (SWAN default: 0.005 [m] or 0.05 [-] in case of QC model)", "title": "Dabs" }, "drel": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "default": null, "description": "Maximum relative change in Hs from one iteration to the next (SWAN default: 0.01 [-])", "title": "Drel" }, "curvat": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "default": null, "description": "Maximum curvature of the iteration curve of Hs normalised with Hs (SWAN default: 0.005 [-] (not used in the QC model))", "title": "Curvat" }, "npnts": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "default": null, "description": "Percentage of points in the computational grid above which the stopping criteria needs to be satisfied (SWAN default: 99.5 [-])", "title": "Npnts" }, "mode": { "anyOf": [ { "discriminator": { "mapping": { "NONSTAT": "#/$defs/NONSTAT", "STAT": "#/$defs/STAT", "nonstat": "#/$defs/NONSTAT", "stat": "#/$defs/STAT" }, "propertyName": "model_type" }, "oneOf": [ { "$ref": "#/$defs/STAT" }, { "$ref": "#/$defs/NONSTAT" } ] }, { "type": "null" } ], "default": null, "description": "Termination criteria for stationary or nonstationary runs", "title": "Mode" }, "limiter": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "default": null, "description": "Determines the maximum change per iteration of the energy density per spectral-bin given in terms of a fraction of the omni-directional Phillips level (SWAN default: 0.1)", "title": "Limiter" } }, "$defs": { "NONSTAT": { "additionalProperties": false, "description": "Computation parameters in nonstationary computation.", "properties": { "model_type": { "default": "nonstat", "description": "Model type discriminator", "enum": [ "nonstat", "NONSTAT" ], "title": "Model Type", "type": "string" }, "mxitns": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "description": "The maximum number of iterations per time step for nonstationary computations. The computation moves to the next time step when this number is exceeded (SWAN default: `mxitns = 1`", "title": "Mxitns" } }, "title": "NONSTAT", "type": "object" }, "STAT": { "additionalProperties": false, "description": "Computation parameters in stationary computation.", "properties": { "model_type": { "default": "stat", "description": "Model type discriminator", "enum": [ "stat", "STAT" ], "title": "Model Type", "type": "string" }, "mxitst": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "description": "The maximum number of iterations for stationary computations. The computation stops when this number is exceeded (SWAN default: 50)", "title": "Mxitst" }, "alfa": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "default": null, "description": "Proportionality constant used in the frequency-dependent under-relaxation technique. Based on experiences, a suggestion for this parameter is `alfa = 0.01`. In case of diffraction computations, the use of this parameter is recommended (SWAN default: 0.00)", "title": "Alfa" } }, "title": "STAT", "type": "object" } }, "additionalProperties": false }
- Fields:
- field curvat: float | None = None#
Maximum curvature of the iteration curve of Hs normalised with Hs (SWAN default: 0.005 [-] (not used in the QC model))
- field dabs: float | None = None#
Maximum absolute change in Hs from one iteration to the next (SWAN default: 0.005 [m] or 0.05 [-] in case of QC model)
- field drel: float | None = None#
Maximum relative change in Hs from one iteration to the next (SWAN default: 0.01 [-])
- field limiter: float | None = None#
Determines the maximum change per iteration of the energy density per spectral-bin given in terms of a fraction of the omni-directional Phillips level (SWAN default: 0.1)
- field model_type: Literal['stopc', 'STOPC'] = 'stopc'#
Model type discriminator
- field npnts: float | None = None#
Percentage of points in the computational grid above which the stopping criteria needs to be satisfied (SWAN default: 99.5 [-])