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

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

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

revision 147 by jgs, Fri Aug 12 01:45:47 2005 UTC revision 149 by jgs, Thu Sep 1 03:31:39 2005 UTC
# Line 1  Line 1 
1  # $Id$  # $Id$
2    
3  from escript.escript import *  from esys.escript.escript import *
4  from escript.modelframe import Model,IterationDivergenceError  from esys.escript.modelframe import Model,IterationDivergenceError
5  from escript.linearPDEs import AdvectivePDE,LinearPDE  from esys.escript.linearPDEs import AdvectivePDE,LinearPDE
6  import numarray  import numarray
7    
8    
9  class TemperatureAdvection(Model):  class TemperatureAdvection(Model):
10         """         """
11    
12           The conservation of internal heat energy is given by         The conservation of internal heat energy is given by
13    
14           \f[         M{S{rho} c_p ( dT/dt+v[j]*grad(T)[j])-grad(\kappa grad(T)_{,i}=Q}
              \rho c_p ( T_{,t}+v_{j}T_{,j} )-(\kappa T_{,i})_{,i}=Q,  
          \f]  
          \f[  
                  n_i\kappa T_{,i}=0  
          \f]  
15    
16            it is assummed that \f[ \rho c_p \f] is constant in time.         M{n_i\kappa T_{,i}=0}
17    
18            solved by Taylor Galerkin method         it is assummed that M{\rho c_p} is constant in time.
19    
20           solved by Taylor Galerkin method
21    
22         """         """
23         def __init__(self,debug=False):         def __init__(self,debug=False):
# Line 46  class TemperatureAdvection(Model): Line 43  class TemperatureAdvection(Model):
43             self.__pde.setValue(D=self.heat_capacity*self.density)             self.__pde.setValue(D=self.heat_capacity*self.density)
44    
45         def getSafeTimeStepSize(self,dt):         def getSafeTimeStepSize(self,dt):
46             """returns new step size"""             """
47               returns new step size
48               """
49             h=self.domain.getSize()             h=self.domain.getSize()
50             return self.safety_factor*inf(h**2/(h*abs(self.heat_capacity*self.density)*length(self.velocity)+self.thermal_permabilty))             return self.safety_factor*inf(h**2/(h*abs(self.heat_capacity*self.density)*length(self.velocity)+self.thermal_permabilty))
51    
52         def G(self,T,alpha):         def G(self,T,alpha):
53             """tangential operator for taylor galerikin"""             """
54               tangential operator for taylor galerikin
55               """
56             g=grad(T)             g=grad(T)
57             self.__pde.setValue(X=-self.thermal_permabilty*g, \             self.__pde.setValue(X=-self.thermal_permabilty*g, \
58                                 Y=self.thermal_source-self.__rhocp*inner(self.velocity,g), \                                 Y=self.thermal_source-self.__rhocp*inner(self.velocity,g), \
# Line 61  class TemperatureAdvection(Model): Line 62  class TemperatureAdvection(Model):
62                        
63    
64         def doStepPostprocessing(self,dt):         def doStepPostprocessing(self,dt):
65             """perform taylor galerkin step"""             """
66               perform taylor galerkin step
67               """
68             T=self.temperature             T=self.temperature
69         self.__rhocp=self.heat_capacity*self.density         self.__rhocp=self.heat_capacity*self.density
70             self.__fixed_T=self.fixed_temperature             self.__fixed_T=self.fixed_temperature

Legend:
Removed from v.147  
changed lines
  Added in v.149

  ViewVC Help
Powered by ViewVC 1.1.26