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