/[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 2861 by gross, Mon Jan 18 07:44:42 2010 UTC revision 2862 by gross, Thu Jan 21 04:45:39 2010 UTC
# Line 34  import time Line 34  import time
34  # ======================= Default Values ==================================================  # ======================= Default Values ==================================================
35  DIM=2                           # spatial dimension  DIM=2                           # spatial dimension
36  H=1.                            # height  H=1.                            # height
37  L=H                           # length  L=2*H                           # length
38  NE=40                           # number of elements in H-direction.  NE=30                           # number of elements in H-direction.
39  PERT=0.05               # 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=False         # create topgraphy  CREATE_TOPOGRAPHY=True         # 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                        # activation energy  E=23*0                      # 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.1e-3                        # tolerance for flow update at a timestep. (large value will do only one correction step)  FLOW_TOL=1.e-3                  # tolerance for inconcompressible flow solver
69  FLOW_TOL=1.e-6                  # tolerance for inconcompressible flow solver  TOPO_TOL=0.1                 # tolerance for update of topography
 TOPO_TOL=1.e-6                 # tolerance for update of topography  
70  DIAGNOSTICS_FN="diagnostics.csv"  DIAGNOSTICS_FN="diagnostics.csv"
71  VERBOSE=True  VERBOSE=True
72  DT_VIS=T_END/500                # time distane between two visulaization files  DT_VIS=T_END/500                # time distane between two visulaization files
# Line 137  print "\ttopography smoothing          T Line 136  print "\ttopography smoothing          T
136    
137  print "\ttolerance for topography      TOPO_TOL\t\t=\t",TOPO_TOL  print "\ttolerance for topography      TOPO_TOL\t\t=\t",TOPO_TOL
138  print "\ttransport tolerance           T_TOL\t\t=\t",T_TOL  print "\ttransport tolerance           T_TOL\t\t=\t",T_TOL
 print "\ttolerance for flow updates    TOL2\t\t=\t",TOL2  
139  print "\tflow tolerance                FLOW_TOL\t\t=\t",FLOW_TOL  print "\tflow tolerance                FLOW_TOL\t\t=\t",FLOW_TOL
140  print "\tfile for diagnostics          DIAGNOSTICS_FN\t=\t",DIAGNOSTICS_FN  print "\tfile for diagnostics          DIAGNOSTICS_FN\t=\t",DIAGNOSTICS_FN
141  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
# Line 295  flow=IncompressibleIsotropicFlowCartesia Line 293  flow=IncompressibleIsotropicFlowCartesia
293  flow.setDruckerPragerLaw(tau_Y=TAU_Y/P_REF+BETA*(1.-Function(dom).getX()[DIM-1]))  flow.setDruckerPragerLaw(tau_Y=TAU_Y/P_REF+BETA*(1.-Function(dom).getX()[DIM-1]))
294    
295  flow.setElasticShearModulus(MUE)  flow.setElasticShearModulus(MUE)
296  flow.setTolerance(TOL2)  flow.setTolerance(FLOW_TOL)
297  flow.setEtaTolerance(FLOW_TOL)  flow.setEtaTolerance(FLOW_TOL)
298  flow.setExternals(fixed_v_mask=fixed_v_mask)  flow.setExternals(fixed_v_mask=fixed_v_mask)
299  print "<%s> Flow solver has been set up."%time.asctime()  print "<%s> Flow solver has been set up."%time.asctime()
# Line 334  while t<T_END: Line 332  while t<T_END:
332          while error_Topo > TOPO_TOL * Topo_norm:          while error_Topo > TOPO_TOL * Topo_norm:
333              flow.setStatus(t, v_old, p_old, stress_old)              flow.setStatus(t, v_old, p_old, stress_old)
334              flow.setExternals(f=-SURFACE_LOAD*(topography-dt*v)*unitVector(DIM-1,DIM)*top_boundary_mask, restoration_factor=SURFACE_LOAD*dt*top_boundary_mask)              flow.setExternals(f=-SURFACE_LOAD*(topography-dt*v)*unitVector(DIM-1,DIM)*top_boundary_mask, restoration_factor=SURFACE_LOAD*dt*top_boundary_mask)
335              flow.update(dt, iter_max=100, inner_iter_max=200, verbose=False)              flow.update(dt, iter_max=100, verbose=False)
336              v=flow.getVelocity()              v=flow.getVelocity()
337              mts.setTopography(topography_old)              mts.setTopography(topography_old)
338              mts.setVelocity(v)              mts.setVelocity(v)

Legend:
Removed from v.2861  
changed lines
  Added in v.2862

  ViewVC Help
Powered by ViewVC 1.1.26