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

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

Cleanup of config and comments

File size: 6.0 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# 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.
107
108# protect_against_isolated_degenerate_timesteps = False
109protect_against_isolated_degenerate_timesteps = False
110
111
112min_timestep = 1.0e-6 # Minimal timestep accepted in ANUGA
113max_timestep = 1.0e+3
114max_smallsteps = 50  # Max number of degenerate steps allowed b4 trying first order
115
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
136
137
138#---------------------------------------------------
139# Ranges specific to the shallow water wave equation
140# These control maximal and minimal values of
141# quantities
142#---------------------------------------------------
143
144# Water depth below which it is considered to be 0 in the model
145minimum_allowed_height = 1.0e-3 
146
147# Water depth below which it is *stored* as 0
148minimum_storable_height = 1.0e-5
149
150# FIXME (Ole): Redefine this parameter to control maximal speeds in general
151# and associate it with protect_against_isolated_degenerate_timesteps = True
152maximum_allowed_speed = 0.0 # Maximal particle speed of water
153#maximum_allowed_speed = 1.0 # Maximal particle speed of water
154                            # Too large (100) creates 'flopping' water
155                            # Too small (0) creates 'creep'
156                           
157maximum_froude_number = 100.0 # To be used in limiters.
158
159
160#------------------------------------------------------------
161# Performance parameters used to invoke various optimisations
162#------------------------------------------------------------
163
164use_extensions = True # Use C-extensions
165use_psyco = True # Use psyco optimisations
166
167optimise_dry_cells = True # Exclude dry and still cells from flux computation
168optimised_gradient_limiter = True # Use hardwired gradient limiter
169
170points_file_block_line_size = 500 # Number of lines read in from a points file
171                                  # when blocking
172
173
174
175
176
177
178   
Note: See TracBrowser for help on using the repository browser.