rompy.swan.components.physics.BRAGG_FILE#
- pydantic model rompy.swan.components.physics.BRAGG_FILE[source]#
Bragg scattering with bottom spectrum from file.
BRAGG [ibrag] [nreg] [cutoff] FILE 'fname' [idla] [mkx] [mky] [dkx] [dky]
The bed elevation spectrum FB(kx, ky) is read from a file.
Notes
This spectrum is taken to be uniform over the entire computational domain.
Examples
In [12]: from rompy.swan.components.physics import BRAGG_FILE In [13]: bragg = BRAGG_FILE(fname="bottom_spectrum.txt", nreg=500, mkx=99, dkx=0.1) In [14]: print(bragg.render()) BRAGG nreg=500 FILE fname='bottom_spectrum.txt' mkx=99 dkx=0.1 In [15]: kwargs = dict( ....: ibrag=3, ....: nreg=500, ....: cutoff=5.0, ....: fname="bottom_spectrum.txt", ....: mkx=99, ....: mky=149, ....: dkx=0.1, ....: dky=0.1, ....: ) ....: In [16]: bragg = BRAGG_FILE(**kwargs) In [17]: print(bragg.render()) BRAGG ibrag=3 nreg=500 cutoff=5.0 FILE fname='bottom_spectrum.txt' mkx=99 mky=149 dkx=0.1 dky=0.1
Show JSON schema
{ "title": "BRAGG_FILE", "description": "Bragg scattering with bottom spectrum from file.\n\n.. code-block:: text\n\n BRAGG [ibrag] [nreg] [cutoff] FILE 'fname' [idla] [mkx] [mky] [dkx] [dky]\n\nThe bed elevation spectrum `FB(kx, ky)` is read from a file.\n\nNotes\n-----\nThis spectrum is taken to be uniform over the entire computational domain.\n\nExamples\n--------\n\n.. ipython:: python\n :okwarning:\n\n from rompy.swan.components.physics import BRAGG_FILE\n bragg = BRAGG_FILE(fname=\"bottom_spectrum.txt\", nreg=500, mkx=99, dkx=0.1)\n print(bragg.render())\n kwargs = dict(\n ibrag=3,\n nreg=500,\n cutoff=5.0,\n fname=\"bottom_spectrum.txt\",\n mkx=99,\n mky=149,\n dkx=0.1,\n dky=0.1,\n )\n bragg = BRAGG_FILE(**kwargs)\n print(bragg.render())", "type": "object", "properties": { "model_type": { "default": "file", "description": "Model type discriminator", "enum": [ "file", "FILE" ], "title": "Model Type", "type": "string" }, "ibrag": { "anyOf": [ { "enum": [ 1, 2, 3 ], "type": "integer" }, { "type": "null" } ], "default": null, "description": "Indicates the computation of Bragg scattering term:\n\n* 1: source term is calculated per sweep and bottom spectrum is interpolated at the difference wave number a priori (thus requiring storage)\n* 2: source term is calculated per sweep and bottom spectrum is interpolated at the difference wave number per sweep (no storage)\n* 3: source term is calculated per iteration and bottom spectrum is interpolated at the difference wave number per iteration (no storage)\n\n(SWAN default: 1)", "title": "Ibrag" }, "nreg": { "description": "Size of square region around computational grid point (centered) for computing the mean depth and, if desired, the bed elevation spectrum. It is expressed in terms of the number of grid points (per direction) of the inputted bottom grid", "title": "Nreg", "type": "integer" }, "cutoff": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "default": null, "description": "Cutoff to the ratio between surface and bottom wave numbers. Note: seethe Scientific/Technical documentation for details (SWAN default: 5.0)", "title": "Cutoff" }, "fname": { "description": "Name of file containing the bottom spectrum", "maxLength": 36, "title": "Fname", "type": "string" }, "idla": { "anyOf": [ { "$ref": "#/$defs/IDLA" }, { "type": "null" } ], "default": null, "description": "Order in which the values should be given in the input files" }, "mkx": { "description": "Number of cells in x-direction of the wave number grid related to bottom spectrum (this is one less than the number of points in this direction)", "title": "Mkx", "type": "integer" }, "mky": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "description": "Number of cells in y-direction of the wave number grid related to bottom spectrum (this is one less than the number of points in this direction)(SWAN default: `mky = mkx`)", "title": "Mky" }, "dkx": { "description": "Mesh size in x-direction of the wave number grid related to bottom spectrum (1/m)", "title": "Dkx", "type": "number" }, "dky": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "default": null, "description": "Mesh size in y-direction of the wave number grid related to bottom spectrum (1/m) (SWAN default: `dky = dkx`)", "title": "Dky" } }, "$defs": { "IDLA": { "description": "Order of values in the input files.\n\nAttributes\n----------\nONE: 1\n SWAN reads the map from left to right starting in the upper-left-hand corner of\n the map. A new line in the map should start on a new line in the file.\nTWO: 2\n As `1` but a new line in the map need not start on a new line in the file.\nTHREE: 3\n SWAN reads the map from left to right starting in the lower-left-hand corner of\n the map. A new line in the map should start on a new line in the file.\nFOUR: 4\n As `3` but a new line in the map need not start on a new line in the file.\nFIVE: 5\n SWAN reads the map from top to bottom starting in the lower-left-hand corner of\n the map. A new column in the map should start on a new line in the file.\nSIX: 6\n As `5` but a new column in the map need not start on a new line in the file.\n\nNotes\n-----\nIt is assumed that the x-axis of the grid is pointing to the right and the y-axis\nupwards.", "enum": [ 1, 2, 3, 4, 5, 6 ], "title": "IDLA", "type": "integer" } }, "additionalProperties": false, "required": [ "nreg", "fname", "mkx", "dkx" ] }
- Fields:
- field cutoff: float | None = None#
Cutoff to the ratio between surface and bottom wave numbers. Note: seethe Scientific/Technical documentation for details (SWAN default: 5.0)
- field dkx: float [Required]#
Mesh size in x-direction of the wave number grid related to bottom spectrum (1/m)
- field dky: float | None = None#
Mesh size in y-direction of the wave number grid related to bottom spectrum (1/m) (SWAN default: dky = dkx)
- field fname: str [Required]#
Name of file containing the bottom spectrum
- Constraints:
max_length = 36
- field ibrag: Literal[1, 2, 3] | None = None#
Indicates the computation of Bragg scattering term:
1: source term is calculated per sweep and bottom spectrum is interpolated at the difference wave number a priori (thus requiring storage)
2: source term is calculated per sweep and bottom spectrum is interpolated at the difference wave number per sweep (no storage)
3: source term is calculated per iteration and bottom spectrum is interpolated at the difference wave number per iteration (no storage)
(SWAN default: 1)
- field mkx: int [Required]#
Number of cells in x-direction of the wave number grid related to bottom spectrum (this is one less than the number of points in this direction)
- field mky: int | None = None#
Number of cells in y-direction of the wave number grid related to bottom spectrum (this is one less than the number of points in this direction)(SWAN default: mky = mkx)
- field model_type: Literal['file', 'FILE'] = 'file'#
Model type discriminator
- field nreg: int [Required]#
Size of square region around computational grid point (centered) for computing the mean depth and, if desired, the bed elevation spectrum. It is expressed in terms of the number of grid points (per direction) of the inputted bottom grid