|
|
|
|
|
# Run Hydro
|
|
|
|
|
|
Useful import
|
|
|
|
|
|
```python
|
|
|
import slim
|
|
|
```
|
|
|
|
|
|
Give the name of the directories where data are (same as in the preprocessing script)
|
|
|
|
|
|
```python
|
|
|
data_dir_base = 'data_'+slim.partition_nb()+'/'
|
|
|
data_dir = data_dir_base+slim.partition_id()+'/'
|
|
|
```
|
|
|
|
|
|
Create a ```Domain``` object, the computational domain defined by the mesh and the bathymetry (and gravity, density, order of the element, ...)
|
|
|
|
|
|
```python
|
|
|
domain = slim.Domain(data_dir+'mesh.msh', data_dir_base+'bathymetry_smooth/bathymetry_smooth.idx')
|
|
|
```
|
|
|
|
|
|
Create a ```ShallowWater2d``` object, the hydrodynamics equation
|
|
|
|
|
|
```python
|
|
|
eq = slim.ShallowWater2d(domain, 'implicit', initial_time="2016-01-01 00:00:00", final_time="2016-01-08 00:00:00")
|
|
|
eq.set_dissipation('manning')
|
|
|
eq.set_viscosity('smagorinsky')
|
|
|
eq.set_coriolis((data_dir+'coriolis.nc', 'coriolis'))
|
|
|
|
|
|
# Boundary conditions
|
|
|
eq.set_boundary_coast('coast')
|
|
|
eq.set_boundary_coast('island')
|
|
|
openBnd = data_dir+'open_bnd.nc'
|
|
|
eq.set_boundary_open('atlantic', sse=(openBnd,'h'),ux=(openBnd,'u'),uy=(openBnd,'v'),transport_flux=True)
|
|
|
eq.set_boundary_open('mexico', sse=(openBnd,'h'),ux=(openBnd,'u'),uy=(openBnd,'v'),transport_flux=True)
|
|
|
|
|
|
### Time loop
|
|
|
loop=slim.Loop(maximum_time_step = 900., export_time = 3600., path = 'output')
|
|
|
loop.add_equation(eq)
|
|
|
loop.run()
|
|
|
|
|
|
|
|
|
# Run Tracer
|
... | ... | |