source: anuga_core/source/anuga/config.py @ 5175

Last change on this file since 5175 was 5175, checked in by steve, 16 years ago

Ole and I seem to have got edge limiteri working.
Set domain.use_edge_limiter = True
to test the method

File size: 6.4 KB
Line 
1"""Module where global ANUGA model parameters and default values are set
2"""
3
4#--------------------
5# Numerical constants
6#--------------------
7epsilon = 1.0e-12 # Smallest number - used for safe division
8max_float = 1.0e36 # Largest number - used to initialise (max, min) ranges
9
10
11#-------------------------------------------
12# Standard filenames, directories and system
13# parameters used by ANUGA
14#-------------------------------------------
15pmesh_filename = '.\\pmesh'
16version_filename = 'stored_version_info.py'
17default_datadir = '.'
18time_format = '%d/%m/%y %H:%M:%S'
19umask = 002  # Controls file and directory permission created by anuga
20default_boundary_tag = 'exterior' 
21
22# Major revision number for use with create_distribution
23# and update_anuga_user_guide
24major_revision = '1.0beta'
25
26
27#-------------------
28# Physical constants
29#-------------------
30manning = 0.03  # Manning's friction coefficient
31#g = 9.80665    # Gravity - FIXME reinstate this and fix unit tests.
32g = 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
36eta_w = 3.0e-3 #Wind stress coefficient
37rho_a = 1.2e-3 #Atmospheric density
38rho_w = 1023   #Fluid density [kg/m^3] (rho_w = 1023 for salt water)
39
40
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.
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#
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
62# There are separate betas for the w, uh, vh and h limiters
63# I think these are better SR but they conflict with the unit tests!
64beta_w      = 1.0
65beta_w_dry  = 0.2
66beta_uh     = 1.0
67beta_uh_dry = 0.2
68beta_vh     = 1.0
69beta_vh_dry = 0.2
70beta_h      = 0.2
71
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
75beta_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
83alpha_balance = 2.0 
84
85# Flag use of new limiters.
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
88tight_slope_limiters = 0
89
90
91
92#-------------
93# Timestepping
94#-------------
95
96CFL = 1.0  # CFL condition assigned to domain.CFL - controls timestep size
97     
98# Choose type of timestepping,
99timestepping_method = 'euler' # 1st order euler
100#timestepping_method = 'rk2'   # 2nd Order TVD scheme
101
102# rk2 is a little more stable than euler, so rk2 timestepping
103# can deal with a larger beta when slope limiting the reconstructed
104# solution. The large beta is needed if solving problems sensitive
105# to numerical diffusion, like a small forced wave in an ocean
106beta_euler = 1.0
107beta_rk2   = 1.6
108
109
110
111# Option to search for signatures where isolated triangles are
112# responsible for a small global timestep.
113# Treating these by limiting their momenta may help speed up the
114# overall computation.
115# This facility is experimental.
116
117# protect_against_isolated_degenerate_timesteps = False
118protect_against_isolated_degenerate_timesteps = False
119
120
121min_timestep = 1.0e-6 # Minimal timestep accepted in ANUGA
122max_timestep = 1.0e+3
123max_smallsteps = 50  # Max number of degenerate steps allowed b4 trying first order
124
125#Perhaps minimal timestep could be based on the geometry as follows:
126#Define maximal possible speed in open water v_max, e.g. 500m/s (soundspeed?)
127#Then work out minimal internal distance in mesh r_min and set
128#min_timestep = r_min/v_max
129#
130#Max speeds are calculated in the flux function as
131#
132#lambda = v +/- sqrt(gh)
133#
134# so with 500 m/s, h ~ 500^2/g = 2500 m well out of the domain of the
135# shallow water wave equation
136#
137#The actual soundspeed can be as high as 1530m/s
138#(see http://staff.washington.edu/aganse/public.projects/clustering/clustering.html),
139#but that would only happen with h>225000m in this equation. Why ?
140#The maximal speed we specify is really related to the max speed
141#of surface pertubation
142#
143#v_max = 100 #For use in domain_ext.c
144#sound_speed = 500
145
146
147#---------------------------------------------------
148# Ranges specific to the shallow water wave equation
149# These control maximal and minimal values of
150# quantities
151#---------------------------------------------------
152
153# Water depth below which it is considered to be 0 in the model
154minimum_allowed_height = 1.0e-3 
155
156# Water depth below which it is *stored* as 0
157minimum_storable_height = 1.0e-5
158
159# FIXME (Ole): Redefine this parameter to control maximal speeds in general
160# and associate it with protect_against_isolated_degenerate_timesteps = True
161maximum_allowed_speed = 0.0 # Maximal particle speed of water
162#maximum_allowed_speed = 1.0 # Maximal particle speed of water
163                            # Too large (100) creates 'flopping' water
164                            # Too small (0) creates 'creep'
165                           
166maximum_froude_number = 100.0 # To be used in limiters.
167
168
169#------------------------------------------------------------
170# Performance parameters used to invoke various optimisations
171#------------------------------------------------------------
172
173use_extensions = True # Use C-extensions
174use_psyco = True # Use psyco optimisations
175
176optimise_dry_cells = True # Exclude dry and still cells from flux computation
177optimised_gradient_limiter = True # Use hardwired gradient limiter
178use_edge_limiter = False # The edge limiter is better, but most runs have been using vertex limiting
179
180points_file_block_line_size = 500 # Number of lines read in from a points file
181                                  # when blocking
182
183
184
185
186
187
188   
Note: See TracBrowser for help on using the repository browser.