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

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

Moved culvert routines into own area

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