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