Changeset 8238


Ignore:
Timestamp:
Oct 25, 2011, 8:50:12 PM (14 years ago)
Author:
paul
Message:

Bulk modulus of fluid now in use for 1d domains

Location:
trunk/anuga_work/development/2010-projects/anuga_1d/sqpipe
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_work/development/2010-projects/anuga_1d/sqpipe/parabolic_canal.py

    r8236 r8238  
    6969    N = 100
    7070    print "Evaluating domain with %d cells" %N
    71     domain = dom.Domain(*uniform_mesh(N, x_0 = -2.0*L_x, x_1 = 2.0*L_x))
     71    domain = dom.Domain(*uniform_mesh(N, x_0 = -2.0*L_x, x_1 = 2.0*L_x), bulk_modulus = 75.0)
    7272
    7373    domain.set_spatial_order(2)
  • trunk/anuga_work/development/2010-projects/anuga_1d/sqpipe/sqpipe.h

    r8236 r8238  
    88  double g;
    99  double h0;
     10  double bulk_modulus;
    1011};
    1112
     
    102103 
    103104  quantityflux[0] = (normal * pq->u) * pq->a;
    104   quantityflux[1] = normal * (pq->u * pq->d + (pq->h - pq->t) + 0.5 * sp->g * pq->t * pq->t);
     105  quantityflux[1] = normal * (pq->u * pq->d + sp->bulk_modulus*(pq->h - pq->t) + 0.5 * sp->g * pq->t * pq->t);
    105106
    106107  return quantityflux;
     
    115116
    116117double sqpipe_quantity_pressurised_sound_speed (struct quantity *q, struct params *p) {
    117   return 1.0;
     118  return ((struct sqpipe_params *)p)->bulk_modulus;
    118119}
    119120
     
    286287
    287288  cellforce[0] = 0.0;
    288   cellforce[1] = sp->g * (0.5*(qout->h + qin->h) - 0.5*(qout->t + qin->t)) * (qout->b - qin->b) + sp->g * (0.5*(qout->h + qin->h) - 0.5*(qout->t + qin->t)) * 0.5*(qout->b + qin->b) * (qout->t - qin->t) * 1/(0.5*(qout->t + qin->t));
     289  cellforce[1] = sp->bulk_modulus * (sp->g * (0.5*(qout->h + qin->h) - 0.5*(qout->t + qin->t)) * (qout->b - qin->b) + sp->g * (0.5*(qout->h + qin->h) - 0.5*(qout->t + qin->t)) * 0.5*(qout->b + qin->b) * (qout->t - qin->t) * 1/(0.5*(qout->t + qin->t)));
    289290
    290291  return cellforce;
  • trunk/anuga_work/development/2010-projects/anuga_1d/sqpipe/sqpipe_domain.py

    r8236 r8238  
    5050class Sqpipe_domain(Generic_domain):
    5151
    52     def __init__(self, coordinates, conserved_quantities, forcing_terms = [], boundary = None, state = None, update_state = True, tagged_elements = None):
     52    def __init__(self, coordinates, conserved_quantities, forcing_terms = [], boundary = None, state = None, update_state = True, bulk_modulus = 1.0, tagged_elements = None):
    5353
    5454        evolved_quantities = ['area', 'discharge', 'elevation', 'height', 'velocity','width','top','stage']
     
    6161                                other_quantities     = other_quantities,
    6262                                tagged_elements      = tagged_elements)
     63
     64        self.bulk_modulus = bulk_modulus
    6365
    6466        # Allocate space for tracking state (if not provided)
  • trunk/anuga_work/development/2010-projects/anuga_1d/sqpipe/sqpipe_python.h

    r8237 r8238  
    1919  sp->g = get_python_double(domain,"g");
    2020  sp->h0 = get_python_double(domain,"h0");
     21  sp->bulk_modulus = get_python_double(domain, "bulk_modulus");
    2122
    2223  return sD;
  • trunk/anuga_work/development/2010-projects/anuga_1d/sqpipe/sqpipe_test_domain.py

    r8236 r8238  
    66class Domain(Sqpipe_domain):
    77
    8     def __init__(self, coordinates, boundary = None, tagged_elements = None):
     8    def __init__(self, coordinates, boundary = None, tagged_elements = None, bulk_modulus = 1.0):
    99        conserved_quantities = ['area', 'discharge']
    1010        forcing_terms = []
     
    1616                               boundary             = boundary,
    1717                               state                = state,
     18                               bulk_modulus         = bulk_modulus,
    1819        #                       update_state         = False,
    1920                               tagged_elements      = tagged_elements)
     21
    2022
    2123        self.__doc__ = 'sqpipe_area_discharge_domain'
Note: See TracChangeset for help on using the changeset viewer.