[4837] | 1 | """Module where global ANUGA model parameters and default values are set |
---|
[4376] | 2 | """ |
---|
| 3 | |
---|
[4837] | 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 |
---|
[4376] | 9 | |
---|
| 10 | |
---|
[4837] | 11 | #------------------------------------------- |
---|
| 12 | # Standard filenames, directories and system |
---|
| 13 | # parameters used by ANUGA |
---|
| 14 | #------------------------------------------- |
---|
| 15 | pmesh_filename = '.\\pmesh' |
---|
| 16 | version_filename = 'stored_version_info.py' |
---|
| 17 | default_datadir = '.' |
---|
[4376] | 18 | time_format = '%d/%m/%y %H:%M:%S' |
---|
[4837] | 19 | umask = 002 # Controls file and directory permission created by anuga |
---|
| 20 | default_boundary_tag = 'exterior' |
---|
[4376] | 21 | |
---|
[4837] | 22 | # Major revision number for use with create_distribution |
---|
| 23 | # and update_anuga_user_guide |
---|
| 24 | major_revision = '1.0beta' |
---|
[4376] | 25 | |
---|
| 26 | |
---|
[4837] | 27 | #------------------- |
---|
| 28 | # Physical constants |
---|
| 29 | #------------------- |
---|
| 30 | manning = 0.03 # Manning's friction coefficient |
---|
| 31 | #g = 9.80665 # Gravity - FIXME reinstate this and fix unit tests. |
---|
[4376] | 32 | g = 9.8 |
---|
| 33 | #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 |
---|
| 34 | #The 'official' average is 9.80665 |
---|
| 35 | |
---|
| 36 | eta_w = 3.0e-3 #Wind stress coefficient |
---|
| 37 | rho_a = 1.2e-3 #Atmospheric density |
---|
| 38 | rho_w = 1023 #Fluid density [kg/m^3] (rho_w = 1023 for salt water) |
---|
| 39 | |
---|
| 40 | |
---|
[4837] | 41 | #----------------------------------------------------- |
---|
| 42 | # Limiters - used with linear reconstruction of vertex |
---|
| 43 | # values from centroid values |
---|
| 44 | #----------------------------------------------------- |
---|
| 45 | |
---|
| 46 | # Betas [0;1] control the allowed steepness of gradient for second order |
---|
| 47 | # extrapolations. Values of 1 allow the steepes gradients while |
---|
| 48 | # lower values are more conservative. Values of 0 correspond to |
---|
| 49 | # 1'st order extrapolations. |
---|
[4376] | 50 | # |
---|
| 51 | # Large values of beta_h may cause simulations to require more timesteps |
---|
| 52 | # as surface will 'hug' closer to the bed. |
---|
| 53 | # Small values of beta_h will make code faster, but one may experience |
---|
| 54 | # artificial momenta caused by discontinuities in water depths in |
---|
| 55 | # the presence of steep slopes. One example of this would be |
---|
| 56 | # stationary water 'lapping' upwards to a higher point on the coast. |
---|
| 57 | # |
---|
[4768] | 58 | # NOTE (Ole): I believe this was addressed with the introduction of |
---|
| 59 | # tight_slope_limiters. I wish to retire the beta_? parameters. |
---|
| 60 | # Can you please let me know if you disagree? |
---|
| 61 | |
---|
[4837] | 62 | # There are separate betas for the w, uh, vh and h limiters |
---|
[4376] | 63 | # I think these are better SR but they conflict with the unit tests! |
---|
| 64 | beta_w = 1.0 |
---|
| 65 | beta_w_dry = 0.2 |
---|
| 66 | beta_uh = 1.0 |
---|
| 67 | beta_uh_dry = 0.2 |
---|
| 68 | beta_vh = 1.0 |
---|
| 69 | beta_vh_dry = 0.2 |
---|
| 70 | beta_h = 0.2 |
---|
| 71 | |
---|
[4733] | 72 | # beta_h can be safely put to zero esp if we are using |
---|
| 73 | # tight_slope_limiters = 1. This will |
---|
| 74 | # also speed things up in general |
---|
[4376] | 75 | beta_h = 0.0 |
---|
| 76 | |
---|
| 77 | |
---|
| 78 | # Alpha_balance controls how limiters are balanced between deep and shallow. |
---|
| 79 | # A large value will favour the deep water limiters, allowing the a closer hug to the coastline. |
---|
| 80 | # This will minimise 'creep' but at the same time cause smaller time steps |
---|
| 81 | # Range: |
---|
| 82 | |
---|
| 83 | alpha_balance = 2.0 |
---|
| 84 | |
---|
| 85 | # Flag use of new limiters. |
---|
[4631] | 86 | # tight_slope_limiters = 0 means use old limiters (e.g. for some tests) |
---|
| 87 | # tight_slope_limiters = 1 means use new limiters that hug the bathymetry closer |
---|
| 88 | tight_slope_limiters = 0 |
---|
[4376] | 89 | |
---|
| 90 | |
---|
| 91 | |
---|
[4837] | 92 | #------------- |
---|
| 93 | # Timestepping |
---|
| 94 | #------------- |
---|
[4376] | 95 | |
---|
[4837] | 96 | CFL = 1.0 # CFL condition assigned to domain.CFL - controls timestep size |
---|
| 97 | |
---|
[4712] | 98 | # Choose type of timestepping, |
---|
| 99 | timestepping_method = 'euler' # 1st order euler |
---|
| 100 | #timestepping_method = 'rk2' # 2nd Order TVD scheme |
---|
| 101 | |
---|
[4677] | 102 | # Option to search for signatures where isolated triangles are |
---|
| 103 | # responsible for a small global timestep. |
---|
| 104 | # Treating these by limiting their momenta may help speed up the |
---|
| 105 | # overall computation. |
---|
| 106 | # This facility is experimental. |
---|
[4805] | 107 | |
---|
| 108 | # protect_against_isolated_degenerate_timesteps = False |
---|
[4677] | 109 | protect_against_isolated_degenerate_timesteps = False |
---|
[4376] | 110 | |
---|
| 111 | |
---|
[4837] | 112 | min_timestep = 1.0e-6 # Minimal timestep accepted in ANUGA |
---|
| 113 | max_timestep = 1.0e+3 |
---|
| 114 | max_smallsteps = 50 # Max number of degenerate steps allowed b4 trying first order |
---|
[4376] | 115 | |
---|
[4837] | 116 | #Perhaps minimal timestep could be based on the geometry as follows: |
---|
| 117 | #Define maximal possible speed in open water v_max, e.g. 500m/s (soundspeed?) |
---|
| 118 | #Then work out minimal internal distance in mesh r_min and set |
---|
| 119 | #min_timestep = r_min/v_max |
---|
| 120 | # |
---|
| 121 | #Max speeds are calculated in the flux function as |
---|
| 122 | # |
---|
| 123 | #lambda = v +/- sqrt(gh) |
---|
| 124 | # |
---|
| 125 | # so with 500 m/s, h ~ 500^2/g = 2500 m well out of the domain of the |
---|
| 126 | # shallow water wave equation |
---|
| 127 | # |
---|
| 128 | #The actual soundspeed can be as high as 1530m/s |
---|
| 129 | #(see http://staff.washington.edu/aganse/public.projects/clustering/clustering.html), |
---|
| 130 | #but that would only happen with h>225000m in this equation. Why ? |
---|
| 131 | #The maximal speed we specify is really related to the max speed |
---|
| 132 | #of surface pertubation |
---|
| 133 | # |
---|
| 134 | #v_max = 100 #For use in domain_ext.c |
---|
| 135 | #sound_speed = 500 |
---|
[4376] | 136 | |
---|
| 137 | |
---|
[4837] | 138 | #--------------------------------------------------- |
---|
| 139 | # Ranges specific to the shallow water wave equation |
---|
| 140 | # These control maximal and minimal values of |
---|
| 141 | # quantities |
---|
| 142 | #--------------------------------------------------- |
---|
[4376] | 143 | |
---|
[4837] | 144 | # Water depth below which it is considered to be 0 in the model |
---|
| 145 | minimum_allowed_height = 1.0e-3 |
---|
[4376] | 146 | |
---|
[4837] | 147 | # Water depth below which it is *stored* as 0 |
---|
| 148 | minimum_storable_height = 1.0e-5 |
---|
[4376] | 149 | |
---|
[4805] | 150 | # FIXME (Ole): Redefine this parameter to control maximal speeds in general |
---|
| 151 | # and associate it with protect_against_isolated_degenerate_timesteps = True |
---|
[4732] | 152 | maximum_allowed_speed = 0.0 # Maximal particle speed of water |
---|
| 153 | #maximum_allowed_speed = 1.0 # Maximal particle speed of water |
---|
[4376] | 154 | # Too large (100) creates 'flopping' water |
---|
| 155 | # Too small (0) creates 'creep' |
---|
[4837] | 156 | |
---|
| 157 | maximum_froude_number = 100.0 # To be used in limiters. |
---|
[4376] | 158 | |
---|
| 159 | |
---|
[4837] | 160 | #------------------------------------------------------------ |
---|
| 161 | # Performance parameters used to invoke various optimisations |
---|
| 162 | #------------------------------------------------------------ |
---|
[4815] | 163 | |
---|
[4837] | 164 | use_extensions = True # Use C-extensions |
---|
| 165 | use_psyco = True # Use psyco optimisations |
---|
[4376] | 166 | |
---|
[4837] | 167 | optimise_dry_cells = True # Exclude dry and still cells from flux computation |
---|
| 168 | optimised_gradient_limiter = True # Use hardwired gradient limiter |
---|
| 169 | |
---|
[4376] | 170 | points_file_block_line_size = 500 # Number of lines read in from a points file |
---|
| 171 | # when blocking |
---|
[4502] | 172 | |
---|
[4685] | 173 | |
---|
[4837] | 174 | |
---|
| 175 | |
---|
| 176 | |
---|
| 177 | |
---|
[4699] | 178 | |
---|