/[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 2855 by gross, Tue Dec 1 06:10:10 2009 UTC revision 2856 by gross, Mon Jan 18 04:14:37 2010 UTC
# Line 37  H=1.                            # height Line 37  H=1.                            # height
37  L=H                           # length  L=H                           # length
38  NE=40                           # number of elements in H-direction.  NE=40                           # number of elements in H-direction.
39  PERT=0.05               # initial temperature perturbation  PERT=0.05               # initial temperature perturbation
40  DT=1.e-7                        # 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 56  BETA=0                          # Drucke Line 56  BETA=0                          # Drucke
56  TAU_0=2*10**(2.5)               # transition stress  TAU_0=2*10**(2.5)               # transition stress
57  N=3                             # power for power law  N=3                             # power for power law
58    
59  E=23*0                        # activation energy  E=23                        # activation energy
60  V=18*0                        # activation volume  V=18*0                        # activation volume
61  T_OFFSET=1                      # temperature offset on surface (dimensionless formulation T_OFFSET=1 otherwise =0)  T_OFFSET=1                      # temperature offset on surface (dimensionless formulation T_OFFSET=1 otherwise =0)
62  R=1                             # gas constant  R=1                             # gas constant
# Line 65  ETA_N0=1.                       # viscos Line 65  ETA_N0=1.                       # viscos
65  TOPO_SMOOTH=1e-5                # smoothing factor of extrapolation of surface velocity to interior  TOPO_SMOOTH=1e-5                # smoothing factor of extrapolation of surface velocity to interior
66    
67  T_TOL=1.e-4                     # tolerance temperature transport  T_TOL=1.e-4                     # tolerance temperature transport
68  TOL2=0.1                        # tolerance for flow update at a timestep. (large value will do only one correction step)  TOL2=0.1e-3                        # tolerance for flow update at a timestep. (large value will do only one correction step)
69  FLOW_TOL=1.e-6                  # tolerance for inconcompressible flow solver  FLOW_TOL=1.e-6                  # tolerance for inconcompressible flow solver
 FLOW_SUB_TOL=1.e-12             # sub-tolerance for inconcompressible flow solver  
70  TOPO_TOL=1.e-6                 # tolerance for update of topography  TOPO_TOL=1.e-6                 # tolerance for update of topography
71  DIAGNOSTICS_FN="diagnostics.csv"  DIAGNOSTICS_FN="diagnostics.csv"
72  VERBOSE=True  VERBOSE=True
# Line 140  print "\ttolerance for topography      T Line 139  print "\ttolerance for topography      T
139  print "\ttransport tolerance           T_TOL\t\t=\t",T_TOL  print "\ttransport tolerance           T_TOL\t\t=\t",T_TOL
140  print "\ttolerance for flow updates    TOL2\t\t=\t",TOL2  print "\ttolerance for flow updates    TOL2\t\t=\t",TOL2
141  print "\tflow tolerance                FLOW_TOL\t\t=\t",FLOW_TOL  print "\tflow tolerance                FLOW_TOL\t\t=\t",FLOW_TOL
 print "\tflow sub-tolerance            FLOW_SUB_TOL\t=\t",FLOW_SUB_TOL  
142  print "\tfile for diagnostics          DIAGNOSTICS_FN\t=\t",DIAGNOSTICS_FN  print "\tfile for diagnostics          DIAGNOSTICS_FN\t=\t",DIAGNOSTICS_FN
143  print "\tmin. time incr. for vis file  DT_VIS\t\t=\t",DT_VIS  print "\tmin. time incr. for vis file  DT_VIS\t\t=\t",DT_VIS
144  print "\tmin. count incr. for vis file DN_VIS\t\t=\t",DN_VIS  print "\tmin. count incr. for vis file DN_VIS\t\t=\t",DN_VIS
# Line 299  flow.setDruckerPragerLaw(tau_Y=TAU_Y/P_R Line 297  flow.setDruckerPragerLaw(tau_Y=TAU_Y/P_R
297    
298  flow.setElasticShearModulus(MUE)  flow.setElasticShearModulus(MUE)
299  flow.setTolerance(TOL2)  flow.setTolerance(TOL2)
 flow.setFlowTolerance(FLOW_TOL)  
300  flow.setEtaTolerance(FLOW_TOL)  flow.setEtaTolerance(FLOW_TOL)
301  flow.setExternals(fixed_v_mask=fixed_v_mask)  flow.setExternals(fixed_v_mask=fixed_v_mask)
302  print "<%s> Flow solver has been set up."%time.asctime()  print "<%s> Flow solver has been set up."%time.asctime()
# Line 319  if CREATE_TOPOGRAPHY: Line 316  if CREATE_TOPOGRAPHY:
316  t1 = time.time()  t1 = time.time()
317  print "<%s> Start time step %s (t=%s)."%(time.asctime(),n,t)  print "<%s> Start time step %s (t=%s)."%(time.asctime(),n,t)
318  while t<T_END:  while t<T_END:
319      topography_old=topography      if CREATE_TOPOGRAPHY: topography_old=topography
320      v_old, p_old, stress_old=v, p, stress      v_old, p_old, stress_old=v, p, stress
321      T_old=T      T_old=T
322      #======= solve for velovity ====================================================================      #======= solve for velovity ====================================================================
# Line 329  while t<T_END: Line 326  while t<T_END:
326      flow.setExternals(F=Ra*T*unitVector(DIM-1,DIM))      flow.setExternals(F=Ra*T*unitVector(DIM-1,DIM))
327      # if dt<=0 or not CREATE_TOPOGRAPHY:      # if dt<=0 or not CREATE_TOPOGRAPHY:
328      if not CREATE_TOPOGRAPHY:      if not CREATE_TOPOGRAPHY:
329              flow.setExternals(f=-SURFACE_LOAD*topography*unitVector(DIM-1,DIM))              flow.update(dt, iter_max=100, verbose=False)
             flow.update(dt, iter_max=100, inner_iter_max=200, verbose=False)  
330      else:      else:
331          topography_last=topography          topography_last=topography
332          Topo_norm, error_Topo=1,1          Topo_norm, error_Topo=1,1

Legend:
Removed from v.2855  
changed lines
  Added in v.2856

  ViewVC Help
Powered by ViewVC 1.1.26