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

trunk/esys2/modellib/py_src/temperature.py revision 147 by jgs, Fri Aug 12 01:45:47 2005 UTC trunk/modellib/py_src/temperature.py revision 155 by jgs, Wed Nov 9 02:02:19 2005 UTC
# Line 1  Line 1
1  # $Id$  # $Id$
2
3  from escript.escript import *  from esys.escript import *
4  from escript.modelframe import Model,IterationDivergenceError  from esys.escript.modelframe import Model,IterationDivergenceError
6  import numarray  import numarray
7
8
10         """         """
11
12           The conservation of internal heat energy is given by         The conservation of internal heat energy is given by
13
\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):
38         def doInitialization(self):         def doInitialization(self):
39             self.__pde=LinearPDE(self.domain)             self.__pde=LinearPDE(self.domain)
40             self.__pde.setSymmetryOn()             self.__pde.setSymmetryOn()
41             # self.__pde.setReducedOrderOn()             self.__pde.setReducedOrderOn()
42             # self.__pde.setLumpingOn()             self.__pde.setSolverMethod(self.__pde.LUMPING)
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               """
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), \
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.155