/[escript]/trunk/finley/test/python/convection.py
ViewVC logotype

Diff of /trunk/finley/test/python/convection.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2866 by gross, Thu Jan 21 04:45:39 2010 UTC revision 2867 by gross, Fri Jan 22 06:28:02 2010 UTC
# Line 38  L=2*H                           # length Line 38  L=2*H                           # length
38  NE=30                           # number of elements in H-direction.  NE=30                           # number of elements in H-direction.
39  PERT=0.15               # initial temperature perturbation  PERT=0.15               # initial temperature perturbation
40  DT=1.e-4                        # initial time step size  DT=1.e-4                        # initial time step size
41  CREATE_TOPOGRAPHY=True         # create topgraphy  CREATE_TOPOGRAPHY=False         # create topgraphy
42  DT_MIN=1.e-10                    # minumum time step size  DT_MIN=1.e-10                    # minumum time step size
43  T_END=10.                       # end time  T_END=10.                       # end time
44    
# Line 347  while t<T_END: Line 347  while t<T_END:
347      v=flow.getVelocity()      v=flow.getVelocity()
348      for d in range(DIM):      for d in range(DIM):
349           print "range %d-velocity"%d,inf(v[d]),sup(v[d])           print "range %d-velocity"%d,inf(v[d]),sup(v[d])
350        print "Courant = ",inf(dom.getSize()/(length(v)+1e-19)), inf(dom.getSize()**2)
351      print "<%s> flow solver completed."%time.asctime()      print "<%s> flow solver completed."%time.asctime()
352      n+=1      n+=1
353      t+=dt      t+=dt
354      print "influx= ",integrate(inner(v,dom.getNormal())), sqrt(integrate(length(v)**2,FunctionOnBoundary(dom))), integrate(1., FunctionOnBoundary(dom))      # print "influx= ",integrate(inner(v,dom.getNormal())), sqrt(integrate(length(v)**2,FunctionOnBoundary(dom))), integrate(1., FunctionOnBoundary(dom))
355      print "<%s> Time step %s (t=%s) completed."%(time.asctime(),n,t)      print "<%s> Time step %s (t=%s) completed."%(time.asctime(),n,t)
356      #======= setup Temperature problem ====================================================================      #======= setup Temperature problem ====================================================================
357      #      #
358      heat.setValue(v=v,Q=CHI_REF*flow.getTau()**2/flow.getCurrentEtaEff())      heat.setValue(v=v,Q=CHI_REF*flow.getTau()**2/flow.getCurrentEtaEff())
359      dt=heat.getSafeTimeStepSize()      dt=heat.getSafeTimeStepSize()
360      print "<%s> New time step size is %e"%(time.asctime(),dt)      print "<%s> New time step size is %e"%(time.asctime(),dt)
361        if n == 10: 1/0
362      #======= set-up topography ==================================================================================      #======= set-up topography ==================================================================================
363      if CREATE_TOPOGRAPHY:      if CREATE_TOPOGRAPHY:
364          dt=min(mts.getSafeTimeStepSize()*0.5,dt)          dt=min(mts.getSafeTimeStepSize()*0.5,dt)

Legend:
Removed from v.2866  
changed lines
  Added in v.2867

  ViewVC Help
Powered by ViewVC 1.1.26