Commit c9ab39fa authored by Jonathan Lambrechts's avatar Jonathan Lambrechts

ekman

parent f53d5199
Pipeline #2416 failed with stage
in 32 minutes and 19 seconds
import slim3d
import slimPre
import numpy
import sys
Ek = 0.05
nu = 0.01
......@@ -9,6 +10,10 @@ H = (nu/(f*Ek))**0.5
D = 1e-5
C = 1e-5
nb_layers = 10
if len(sys.argv) == 4 :
Ek = float(sys.argv[1])
C = float(sys.argv[2])
D = float(sys.argv[3])
print("H %.16g" % H)
print("Ek %.16g" % Ek)
......@@ -36,8 +41,6 @@ xyz = region_global.coordinates
taux = (D/2*xyz[:,0]-C/2*xyz[:,1])
tauy = (C/2*xyz[:,0]+D/2*xyz[:,1])
slimPre.write_file('windstress.nc', region=region_global, time=None, data=[('taux',taux),('tauy',tauy)])
slimPre.netcdf_to_msh('box.msh','windstress.nc','taux', 'taux')
slimPre.netcdf_to_msh('box.msh','windstress.nc','tauy', 'tauy')
### Run ###
......@@ -48,10 +51,7 @@ equations.set_lax_friedrichs_factor(1.)
equations.set_bottom_friction(True)
equations.set_boundary_coast(['Coast'])
#equations.set_boundary_open(['Coast'])#,eta=("eta.nc","eta"))
equations.set_limiter(False)
#equations.set_initial_elevation("./run2/output/sw2d/eta/eta-000025.idx")
#equations.set_initial_uv_2d("./run2/output/sw2d/uv/uv-000025.idx")
equations.set_wind_stress('stress',('windstress.nc','taux'),('windstress.nc','tauy'))
......@@ -63,7 +63,7 @@ equations.set_horizontal_viscosity(mode="smagorinsky")
#equations.set_horizontal_viscosity(mode="constant",constant=0)
time_loop = slim3d.Loop(equations,
time_step=450,
time_step=400,
export_time_step=0.5*3600,
final_time=200*24*3600,
output_directory='output')
......@@ -150,7 +150,7 @@ while time_loop.get_time() < time_loop.final_time:
time_loop.print_iter_info()
time_loop.export_fields()
inew = compute_vorticity(iout)
if abs(iold-inew) < 1 :
if abs(iold-inew) < abs(inew)/100 :
break
iold = inew
iout += 1
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment