Changeset 8238
- Timestamp:
- Oct 25, 2011, 8:50:12 PM (14 years ago)
- 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 69 69 N = 100 70 70 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) 72 72 73 73 domain.set_spatial_order(2) -
trunk/anuga_work/development/2010-projects/anuga_1d/sqpipe/sqpipe.h
r8236 r8238 8 8 double g; 9 9 double h0; 10 double bulk_modulus; 10 11 }; 11 12 … … 102 103 103 104 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); 105 106 106 107 return quantityflux; … … 115 116 116 117 double sqpipe_quantity_pressurised_sound_speed (struct quantity *q, struct params *p) { 117 return 1.0;118 return ((struct sqpipe_params *)p)->bulk_modulus; 118 119 } 119 120 … … 286 287 287 288 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))); 289 290 290 291 return cellforce; -
trunk/anuga_work/development/2010-projects/anuga_1d/sqpipe/sqpipe_domain.py
r8236 r8238 50 50 class Sqpipe_domain(Generic_domain): 51 51 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): 53 53 54 54 evolved_quantities = ['area', 'discharge', 'elevation', 'height', 'velocity','width','top','stage'] … … 61 61 other_quantities = other_quantities, 62 62 tagged_elements = tagged_elements) 63 64 self.bulk_modulus = bulk_modulus 63 65 64 66 # Allocate space for tracking state (if not provided) -
trunk/anuga_work/development/2010-projects/anuga_1d/sqpipe/sqpipe_python.h
r8237 r8238 19 19 sp->g = get_python_double(domain,"g"); 20 20 sp->h0 = get_python_double(domain,"h0"); 21 sp->bulk_modulus = get_python_double(domain, "bulk_modulus"); 21 22 22 23 return sD; -
trunk/anuga_work/development/2010-projects/anuga_1d/sqpipe/sqpipe_test_domain.py
r8236 r8238 6 6 class Domain(Sqpipe_domain): 7 7 8 def __init__(self, coordinates, boundary = None, tagged_elements = None ):8 def __init__(self, coordinates, boundary = None, tagged_elements = None, bulk_modulus = 1.0): 9 9 conserved_quantities = ['area', 'discharge'] 10 10 forcing_terms = [] … … 16 16 boundary = boundary, 17 17 state = state, 18 bulk_modulus = bulk_modulus, 18 19 # update_state = False, 19 20 tagged_elements = tagged_elements) 21 20 22 21 23 self.__doc__ = 'sqpipe_area_discharge_domain'
Note: See TracChangeset
for help on using the changeset viewer.