Changeset 3696


Ignore:
Timestamp:
Oct 4, 2006, 5:38:07 PM (18 years ago)
Author:
steve
Message:

Added run_sw_rectangle in examples to show improvement in dealing with wet/dry interface. Controlled by beta's for cell near interface

Location:
anuga_core/source
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/shallow_water/shallow_water_ext.c

    r3689 r3696  
    630630    *ymom_vertex_values,
    631631        *elevation_vertex_values;
    632   PyObject *domain, *Tmp_w, *Tmp_w_dry, *Tmp_uh, *Tmp_uh_dry, *Tmp_vh, *Tmp_vh_dry;
     632  PyObject *domain, *Tmp;
    633633  //Local variables
    634634  double a, b;//gradient vector, not stored but used to calculate vertex values from centroids
     
    639639  double hc, h0, h1, h2;
    640640  double beta_w, beta_w_dry, beta_uh, beta_uh_dry, beta_vh, beta_vh_dry, beta_tmp;
     641  double minimum_allowed_height;
    641642  //provisional jumps from centroids to v'tices and safety factor re limiting
    642643  //by which these jumps are limited
     
    661662
    662663  //get the safety factor beta_w, set in the config.py file. This is used in the limiting process
    663   Tmp_w = PyObject_GetAttrString(domain, "beta_w");
    664   if (!Tmp_w)
    665     return NULL;
    666   beta_w = PyFloat_AsDouble(Tmp_w);
    667   Py_DECREF(Tmp_w);
     664  Tmp = PyObject_GetAttrString(domain, "beta_w");
     665  if (!Tmp)
     666    return NULL;
     667  beta_w = PyFloat_AsDouble(Tmp);
     668  Py_DECREF(Tmp);
    668669 
    669   Tmp_w_dry = PyObject_GetAttrString(domain, "beta_w_dry");
    670   if (!Tmp_w_dry)
    671     return NULL;
    672   beta_w_dry = PyFloat_AsDouble(Tmp_w_dry);
    673   Py_DECREF(Tmp_w_dry);
     670  Tmp = PyObject_GetAttrString(domain, "beta_w_dry");
     671  if (!Tmp)
     672    return NULL;
     673  beta_w_dry = PyFloat_AsDouble(Tmp);
     674  Py_DECREF(Tmp);
    674675 
    675   Tmp_uh = PyObject_GetAttrString(domain, "beta_uh");
    676   if (!Tmp_uh)
    677     return NULL;
    678   beta_uh = PyFloat_AsDouble(Tmp_uh);
    679   Py_DECREF(Tmp_uh);
     676  Tmp = PyObject_GetAttrString(domain, "beta_uh");
     677  if (!Tmp)
     678    return NULL;
     679  beta_uh = PyFloat_AsDouble(Tmp);
     680  Py_DECREF(Tmp);
    680681 
    681   Tmp_uh_dry = PyObject_GetAttrString(domain, "beta_uh_dry");
    682   if (!Tmp_uh_dry)
    683     return NULL;
    684   beta_uh_dry = PyFloat_AsDouble(Tmp_uh_dry);
    685   Py_DECREF(Tmp_uh_dry);
    686 
    687   Tmp_vh = PyObject_GetAttrString(domain, "beta_vh");
    688   if (!Tmp_vh)
    689     return NULL;
    690   beta_vh = PyFloat_AsDouble(Tmp_vh);
    691   Py_DECREF(Tmp_vh);
     682  Tmp = PyObject_GetAttrString(domain, "beta_uh_dry");
     683  if (!Tmp)
     684    return NULL;
     685  beta_uh_dry = PyFloat_AsDouble(Tmp);
     686  Py_DECREF(Tmp);
     687
     688  Tmp = PyObject_GetAttrString(domain, "beta_vh");
     689  if (!Tmp)
     690    return NULL;
     691  beta_vh = PyFloat_AsDouble(Tmp);
     692  Py_DECREF(Tmp);
    692693 
    693   Tmp_vh_dry = PyObject_GetAttrString(domain, "beta_vh_dry");
    694   if (!Tmp_vh_dry)
    695     return NULL;
    696   beta_vh_dry = PyFloat_AsDouble(Tmp_vh_dry);
    697   Py_DECREF(Tmp_vh_dry);
     694  Tmp = PyObject_GetAttrString(domain, "beta_vh_dry");
     695  if (!Tmp)
     696    return NULL;
     697  beta_vh_dry = PyFloat_AsDouble(Tmp);
     698  Py_DECREF(Tmp);
     699 
     700  Tmp = PyObject_GetAttrString(domain, "minimum_allowed_height");
     701  if (!Tmp)
     702    return NULL;
     703  minimum_allowed_height = PyFloat_AsDouble(Tmp);
     704  Py_DECREF(Tmp); 
    698705 
    699706  number_of_elements = stage_centroid_values -> dimensions[0];
     
    779786          hmin = qmin;
    780787          beta_tmp = beta_w;
    781           if (hmin<0.001)
     788          if (hmin<minimum_allowed_height)
    782789                beta_tmp = beta_w_dry;
    783790      limit_gradient(dqv,qmin,qmax,beta_tmp);//the gradient will be limited
     
    804811      find_qmin_and_qmax(dq0,dq1,dq2,&qmin,&qmax);
    805812          beta_tmp = beta_uh;
    806           if (hmin<0.001)
     813          if (hmin<minimum_allowed_height)
    807814                beta_tmp = beta_uh_dry;
    808815      limit_gradient(dqv,qmin,qmax,beta_tmp);//the gradient will be limited
     
    829836      find_qmin_and_qmax(dq0,dq1,dq2,&qmin,&qmax);
    830837          beta_tmp = beta_vh;
    831           if (hmin<0.001)
     838          if (hmin<minimum_allowed_height)
    832839                beta_tmp = beta_vh_dry;
    833840      limit_gradient(dqv,qmin,qmax,beta_tmp);//the gradient will be limited
  • anuga_core/source/anuga_parallel/run_parallel_sw_rectangle.py

    r3678 r3696  
    117117domain.beta_vh_dry = 0.2
    118118
     119domain.beta_w      = 0.9
     120domain.beta_w_dry  = 0.9
     121domain.beta_uh     = 0.9
     122domain.beta_uh_dry = 0.9
     123domain.beta_vh     = 0.9
     124domain.beta_vh_dry = 0.9
     125
    119126yieldstep = 0.005
    120127finaltime = 1.0
Note: See TracChangeset for help on using the changeset viewer.