slim4.swan
- class slim4.swan.NonStationarySwan(slim_mesh, bath, t0, tend, dt, export_dt=None)
Bases:
SwanNon stationary SWAN run
- is_stationary()
Return whether stationary SWAN will be used
- Return type:
bool
- write_script_boundary()
Write command lines for SWAN boundary conditions in SWAN script
- Return type:
None
- class slim4.swan.SpectraAtPoints(sname, fname, tbegspc, deltspc)
Bases:
object- deltspc: float
- fname: str
- sname: str
- tbegspc: float
- class slim4.swan.StationarySwan(slim_mesh, bath)
Bases:
SwanStationary SWAN run
- is_stationary()
Return whether stationary SWAN will be used
- Return type:
bool
- set_time(t)
- Return type:
None
- time = None
- write_script_boundary()
Write command lines for SWAN boundary conditions in SWAN script
- Return type:
None
- class slim4.swan.Swan(mesh, bath)
Bases:
ABC- add_output_variable(variable)
- Return type:
None
- boundary_parameters = None
- comm_info = None
- evaluate_parameters(t)
- Return type:
ndarray
- export(dirname, iiter, t_exp, append)
- Return type:
None
- export_spectra_at_points(sname, fname, tbegspc, deltspc)
- Return type:
None
- fid = None
- has_closed_tags = False
- has_wind = False
- input_data = {}
- abstractmethod is_stationary()
Return whether stationary SWAN will be used
- Return type:
bool
- open_node_tags = None
- options = SwanOptions(mdc=24, flow=0.03, msc=28, mxitst=30, npnts=95, drel=0.01, dabs=0.005, gen3='KOMEN', wcap=False, white_capping_model='KOMEN', cds1=1.75, delta=1.0, cds2=2.36e-05, powst=2.0, powk=1.0, agrow=True, wbreak=True, triads=False, friction=True, diffraction=False, breaking_alpha=1, breaking_gamma=0.73, triads_alpha=1.0, friction_method='MADSEN', friction_coeff=0.05, under_relaxation_coeff=0.01)
- output_variables = ['HSIG', 'DIR', 'WLEN', 'PER', 'FORCE']
- peak_parameters = True
- set_boundary_closed(boundaries)
- Return type:
None
- set_boundary_parameters(sides, path, swh, per, cdir)
- Return type:
None
- set_boundary_spectra(sides, path, spectra)
- Return type:
None
- set_currents(data)
- Return type:
None
- set_option(name, value)
- Return type:
None
- set_roughness_length(data)
- Return type:
None
- set_water_level(data)
- Return type:
None
- set_wind_speed(data)
- Return type:
None
- slim_dg_from_swanoutput(vswan)
- Return type:
ndarray[Any,dtype[TypeVar(_ScalarType_co, bound=generic, covariant=True)]]
- spectra = None
- spectra_at_points = None
- swan_variables = {'DIR': ('Dir', False), 'DISSIP': ('Dissip', False), 'FORCE': ('WForce', True), 'HSIG': ('Hsig', False), 'PER': ('Period', False), 'SDC': ('Stokes', True), 'STEEPNESS': ('Steepn', False), 'VEL': ('Vel', True), 'WIND': ('Windv', True), 'WLEN': ('Wlen', False), 'XP': ('Xp', False), 'YP': ('Yp', False)}
- use_mean_wave_parameter()
- write_fort14()
Write SWAN mesh file using ADCIRC format. SwanReadADCGrid.f90 should be modified to read the generated files
- Return type:
None
- write_fort18()
Writes fort.18 file for the communicartion between partitions. SwanReadfort18.f90 should be modified to be able to run the generated fort.18 files
- Return type:
None
- write_script(restarted)
Write SWAN run script
- Return type:
None
- abstractmethod write_script_boundary()
Write command lines for SWAN boundary conditions in SWAN script
- Return type:
None
- write_spectra(times)
- Return type:
None
- class slim4.swan.SwanBoundaryData(data, vtime, lon, lat, sides, rfreq=None, cdir=None)
Bases:
objectClass to interpolate open boundary conditions for SWAN
- eval(t)
- Return type:
ndarray
- class slim4.swan.SwanOptions(mdc=24, flow=0.03, msc=28, mxitst=30, npnts=95, drel=0.01, dabs=0.005, gen3='KOMEN', wcap=False, white_capping_model='KOMEN', cds1=1.75, delta=1.0, cds2=2.36e-05, powst=2.0, powk=1.0, agrow=True, wbreak=True, triads=False, friction=True, diffraction=False, breaking_alpha=1, breaking_gamma=0.73, triads_alpha=1.0, friction_method='MADSEN', friction_coeff=0.05, under_relaxation_coeff=0.01)
Bases:
objectClass to gather options for swan runs
- agrow: bool = True
- breaking_alpha: float = 1
- breaking_gamma: float = 0.73
- cds1: float = 1.75
- cds2: float = 2.36e-05
- dabs: float = 0.005
- delta: float = 1.0
- diffraction: bool = False
- drel: float = 0.01
- flow: float = 0.03
- friction: bool = True
- friction_coeff: float = 0.05
- friction_method: str = 'MADSEN'
- gen3: str = 'KOMEN'
- mdc: int = 24
- msc: int = 28
- mxitst: int = 30
- npnts: float = 95
- powk: float = 1.0
- powst: float = 2.0
- triads: bool = False
- triads_alpha: float = 1.0
- under_relaxation_coeff: float = 0.01
- wbreak: bool = True
- wcap: bool = False
- white_capping_model: str = 'KOMEN'
- slim4.swan.build_node_map(node_from, node_to)
- Return type:
ndarray[Any,dtype[int]]
- slim4.swan.gen_loops(bndedges)
- slim4.swan.isoformat(t)
- Return type:
str
- slim4.swan.reorder(loop, x, interior)
- slim4.swan.swan_boundary_from_file(path, vm, varname, spectra=False)
- Return type:
- slim4.swan.swan_bpnt_list(x, triangles, vm)
This function replaces SwanBpntlist.f90 to build the boundary of the mesh (partition) The fortran script must be adapted to read the generated blist file instead of computing the boundary
- Return type:
None