/[escript]/trunk/modellib/py_src/materials.py
ViewVC logotype

Diff of /trunk/modellib/py_src/materials.py

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

revision 628 by elspeth, Thu Mar 23 02:27:57 2006 UTC revision 814 by gross, Wed Aug 23 09:31:10 2006 UTC
# Line 14  class GravityForce(ParameterSet): Line 14  class GravityForce(ParameterSet):
14         """         """
15         Sets a gravity force of given direction in given domain:         Sets a gravity force of given direction in given domain:
16    
17         @ivar domain (in): domain of interest         @ivar domain: domain of interest (in).
18         @ivar density (in): density         @type domain: L{esys.escript.Domain}
19         @ivar direction (in): density         @ivar density: density, default 1 (in).
20         @ivar gravity_force(out): gravity force         @ivar gravity: the gravity constant, default 9.81 (in).
21           @ivar direction: the direction of gravity, default [1.,0.,0.] (in).
22         """         """
23         def __init__(self,debug=False):         def __init__(self,debug=False):
24               """
25               initializes the set
26               """
27             ParameterSet.__init__(self,debug=debug)             ParameterSet.__init__(self,debug=debug)
28             self.declareParameter(domain=None,             self.declareParameter(domain=None,
29                                   gravity=9.81, \                                   gravity=9.81, \
# Line 27  class GravityForce(ParameterSet): Line 31  class GravityForce(ParameterSet):
31                                   direction=[1.,0.,0.])                                   direction=[1.,0.,0.])
32    
33         def gravity_force(self):         def gravity_force(self):
34              if isinstance(self.direction,list):             """
35               return the gravity force as L{density}*L{gravity}*L{direction}
36               """
37               if isinstance(self.direction,list):
38                 dir=numarray.array(self.direction[:self.domain.getDim()])                 dir=numarray.array(self.direction[:self.domain.getDim()])
39              else:             else:
40                 dir=self.direction[:self.domain.getDim()]                 dir=self.direction[:self.domain.getDim()]
41              return self.gravity*self.density*dir             return self.gravity*self.density*dir
42            
43    
44            
# Line 57  class SimpleEarthModel(ParameterSet): Line 64  class SimpleEarthModel(ParameterSet):
64         """         """
65         B simple matrial table run convection models::         B simple matrial table run convection models::
66    
67             density=density0*(1-rayleigh_number*(temperature-reference_temperature))             density=density0*(1-expansion_coefficient*(temperature-reference_temperature))
68             viscocity=viscocity0*(exp(alpha*(1/reference_temperature - 1/temperature))             viscocity=viscocity0*(exp(alpha*(1/reference_temperature - 1/temperature))
69    
70         @ivar gravity (in): gravity constants (9.81)         @ivar gravity (in): gravity constants (9.81)
# Line 65  class SimpleEarthModel(ParameterSet): Line 72  class SimpleEarthModel(ParameterSet):
72         @ivar density0 (in): density at reference temperature         @ivar density0 (in): density at reference temperature
73         @ivar viscosity0 (in): viscosity0 at reference temperature         @ivar viscosity0 (in): viscosity0 at reference temperature
74         @ivar alpha (in): viscosity contrast         @ivar alpha (in): viscosity contrast
75         @ivar rayleigh_number (in): Raleigh number         @ivar expansion_coefficient (in): Raleigh number
76         @ivar heat_capacity (in): heat capacity         @ivar heat_capacity (in): heat capacity
77         @ivar thermal_permabilty (in): permabilty         @ivar thermal_permabilty (in): permabilty
78         @ivar temperature (in): temperature         @ivar temperature (in): temperature
# Line 77  class SimpleEarthModel(ParameterSet): Line 84  class SimpleEarthModel(ParameterSet):
84             self.declareParameter(reference_temperature=1.,             self.declareParameter(reference_temperature=1.,
85                                   gravity=9.81, \                                   gravity=9.81, \
86                                   density0=1., \                                   density0=1., \
87                                   rayleigh_number=0., \                                   expansion_coefficient=0., \
88                                   viscosity0=1., \                                   viscosity0=1., \
89                                   alpha=0., \                                   alpha=0., \
90                                   heat_capacity=1., \                                   heat_capacity=1., \
91                                   thermal_permabilty=1.)                                   thermal_permabilty=1.)
92                
93         def density(self):         def density(self):
94             return self.density0*(1-self.rayleigh_number*(self.temperature-self.reference_temperature))             return self.density0*(1-self.expansion_coefficient*(self.temperature-self.reference_temperature))
95    
96         def viscosity(self):         def viscosity(self):
97             return self.viscosity0*exp(self.alpha*(1/self.reference_temperature - 1/(self.temperature+1.e-15)))             return self.viscosity0*exp(self.alpha*(1/self.reference_temperature - 1/(self.temperature+1.e-15)))

Legend:
Removed from v.628  
changed lines
  Added in v.814

  ViewVC Help
Powered by ViewVC 1.1.26