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

Last change on this file since 5421 was 5352, checked in by ole, 16 years ago

Moved default smoothing parameter from fit to config.
Removed print statements in data_manager.

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