1 | """Module where global pyvolution model parameters are set |
---|
2 | """ |
---|
3 | |
---|
4 | |
---|
5 | #FIXME (Ole): Temporary access to global config file |
---|
6 | from anuga_config import epsilon, default_boundary_tag |
---|
7 | |
---|
8 | #FIXME (Ole): More of these may need to be moved to anuga_config.py |
---|
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 = 1.0e+3 |
---|
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.03 #Manning's friction coefficient |
---|
40 | #g = 9.80665 #Gravity |
---|
41 | g = 9.8 |
---|
42 | #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 |
---|
43 | #The 'official' average is 9.80665 |
---|
44 | |
---|
45 | |
---|
46 | |
---|
47 | |
---|
48 | eta_w = 3.0e-3 #Wind stress coefficient |
---|
49 | rho_a = 1.2e-3 #Atmospheric density |
---|
50 | rho_w = 1023 #Fluid density [kg/m^3] (rho_w = 1023 for salt water) |
---|
51 | |
---|
52 | |
---|
53 | #Betas [0;1] control the allowed steepness of gradient for second order |
---|
54 | #extrapolations. Values of 1 allow the steepes gradients while |
---|
55 | #lower values are more conservative. Values of 0 correspond to |
---|
56 | #1'st order extrapolations. |
---|
57 | # |
---|
58 | # Large values of beta_h may cause simulations to require more timesteps |
---|
59 | # as surface will 'hug' closer to the bed. |
---|
60 | # Small values of beta_h will make code faster, but one may experience |
---|
61 | # artificial momenta caused by discontinuities in water depths in |
---|
62 | # the presence of steep slopes. One example of this would be |
---|
63 | # stationary water 'lapping' upwards to a higher point on the coast. |
---|
64 | # |
---|
65 | # NOTE (Ole): I believe this was addressed with the introduction of |
---|
66 | # tight_slope_limiters. I wish to retire the beta_? parameters. |
---|
67 | # Can you please let me know if you disagree? |
---|
68 | |
---|
69 | |
---|
70 | #There are separate betas for the w, uh, vh and h limiters |
---|
71 | # |
---|
72 | #Good values are: |
---|
73 | |
---|
74 | |
---|
75 | # I think these are better SR but they conflict with the unit tests! |
---|
76 | beta_w = 1.0 |
---|
77 | beta_w_dry = 0.2 |
---|
78 | beta_uh = 1.0 |
---|
79 | beta_uh_dry = 0.2 |
---|
80 | beta_vh = 1.0 |
---|
81 | beta_vh_dry = 0.2 |
---|
82 | beta_h = 0.2 |
---|
83 | |
---|
84 | # beta_h can be safely put to zero esp if we are using |
---|
85 | # tight_slope_limiters = 1. This will |
---|
86 | # also speed things up in general |
---|
87 | beta_h = 0.0 |
---|
88 | |
---|
89 | |
---|
90 | # Alpha_balance controls how limiters are balanced between deep and shallow. |
---|
91 | # A large value will favour the deep water limiters, allowing the a closer hug to the coastline. |
---|
92 | # This will minimise 'creep' but at the same time cause smaller time steps |
---|
93 | # Range: |
---|
94 | |
---|
95 | alpha_balance = 2.0 |
---|
96 | |
---|
97 | # Flag use of new limiters. |
---|
98 | # tight_slope_limiters = 0 means use old limiters (e.g. for some tests) |
---|
99 | # tight_slope_limiters = 1 means use new limiters that hug the bathymetry closer |
---|
100 | tight_slope_limiters = 0 |
---|
101 | |
---|
102 | |
---|
103 | |
---|
104 | CFL = 1.0 #FIXME (ole): Is this in use yet?? |
---|
105 | #(Steve) yes, change domain.CFL to |
---|
106 | #make changes |
---|
107 | |
---|
108 | # Choose type of timestepping, |
---|
109 | timestepping_method = 'euler' # 1st order euler |
---|
110 | #timestepping_method = 'rk2' # 2nd Order TVD scheme |
---|
111 | |
---|
112 | # Option to search for signatures where isolated triangles are |
---|
113 | # responsible for a small global timestep. |
---|
114 | # Treating these by limiting their momenta may help speed up the |
---|
115 | # overall computation. |
---|
116 | # This facility is experimental. |
---|
117 | protect_against_isolated_degenerate_timesteps = False |
---|
118 | |
---|
119 | pmesh_filename = '.\\pmesh' |
---|
120 | version_filename = 'stored_version_info.py' |
---|
121 | |
---|
122 | |
---|
123 | import os, sys |
---|
124 | |
---|
125 | if sys.platform == 'win32': |
---|
126 | default_datadir = '.' |
---|
127 | else: |
---|
128 | default_datadir = '.' |
---|
129 | |
---|
130 | |
---|
131 | use_extensions = True #Try to use C-extensions |
---|
132 | #use_extensions = False #Do not use C-extensions |
---|
133 | |
---|
134 | use_psyco = True #Use psyco optimisations |
---|
135 | #use_psyco = False #Do not use psyco optimisations |
---|
136 | |
---|
137 | |
---|
138 | optimise_dry_cells = True # Exclude dry and still cells from flux computation |
---|
139 | |
---|
140 | optimised_gradient_limiter = True # Use hardwired gradient limiter |
---|
141 | |
---|
142 | #Specific to shallow water W.E. |
---|
143 | minimum_allowed_height = 1.0e-3 #Water depth below which it is considered to be 0 in the model |
---|
144 | |
---|
145 | maximum_allowed_speed = 0.0 # Maximal particle speed of water |
---|
146 | #maximum_allowed_speed = 1.0 # Maximal particle speed of water |
---|
147 | # Too large (100) creates 'flopping' water |
---|
148 | # Too small (0) creates 'creep' |
---|
149 | |
---|
150 | |
---|
151 | minimum_storable_height = 1.0e-5 # Water depth below which it is *stored* as 0 |
---|
152 | |
---|
153 | points_file_block_line_size = 500 # Number of lines read in from a points file |
---|
154 | # when blocking |
---|
155 | |
---|
156 | umask = 002 # used to set file and directory permission created by anuga |
---|
157 | |
---|
158 | max_float = 1.0e36 # Largest number. Used to initialise (max, min) ranges. |
---|
159 | |
---|