[1581] | 1 | """Module where global model parameters are set |
---|
| 2 | """ |
---|
| 3 | |
---|
| 4 | epsilon = 1.0e-12 |
---|
| 5 | |
---|
| 6 | default_boundary_tag = 'exterior' |
---|
| 7 | |
---|
| 8 | |
---|
| 9 | time_format = '%d/%m/%y %H:%M:%S' |
---|
| 10 | |
---|
| 11 | min_timestep = 1.0e-6 #Should be computed based on geometry |
---|
| 12 | max_timestep = 1000 |
---|
| 13 | #This is how: |
---|
| 14 | #Define maximal possible speed in open water v_max, e.g. 500m/s (soundspeed?) |
---|
| 15 | #Then work out minimal internal distance in mesh r_min and set |
---|
| 16 | #min_timestep = r_min/v_max |
---|
| 17 | # |
---|
| 18 | #Max speeds are calculated in the flux function as |
---|
| 19 | # |
---|
| 20 | #lambda = v +/- sqrt(gh) |
---|
| 21 | # |
---|
| 22 | # so with 500 m/s, h ~ 500^2/g = 2500 m well out of the domain of the |
---|
| 23 | # shallow water wave equation |
---|
| 24 | # |
---|
| 25 | #The actual soundspeed can be as high as 1530m/s |
---|
| 26 | #(see http://staff.washington.edu/aganse/public.projects/clustering/clustering.html), |
---|
| 27 | #but that would only happen with h>225000m in this equation. Why ? |
---|
| 28 | #The maximal speed we specify is really related to the max speed |
---|
| 29 | #of surface pertubation |
---|
| 30 | # |
---|
| 31 | |
---|
| 32 | |
---|
| 33 | v_max = 100 #For use in domain_ext.c |
---|
| 34 | sound_speed = 500 |
---|
| 35 | |
---|
| 36 | |
---|
| 37 | max_smallsteps = 50 #Max number of degenerate steps allowed b4 trying first order |
---|
| 38 | |
---|
| 39 | manning = 0.3 #Manning's friction coefficient |
---|
[1690] | 40 | g = 9.8 #Gravity |
---|
| 41 | #g(phi) = 9780313 * (1 + 0.0053024 sin(phi)**2 - 0.000 0059 sin(2*phi)**2) micro m/s**2, where phi is the latitude |
---|
| 42 | #The 'official' average is 9.80665 |
---|
[1581] | 43 | |
---|
| 44 | |
---|
[1690] | 45 | |
---|
| 46 | |
---|
[1581] | 47 | eta_w = 3.0e-3 #Wind stress coefficient |
---|
| 48 | rho_a = 1.2e-3 #Atmospheric density |
---|
| 49 | rho_w = 1023 #Fluid density [kg/m^3] (rho_w = 1023 for salt water) |
---|
| 50 | |
---|
| 51 | |
---|
| 52 | #Betas [0;1] control the allowed steepness of gradient for second order |
---|
| 53 | #extrapolations. Values of 1 allow the steepes gradients while |
---|
| 54 | #lower values are more conservative. Values of 0 correspond to |
---|
| 55 | #1'st order extrapolations. |
---|
| 56 | # |
---|
| 57 | # Large values of beta_h may cause simulations to require more timesteps |
---|
| 58 | # as surface will 'hug' closer to the bed. |
---|
| 59 | # Small values of beta_h will make code faster, but one may experience |
---|
| 60 | # artificial momenta caused by discontinuities in water depths in |
---|
| 61 | # the presence of steep slopes. One example of this would be |
---|
| 62 | # stationary water 'lapping' upwards to a higher point on the coast. |
---|
| 63 | # |
---|
| 64 | # |
---|
| 65 | # |
---|
| 66 | #There are separate betas for the w-limiter and the h-limiter |
---|
| 67 | # |
---|
| 68 | # |
---|
| 69 | # |
---|
| 70 | # |
---|
| 71 | #Good values are: |
---|
| 72 | #beta_w = 0.9 |
---|
| 73 | #beta_h = 0.2 |
---|
| 74 | |
---|
| 75 | |
---|
| 76 | |
---|
| 77 | beta_w = 0.9 |
---|
| 78 | beta_h = 0.2 |
---|
| 79 | CFL = 1.0 #FIXME (ole): Is this in use yet?? |
---|
[1839] | 80 | #(Steve) yes, change domain.CFL to |
---|
| 81 | #make changes |
---|
[1581] | 82 | |
---|
| 83 | |
---|
| 84 | pmesh_filename = '.\\pmesh' |
---|
| 85 | |
---|
| 86 | |
---|
| 87 | import os, sys |
---|
| 88 | |
---|
| 89 | if sys.platform == 'win32': |
---|
[1604] | 90 | #default_datadir = 'C:\grohm_output' |
---|
[1697] | 91 | default_datadir = '.' |
---|
[1581] | 92 | else: |
---|
[1604] | 93 | #default_datadir = os.path.expanduser('~'+os.sep+'grohm_output') |
---|
[1697] | 94 | default_datadir = '.' |
---|
[1581] | 95 | |
---|
| 96 | |
---|
| 97 | use_extensions = True #Try to use C-extensions |
---|
| 98 | #use_extensions = False #Do not use C-extensions |
---|
| 99 | |
---|
| 100 | use_psyco = True #Use psyco optimisations |
---|
| 101 | #use_psyco = False #Do not use psyco optimisations |
---|
| 102 | |
---|
| 103 | |
---|
[1591] | 104 | optimised_gradient_limiter = True #Use hardwired gradient limiter |
---|
| 105 | |
---|
[1581] | 106 | #Specific to shallow water W.E. |
---|
| 107 | minimum_allowed_height = 1.0e-3 #Water depth below which it is considered to be 0 |
---|