1 | """Module where global ANUGA model parameters and default values are set |
---|
2 | """ |
---|
3 | |
---|
4 | #-------------------- |
---|
5 | # Numerical constants |
---|
6 | #-------------------- |
---|
7 | epsilon = 1.0e-12 # Smallest number - used for safe division |
---|
8 | max_float = 1.0e36 # Largest number - used to initialise (max, min) ranges |
---|
9 | default_smoothing_parameter = 0.001 # Default alpha for penalised |
---|
10 | # least squares fitting |
---|
11 | |
---|
12 | velocity_protection = 1.0e-6 |
---|
13 | |
---|
14 | #------------------------------------------- |
---|
15 | # Standard filenames, directories and system |
---|
16 | # parameters used by ANUGA |
---|
17 | #------------------------------------------- |
---|
18 | pmesh_filename = '.\\pmesh' |
---|
19 | version_filename = 'stored_version_info.py' |
---|
20 | default_datadir = '.' |
---|
21 | time_format = '%d/%m/%y %H:%M:%S' |
---|
22 | umask = 002 # Controls file and directory permission created by anuga |
---|
23 | default_boundary_tag = 'exterior' |
---|
24 | |
---|
25 | # Major revision number for use with create_distribution |
---|
26 | # and update_anuga_user_guide |
---|
27 | major_revision = '1.0beta' |
---|
28 | |
---|
29 | |
---|
30 | #------------------- |
---|
31 | # Physical constants |
---|
32 | #------------------- |
---|
33 | manning = 0.03 # Manning's friction coefficient |
---|
34 | #g = 9.80665 # Gravity - FIXME reinstate this and fix unit tests. |
---|
35 | g = 9.8 |
---|
36 | #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 |
---|
37 | #The 'official' average is 9.80665 |
---|
38 | |
---|
39 | eta_w = 3.0e-3 #Wind stress coefficient |
---|
40 | rho_a = 1.2e-3 #Atmospheric density |
---|
41 | rho_w = 1023 #Fluid density [kg/m^3] (rho_w = 1023 for salt water) |
---|
42 | |
---|
43 | |
---|
44 | #----------------------------------------------------- |
---|
45 | # Limiters - used with linear reconstruction of vertex |
---|
46 | # values from centroid values |
---|
47 | #----------------------------------------------------- |
---|
48 | |
---|
49 | # Betas [0;1] control the allowed steepness of gradient for second order |
---|
50 | # extrapolations. Values of 1 allow the steepes gradients while |
---|
51 | # lower values are more conservative. Values of 0 correspond to |
---|
52 | # 1'st order extrapolations. |
---|
53 | # |
---|
54 | |
---|
55 | # There are separate betas for the w, uh, and vh limiters |
---|
56 | # I think these are better SR but they conflict with the unit tests! |
---|
57 | beta_w = 1.0 |
---|
58 | beta_w_dry = 0.2 |
---|
59 | beta_uh = 1.0 |
---|
60 | beta_uh_dry = 0.2 |
---|
61 | beta_vh = 1.0 |
---|
62 | beta_vh_dry = 0.2 |
---|
63 | |
---|
64 | |
---|
65 | # Alpha_balance controls how limiters are balanced between deep and shallow. |
---|
66 | # A large value will favour the deep water limiters, allowing the a closer hug to the coastline. |
---|
67 | # This will minimise 'creep' but at the same time cause smaller time steps |
---|
68 | # Range: |
---|
69 | |
---|
70 | alpha_balance = 2.0 |
---|
71 | |
---|
72 | # Flag use of new limiters. |
---|
73 | # tight_slope_limiters = 0 means use old limiters (e.g. for some tests) |
---|
74 | # tight_slope_limiters = 1 means use new limiters that hug the bathymetry closer |
---|
75 | tight_slope_limiters = True |
---|
76 | |
---|
77 | # Use centroid velocities to reconstruct momentum at vertices in |
---|
78 | # very shallow water |
---|
79 | # This option has a first order flavour to it, but we still have second order |
---|
80 | # reconstruction of stage and this option only applies in |
---|
81 | # balance_deep_and_shallow when |
---|
82 | # alpha < 1 so in deeper water the full second order scheme is used. |
---|
83 | # |
---|
84 | # This option is good with tight_slope_limiters, especially for large domains. |
---|
85 | use_centroid_velocities = True |
---|
86 | |
---|
87 | |
---|
88 | #------------- |
---|
89 | # Timestepping |
---|
90 | #------------- |
---|
91 | |
---|
92 | CFL = 1.0 # CFL condition assigned to domain.CFL - controls timestep size |
---|
93 | |
---|
94 | # Choose type of timestepping, |
---|
95 | timestepping_method = 'euler' # 1st order euler |
---|
96 | #timestepping_method = 'rk2' # 2nd Order TVD scheme |
---|
97 | |
---|
98 | # rk2 is a little more stable than euler, so rk2 timestepping |
---|
99 | # can deal with a larger beta when slope limiting the reconstructed |
---|
100 | # solution. The large beta is needed if solving problems sensitive |
---|
101 | # to numerical diffusion, like a small forced wave in an ocean |
---|
102 | beta_euler = 1.0 |
---|
103 | beta_rk2 = 1.6 |
---|
104 | |
---|
105 | |
---|
106 | |
---|
107 | # Option to search for signatures where isolated triangles are |
---|
108 | # responsible for a small global timestep. |
---|
109 | # Treating these by limiting their momenta may help speed up the |
---|
110 | # overall computation. |
---|
111 | # This facility is experimental. |
---|
112 | |
---|
113 | # protect_against_isolated_degenerate_timesteps = False |
---|
114 | protect_against_isolated_degenerate_timesteps = False |
---|
115 | |
---|
116 | |
---|
117 | min_timestep = 1.0e-6 # Minimal timestep accepted in ANUGA |
---|
118 | max_timestep = 1.0e+3 |
---|
119 | max_smallsteps = 50 # Max number of degenerate steps allowed b4 trying first order |
---|
120 | |
---|
121 | #Perhaps minimal timestep could be based on the geometry as follows: |
---|
122 | #Define maximal possible speed in open water v_max, e.g. 500m/s (soundspeed?) |
---|
123 | #Then work out minimal internal distance in mesh r_min and set |
---|
124 | #min_timestep = r_min/v_max |
---|
125 | # |
---|
126 | #Max speeds are calculated in the flux function as |
---|
127 | # |
---|
128 | #lambda = v +/- sqrt(gh) |
---|
129 | # |
---|
130 | # so with 500 m/s, h ~ 500^2/g = 2500 m well out of the domain of the |
---|
131 | # shallow water wave equation |
---|
132 | # |
---|
133 | #The actual soundspeed can be as high as 1530m/s |
---|
134 | #(see http://staff.washington.edu/aganse/public.projects/clustering/clustering.html), |
---|
135 | #but that would only happen with h>225000m in this equation. Why ? |
---|
136 | #The maximal speed we specify is really related to the max speed |
---|
137 | #of surface pertubation |
---|
138 | # |
---|
139 | #v_max = 100 #For use in domain_ext.c |
---|
140 | #sound_speed = 500 |
---|
141 | |
---|
142 | |
---|
143 | #--------------------------------------------------- |
---|
144 | # Ranges specific to the shallow water wave equation |
---|
145 | # These control maximal and minimal values of |
---|
146 | # quantities |
---|
147 | #--------------------------------------------------- |
---|
148 | |
---|
149 | # Water depth below which it is considered to be 0 in the model |
---|
150 | minimum_allowed_height = 1.0e-3 |
---|
151 | |
---|
152 | # Water depth below which it is *stored* as 0 |
---|
153 | minimum_storable_height = 1.0e-5 |
---|
154 | |
---|
155 | # FIXME (Ole): Redefine this parameter to control maximal speeds in general |
---|
156 | # and associate it with protect_against_isolated_degenerate_timesteps = True |
---|
157 | maximum_allowed_speed = 0.0 # Maximal particle speed of water |
---|
158 | #maximum_allowed_speed = 1.0 # Maximal particle speed of water |
---|
159 | # Too large (100) creates 'flopping' water |
---|
160 | # Too small (0) creates 'creep' |
---|
161 | |
---|
162 | maximum_froude_number = 100.0 # To be used in limiters. |
---|
163 | |
---|
164 | |
---|
165 | #------------------------------------------------------------ |
---|
166 | # Performance parameters used to invoke various optimisations |
---|
167 | #------------------------------------------------------------ |
---|
168 | |
---|
169 | use_extensions = True # Use C-extensions |
---|
170 | use_psyco = True # Use psyco optimisations |
---|
171 | |
---|
172 | optimise_dry_cells = True # Exclude dry and still cells from flux computation |
---|
173 | optimised_gradient_limiter = True # Use hardwired gradient limiter |
---|
174 | use_edge_limiter = False # The edge limiter is better, but most runs have been using vertex limiting. Validations passed with this one True 9th May 2008, but many unit tests need backward compatibility flag set FIXME(Ole). |
---|
175 | |
---|
176 | points_file_block_line_size = 500 # Number of lines read in from a points file |
---|
177 | # when blocking |
---|
178 | |
---|
179 | |
---|
180 | |
---|
181 | |
---|
182 | |
---|
183 | |
---|
184 | |
---|