/[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

trunk/esys2/modellib/py_src/materials.py revision 148 by jgs, Tue Aug 23 01:24:31 2005 UTC trunk/modellib/py_src/materials.py revision 155 by jgs, Wed Nov 9 02:02:19 2005 UTC
# Line 1  Line 1 
1  # $Id$  # $Id$
2    
3  from escript.modelframe import Model,ParameterSet  from esys.escript.modelframe import Model,ParameterSet
4  from escript.util import exp  from esys.escript.util import exp
5  import numarray  import numarray
6    
7  class GravityForce(ParameterSet):  class GravityForce(ParameterSet):
8         """@brief sets a gravity force of given direction in given domain:         """
9           Sets a gravity force of given direction in given domain:
               @param domain (in) - domain of interest  
               @param density (in) - density  
               @param direction (in) - density  
               @param gravity_force(out)  - gravity force  
10    
11           @ivar domain (in): domain of interest
12           @ivar density (in): density
13           @ivar direction (in): density
14           @ivar gravity_force(out): gravity force
15         """         """
16         def __init__(self,debug=False):         def __init__(self,debug=False):
17             ParameterSet.__init__(self,debug=debug)             ParameterSet.__init__(self,debug=debug)
# Line 30  class GravityForce(ParameterSet): Line 30  class GravityForce(ParameterSet):
30    
31            
32  class MaterialTable(ParameterSet):  class MaterialTable(ParameterSet):
33         """@brief a simple matrial table which allows setting physical parameters of a model         """
34           A simple matrial table which allows setting physical ivar of a model
               @param density (in/out) - density  
               @param heat_capacity (in/out)  - heat_capacity  
               @param thermal_permabilty (in/out) - permabilty  
               @param viscosity (in/out)  - viscosity  
               @param radiation_coefficient (in/out) -  
35    
36           @ivar density (in/out): density
37           @ivar heat_capacity (in/out):  heat_capacity
38           @ivar thermal_permabilty (in/out): permabilty
39           @ivar viscosity (in/out): viscosity
40           @ivar radiation_coefficient (in/out):
41         """         """
42         def __init__(self,debug=False):         def __init__(self,debug=False):
43             ParameterSet.__init__(self,debug=debug)             ParameterSet.__init__(self,debug=debug)
# Line 48  class MaterialTable(ParameterSet): Line 48  class MaterialTable(ParameterSet):
48                                   radiation_coefficient=0.)                                   radiation_coefficient=0.)
49    
50  class SimpleEarthModel(ParameterSet):  class SimpleEarthModel(ParameterSet):
51         """@brief a simple matrial table run convection models:         """
52           B simple matrial table run convection models::
               density=density0*(1-rayleigh_number*(temperature-reference_temperature))  
               viscocity=viscocity0*(exp(alpha*(1/reference_temperature - 1/temperature))  
53    
54                @param gravity  (in) - gravity constants (9.81)             density=density0*(1-rayleigh_number*(temperature-reference_temperature))
55                @param reference_temperature  (in) - reference temperature             viscocity=viscocity0*(exp(alpha*(1/reference_temperature - 1/temperature))
               @param density0  (in) - density at reference temperature  
               @param viscosity0  (in) - viscosity0 at reference temperature  
               @param alpha  (in) - viscosity contrast  
               @param rayleigh_number (in)  - Raleigh number  
               @param heat_capacity (in)  - heat capacity  
               @param thermal_permabilty (in) - permabilty  
               @param temperature (in) - temperature  
               @param viscosity (out)  - viscosity  
               @param density (out)  - density  
56    
57           @ivar gravity (in): gravity constants (9.81)
58           @ivar reference_temperature (in): reference temperature
59           @ivar density0 (in): density at reference temperature
60           @ivar viscosity0 (in): viscosity0 at reference temperature
61           @ivar alpha (in): viscosity contrast
62           @ivar rayleigh_number (in): Raleigh number
63           @ivar heat_capacity (in): heat capacity
64           @ivar thermal_permabilty (in): permabilty
65           @ivar temperature (in): temperature
66           @ivar viscosity (out): viscosity
67           @ivar density (out): density
68         """         """
69         def __init__(self,debug=False):         def __init__(self,debug=False):
70             ParameterSet.__init__(self,debug=debug)             ParameterSet.__init__(self,debug=debug)
# Line 84  class SimpleEarthModel(ParameterSet): Line 84  class SimpleEarthModel(ParameterSet):
84             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)))
85    
86  class SimpleSolidMaterial(MaterialTable):  class SimpleSolidMaterial(MaterialTable):
87         """@brief a simple matrial table which allows setting physical parameters of a model         """
88           A simple matrial table which allows setting physical parameters of
89                @param density (in/out) - density         a model.
               @param heat_capacity (in/out)  - heat_capacity  
               @param thermal_permabilty (in/out) - permabilty  
               @param viscosity (in/out)  - viscosity  
               @param radiation_coefficient (in/out) -  
90    
91           @ivar density (in/out): density
92           @ivar heat_capacity (in/out): heat_capacity
93           @ivar thermal_permabilty (in/out): permabilty
94           @ivar viscosity (in/out): viscosity
95           @ivar radiation_coefficient (in/out):
96         """         """
97         def __init__(self,debug=False):         def __init__(self,debug=False):
98             MaterialTable.__init__(self,debug=debug)             MaterialTable.__init__(self,debug=debug)
# Line 99  class SimpleSolidMaterial(MaterialTable) Line 100  class SimpleSolidMaterial(MaterialTable)
100                                   lame_my=1.)                                   lame_my=1.)
101    
102  class SimpleFluidMaterial(MaterialTable):  class SimpleFluidMaterial(MaterialTable):
103         """@brief a simple matrial table which allows setting physical parameters of a model         """
104           A simple matrial table which allows setting physical ivar of a model.
               @param density (in/out) - density  
               @param heat_capacity (in/out)  - heat_capacity  
               @param thermal_permabilty (in/out) - permabilty  
               @param viscosity (in/out)  - viscosity  
               @param radiation_coefficient (in/out) -  
105    
106           @ivar density (in/out): density
107           @ivar heat_capacity (in/out): heat_capacity
108           @ivar thermal_permabilty (in/out): permabilty
109           @ivar viscosity (in/out): viscosity
110           @ivar radiation_coefficient (in/out):
111         """         """
112         def __init__(self,debug=False):         def __init__(self,debug=False):
113             MaterialTable.__init__(self,debug=debug)             MaterialTable.__init__(self,debug=debug)
114             self.declareParameter(viscosity=1., \             self.declareParameter(viscosity=1., \
115                                   hydraulic_conductivity=1.e-4)                                   hydraulic_conductivity=1.e-4)
116    
117    # vim: expandtab shiftwidth=4:

Legend:
Removed from v.148  
changed lines
  Added in v.155

  ViewVC Help
Powered by ViewVC 1.1.26