/[escript]/trunk/escript/py_src/heat.py
ViewVC logotype

Diff of /trunk/escript/py_src/heat.py

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

revision 1874 by ksteube, Mon Oct 13 05:15:55 2008 UTC revision 2158 by caltinay, Mon Dec 15 07:17:47 2008 UTC
# Line 38  from linearPDEs import TransportPDE Line 38  from linearPDEs import TransportPDE
38    
39  class TemperatureCartesian(TransportPDE):  class TemperatureCartesian(TransportPDE):
40        """        """
41        solves        solves
42    
43            rhocp(T_{,t} + v_i T_{,i} - ( k T_{,i})_i = Q            rhocp(T_{,t} + v_i T_{,i} - ( k T_{,i})_i = Q
44            
45                   k T_{,i}*n_i=surface_flux                   k T_{,i}*n_i=surface_flux
46                
47                   T_{,t} = 0  where given_T_mask>0                   T_{,t} = 0  where given_T_mask>0
48    
49        if surface_flux is not give 0 is assumed.        if surface_flux is not given 0 is assumed.
50    
51        typical usage:        typical usage:
52    
# Line 63  class TemperatureCartesian(TransportPDE) Line 63  class TemperatureCartesian(TransportPDE)
63        """        """
64        def __init__(self,domain,theta=0.5,**kwargs):        def __init__(self,domain,theta=0.5,**kwargs):
65          """          """
66          initializes tmperature advection-diffuision problem          initializes temperature advection-diffuision problem
67    
68          @param domain: domain of the problem          @param domain: domain of the problem
69          @param theta: method control: theta=1. backward Euler          @param theta: method control: theta=1. backward Euler
70                                        theta=0.5: Crank-Nicholson scheme                                        theta=0.5: Crank-Nicholson scheme
71                                        thete=0.: forward Euler (not recommendable)                                        theta=0.: forward Euler (not recommendable)
72          """          """
73          TransportPDE.__init__(self,domain,numEquations=1,theta=theta,**kwargs)          TransportPDE.__init__(self,domain,numEquations=1,theta=theta,**kwargs)
74          self.setReducedOrderOn()          self.setReducedOrderOn()
75          self.__rhocp=None          self.__rhocp=None
76          self.__v=None          self.__v=None
77    
78        def setInitialTemperature(self,T):        def setInitialTemperature(self,T):
79          self.setInitialSolution(T)          self.setInitialSolution(T)
80    
81        def setValue(self,rhocp=None,v=None,k=None,Q=None,surface_flux=None,given_T_mask=None):        def setValue(self,rhocp=None,v=None,k=None,Q=None,surface_flux=None,given_T_mask=None):
82             if rhocp!=None:             if rhocp!=None:
83                 self.__rhocp=rhocp                 self.__rhocp=rhocp
# Line 93  class TemperatureCartesian(TransportPDE) Line 95  class TemperatureCartesian(TransportPDE)
95                 super(TemperatureCartesian,self).setValue(y=surface_flux)                 super(TemperatureCartesian,self).setValue(y=surface_flux)
96             if given_T_mask!=None:             if given_T_mask!=None:
97                 super(TemperatureCartesian,self).setValue(q=given_T_mask)                 super(TemperatureCartesian,self).setValue(q=given_T_mask)
98              
99        def getTemperature(self,dt,**kwargs):        def getTemperature(self,dt,**kwargs):
100            return self.getSolution(dt,**kwargs)            return self.getSolution(dt,**kwargs)
101    

Legend:
Removed from v.1874  
changed lines
  Added in v.2158

  ViewVC Help
Powered by ViewVC 1.1.26