Changeset 3876


Ignore:
Timestamp:
Oct 26, 2006, 5:31:27 PM (16 years ago)
Author:
steve
Message:

Added parameter alpha_balance to config.py to deal with large jumps in bed

Location:
anuga_core/source
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/abstract_2d_finite_volumes/realtime_visualisation_new.py

    r3737 r3876  
    210210
    211211        #print 'update bed image'
    212         if qname=='elevation':
    213             self.pos[:,2] = self.pos[:,2]+1.0e-2
     212        if qname=='stage':
     213            self.pos[:,2] = self.pos[:,2] - self.domain.visualise_wet_dry_cutoff
    214214
    215215        self.vpython_z_models[qname].pos    = self.pos
  • anuga_core/source/anuga/config.py

    r3819 r3876  
    8181beta_h      = 0.2
    8282
     83alpha_balance = 2.0
    8384
    8485CFL = 1.0  #FIXME (ole): Is this in use yet??
  • anuga_core/source/anuga/examples/island.py

    r3719 r3876  
    3636                          filename = 'island.msh' ,
    3737                          interior_regions=[ ([[50,25], [70,25], [70,75], [50,75]], 1.0)]
    38                           #interior_holes=[[50,25], [70,25], [70,75], [50,75]],
     38                          #interior_holes=[[[50,25], [70,25], [70,75], [50,75]]],
    3939                          )
    4040
     
    4545domain.smooth = False
    4646domain.set_name('island')
    47 domain.set_default_order(2)
     47domain.default_order = 2
    4848
    4949
     
    5555# beta_h == 0.0 means that constant (1st order) gradients are introduced
    5656# on h. This is equivalent to the constant depth used previously.
    57 domain.beta_h     = 0.2
    58 domain.beta_w_dry = 0.2
    59 
     57domain.beta_h     = 0.5
     58domain.beta_w_dry = 0.0
     59domain.alpha_balance = 10.0
     60domain.minimum_allowed_height = 1.0e-4
     61domain.maximum_allowed_speed = 100.0
     62domain.minimum_storable_height = 1.0e-4
     63domain.visualise_wet_dry_cutoff = 5.0e-2
    6064
    6165#------------------------------------------------------------------------------
     
    6670    z = 0*x
    6771    for i in range(len(x)):
    68         z[i] = 8*exp( -((x[i]-50)**2 + (y[i]-50)**2)/100 )
     72        z[i] = 20*exp( -((x[i]-50)**2 + (y[i]-50)**2)/100 )
    6973
    7074        #z[i] += 0.5*exp( -((x[i]-10)**2 + (y[i]-10)**2)/50 )
     
    7983    return z
    8084
     85stage_value = 15.0
    8186#domain.set_quantity('friction', 0.1)  #Honky dory
    82 domain.set_quantity('friction', 100.0)     #Creep
     87domain.set_quantity('friction', 0.01)     #Creep
    8388domain.set_quantity('elevation', island)
    84 domain.set_quantity('stage', 1)
     89domain.set_quantity('stage', stage_value)
    8590domain.max_timestep = 0.01
    8691
     
    9196
    9297Br = Reflective_boundary(domain)
    93 Bd = Dirichlet_boundary([1, 0, 0])
     98Bd = Dirichlet_boundary([stage_value, 0, 0])
    9499
    95 domain.set_boundary({'left': Bd, 'right': Bd, 'top': Bd, 'bottom': Bd})
     100domain.set_boundary({'left': Bd, 'right': Bd, 'top': Bd, 'bottom': Bd, 'exterior': Br})
    96101domain.check_integrity()
    97102
  • anuga_core/source/anuga/examples/netherlands.py

    r3846 r3876  
    8383N = 130 #size = 33800
    8484N = 600 #Size = 720000
    85 N = 50
     85N = 40
     86
    8687
    8788
     
    105106domain.beta_vh     = 1.0
    106107domain.beta_vh_dry = 0.2
     108
     109domain.alpha_balance = 10.0
    107110
    108111#Output params
     
    139142    vis.updating['stage'] = True
    140143    vis.qcolor['stage'] = (0.0,0.0,0.8)
    141     vis.coloring['stage']= True
     144    vis.coloring['stage']= False
    142145
    143146
  • anuga_core/source/anuga/shallow_water/shallow_water_domain.py

    r3848 r3876  
    9292from anuga.config import g, beta_h, beta_w, beta_w_dry,\
    9393     beta_uh, beta_uh_dry, beta_vh, beta_vh_dry
     94from anuga.config import alpha_balance
    9495
    9596
     
    143144        self.beta_vh_dry = beta_vh_dry
    144145        self.beta_h      = beta_h
     146        self.alpha_balance = alpha_balance
    145147
    146148        self.flux_function = flux_function_central
     
    12121214
    12131215    from shallow_water_ext import balance_deep_and_shallow
    1214     balance_deep_and_shallow(wc, zc, hc, wv, zv, hv, hvbar,
     1216    balance_deep_and_shallow(domain, wc, zc, hc, wv, zv, hv, hvbar,
    12151217                             xmomc, ymomc, xmomv, ymomv)
    12161218
  • anuga_core/source/anuga/shallow_water/shallow_water_ext.c

    r3789 r3876  
    423423                              double* ymomc,
    424424                              double* xmomv,
    425                               double* ymomv) {
     425                              double* ymomv,
     426                              double alpha_balance) {
    426427
    427428  int k, k3, i;
     
    463464      //else
    464465      //  alpha = max( min( hc[k]/dz, 1.0), 0.0 );
    465       alpha = max( min( 2.0*hmin/dz, 1.0), 0.0 );
     466      alpha = max( min( alpha_balance*hmin/dz, 1.0), 0.0 );
    466467    else
    467468      alpha = 1.0;  //Flat bed
     
    15691570    *xmomv,
    15701571    *ymomv;
     1572 
     1573  PyObject *domain, *Tmp;
     1574   
     1575  double alpha_balance = 2.0;
    15711576
    15721577  int N; //, err;
    15731578
    15741579  // Convert Python arguments to C
    1575   if (!PyArg_ParseTuple(args, "OOOOOOOOOOO",
     1580  if (!PyArg_ParseTuple(args, "OOOOOOOOOOOO",
     1581                        &domain,
    15761582                        &wc, &zc, &hc,
    15771583                        &wv, &zv, &hv, &hvbar,
     
    15811587  } 
    15821588         
     1589  // Pull out parameters
     1590  Tmp = PyObject_GetAttrString(domain, "alpha_balance");
     1591  if (!Tmp) {
     1592    PyErr_SetString(PyExc_RuntimeError, "shallow_water_ext.c: balance_deep_and_shallow could not obtain object alpha_balance from domain");
     1593    return NULL;
     1594  } 
     1595  alpha_balance = PyFloat_AsDouble(Tmp);
     1596  Py_DECREF(Tmp);
     1597
    15831598
    15841599  N = wc -> dimensions[0];
     
    15921607                            (double*) hv -> data,
    15931608                            (double*) hvbar -> data,
    1594                             (double*) xmomc -> data,
     1609                                (double*) xmomc -> data,
    15951610                            (double*) ymomc -> data,
    15961611                            (double*) xmomv -> data,
    1597                             (double*) ymomv -> data);
     1612                            (double*) ymomv -> data,
     1613                            alpha_balance);
    15981614
    15991615
  • anuga_core/source/anuga_parallel/run_parallel_sw_rectangle.py

    r3696 r3876  
    117117domain.beta_vh_dry = 0.2
    118118
    119 domain.beta_w      = 0.9
    120 domain.beta_w_dry  = 0.9
    121 domain.beta_uh     = 0.9
    122 domain.beta_uh_dry = 0.9
    123 domain.beta_vh     = 0.9
    124 domain.beta_vh_dry = 0.9
     119#domain.beta_w      = 0.9
     120#domain.beta_w_dry  = 0.9
     121#domain.beta_uh     = 0.9
     122#domain.beta_uh_dry = 0.9
     123#domain.beta_vh     = 0.9
     124#domain.beta_vh_dry = 0.9
    125125
    126126yieldstep = 0.005
Note: See TracChangeset for help on using the changeset viewer.