Changeset 8862


Ignore:
Timestamp:
May 9, 2013, 6:22:19 PM (12 years ago)
Author:
steve
Message:

Code to run a pipe

Location:
trunk/anuga_work/development/2010-projects/anuga_1d/sqpipe
Files:
2 added
3 edited
1 moved

Legend:

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

    r8275 r8862  
    66from anuga_1d.config import g, epsilon
    77from anuga_1d.base.generic_mesh import uniform_mesh
     8import anuga_1d.sqpipe.sqpipe_domain as dom
    89
    910#===============================================================================
     
    6667#===============================================================================
    6768
    68 def get_domain(dom):
     69def get_domain():
    6970    N = 100
    7071    print "Evaluating domain with %d cells" %N
     72   
    7173    domain = dom.Domain(*uniform_mesh(N, x_0 = -2.0*L_x, x_1 = 2.0*L_x), bulk_modulus = 100.0)
    7274
     
    99101
    100102    for t in domain.evolve(yieldstep = yieldstep, finaltime = finaltime):
     103
     104        domain.write_time()
    101105        x, z, w, h, v, t, s, m, M = get_quantities(domain)
    102106       
  • trunk/anuga_work/development/2010-projects/anuga_1d/sqpipe/run_parabolic_canal.py

    r8850 r8862  
    1 import anuga_1d.sqpipe.parabolic_canal
     1
    22import time
    3 import anuga_1d.sqpipe.sqpipe_domain as dom
    43
    54
    6 domain = anuga_1d.sqpipe.parabolic_canal.get_domain(dom)
     5import parabolic_canal as model
     6
     7domain = model.get_domain()
    78finaltime = 1000.0
    89yieldstep = 10.0
    9 #m0 = (domain.get_mass()).sum()
    10 #for t in domain.evolve(yieldstep = yieldstep, finaltime = finaltime):
    11 #       m = (domain.get_mass()).sum()
    12 #       if abs(m - m0) > 0.5:
    13 #               print m0 - m
    14 #               
    15 #       m0 = m
    16        
    17 #outfile="out"
    18 #anuga_1d.sqpipe.parabolic_canal.write_domain(domain, outfile)
    1910
    20 anuga_1d.sqpipe.parabolic_canal.animate_domain(domain, yieldstep, finaltime)
     11
     12model.animate_domain(domain, yieldstep, finaltime)
    2113print "finished"
    22 anuga_1d.sqpipe.parabolic_canal.plot_domain(domain)
     14model.plot_domain(domain)
  • trunk/anuga_work/development/2010-projects/anuga_1d/sqpipe/sqpipe.h

    r8274 r8862  
    133133  struct sqpipe_params *sp = (struct sqpipe_params *) p;
    134134
    135   quantityflux[0] = (normal * pq->u) * quantity_get_conserved(q, 0, normal);
    136   quantityflux[1] = normal * (pq->u * quantity_get_conserved(q, 1, normal) + 0.5 * sp->g * pq->h *pq->h);
     135  //quantityflux[0] = (normal * pq->u) * quantity_get_conserved(q, 0, normal);
     136  //quantityflux[1] = normal * (pq->u * quantity_get_conserved(q, 1, normal) + 0.5 * sp->g * pq->h *pq->h);
     137  quantityflux[0] = (normal * pq->u) * pq->a;
     138  quantityflux[1] = normal * (pq->u * pq->d + 0.5 * sp->g * pq->h *pq->h);
    137139
    138140  return quantityflux;
  • trunk/anuga_work/development/2010-projects/anuga_1d/sqpipe/sqpipe_domain.py

    r8274 r8862  
    152152        # Import flux method and call it
    153153        from anuga_1d.sqpipe.sqpipe_comp_flux import compute_fluxes_ext
    154         self.flux_timestep = compute_fluxes_ext(timestep,self)       
     154
     155        self.flux_timestep = compute_fluxes_ext(timestep,self)
    155156
    156157    def update_state(self):
Note: See TracChangeset for help on using the changeset viewer.