1 | """Module where global model parameters are set |
---|
2 | """ |
---|
3 | |
---|
4 | epsilon = 1.0e-13 |
---|
5 | |
---|
6 | default_boundary_tag = 'exterior' |
---|
7 | |
---|
8 | |
---|
9 | min_timestep = 1.0e-6 #Should be computed based on geometry |
---|
10 | max_timestep = 1000 |
---|
11 | #This is how: |
---|
12 | #Define maximal possible speed in open water v_max, e.g. 500m/s (soundspeed?) |
---|
13 | #Then work out minimal internal distance in mesh r_min and set |
---|
14 | #min_timestep = r_min/v_max |
---|
15 | # |
---|
16 | #Max speeds are calculated in the flux function as |
---|
17 | # |
---|
18 | #lambda = v +/- sqrt(gh) |
---|
19 | # |
---|
20 | # so with 500 m/s, h ~ 500^2/g = 2500 m well out of the domain of the |
---|
21 | # shallow water wave equation |
---|
22 | # |
---|
23 | #The actual soundspeed can be as high as 1530m |
---|
24 | #(see http://staff.washington.edu/aganse/public.projects/clustering/clustering.html), but that would only happen with h>225000m in this equation. Why ? |
---|
25 | #The maximal speed we specify is really related to the max speed |
---|
26 | #of surface pertubation |
---|
27 | |
---|
28 | |
---|
29 | |
---|
30 | v_max = 100 #For use in domain_ext.c |
---|
31 | sound_speed = 500 |
---|
32 | |
---|
33 | |
---|
34 | max_smallsteps = 10 #Max number of degenerate steps allowed b4 trying first order |
---|
35 | |
---|
36 | g = 9.8 #Gravity |
---|
37 | manning = 0.3 #Manning's friction coefficient |
---|
38 | |
---|
39 | |
---|
40 | |
---|
41 | beta = 0.9 #]0;1] (e.g. 0.9). 1 allows the steepest gradients, |
---|
42 | #lower values are the more conservative |
---|
43 | #the limiter being a first order method. |
---|
44 | |
---|
45 | pmesh_filename = '.\\pmesh' |
---|
46 | |
---|
47 | |
---|
48 | import os, sys |
---|
49 | |
---|
50 | if sys.platform == 'win32': |
---|
51 | data_dir = 'C:\grohm_output' |
---|
52 | else: |
---|
53 | data_dir = os.path.expanduser('~'+os.sep+'grohm_output') |
---|
54 | |
---|
55 | |
---|
56 | |
---|
57 | use_extensions = True #Try to use C-extensions |
---|
58 | #use_extensions = False #Do not use C-extensions |
---|
59 | |
---|
60 | use_psyco = True #Use psyco optimisations |
---|
61 | #use_psyco = False #Do not use psyco optimisations |
---|
62 | |
---|
63 | |
---|
64 | #Specific to shallow water W.E. |
---|
65 | minimum_allowed_height = 1.0e-3 #Water depth below which it is considered to be 0 |
---|
66 | number_of_conserved_quantities = 3 #Should really be set dynamically - but hey! |
---|
67 | number_of_field_values = 2 |
---|