/[escript]/branches/symbolic_from_3470/escript/py_src/heat.py
ViewVC logotype

Diff of /branches/symbolic_from_3470/escript/py_src/heat.py

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

revision 2549 by jfenwick, Mon Jul 20 06:43:47 2009 UTC revision 2625 by jfenwick, Fri Aug 21 06:30:25 2009 UTC
# Line 22  __url__="https://launchpad.net/escript-f Line 22  __url__="https://launchpad.net/escript-f
22  """  """
23  Some models for heat advection-diffusion  Some models for heat advection-diffusion
24    
25  @var __author__: name of author  :var __author__: name of author
26  @var __copyright__: copyrights  :var __copyright__: copyrights
27  @var __license__: licence agreement  :var __license__: licence agreement
28  @var __url__: url entry point on documentation  :var __url__: url entry point on documentation
29  @var __version__: version  :var __version__: version
30  @var __date__: date of the version  :var __date__: date of the version
31  """  """
32    
33  __author__="Lutz Gross, l.gross@uq.edu.au"  __author__="Lutz Gross, l.gross@uq.edu.au"
# Line 40  class TemperatureCartesian(TransportPDE) Line 40  class TemperatureCartesian(TransportPDE)
40      """      """
41      Represents and solves the temperature advection-diffusion problem      Represents and solves the temperature advection-diffusion problem
42    
43      M{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      M{k T_{,i}*n_i=surface_flux} and M{T_{,t} = 0} where C{given_T_mask}>0.      *k T_{,i}*n_i=surface_flux* and *T_{,t} = 0* where ``given_T_mask``>0.
46    
47      If surface_flux is not given 0 is assumed.      If surface_flux is not given 0 is assumed.
48    
# Line 63  class TemperatureCartesian(TransportPDE) Line 63  class TemperatureCartesian(TransportPDE)
63          """          """
64          Initializes the temperature advection-diffusion problem.          Initializes the temperature advection-diffusion problem.
65    
66          @param domain: domain of the problem          :param domain: domain of the problem
67          @param useBackwardEuler: if set the backward Euler scheme is used. Otherwise the Crank-Nicholson scheme is applied. Not that backward Euler scheme will return a safe time step size which is practically infinity as the scheme is unconditional unstable. So other measures need to be applied to control the time step size. The Crank-Nicholson scheme provides a higher accuracy but requires to limit the time step size to be stable.          :param useBackwardEuler: if set the backward Euler scheme is used. Otherwise the Crank-Nicholson scheme is applied. Not that backward Euler scheme will return a safe time step size which is practically infinity as the scheme is unconditional unstable. So other measures need to be applied to control the time step size. The Crank-Nicholson scheme provides a higher accuracy but requires to limit the time step size to be stable.
68          @type useBackwardEuler: C{bool}          :type useBackwardEuler: ``bool``
69          """          """
70          TransportPDE.__init__(self,domain,numEquations=1,useBackwardEuler=useBackwardEuler,**kwargs)          TransportPDE.__init__(self,domain,numEquations=1,useBackwardEuler=useBackwardEuler,**kwargs)
71          self.setReducedOrderOn()          self.setReducedOrderOn()
# Line 74  class TemperatureCartesian(TransportPDE) Line 74  class TemperatureCartesian(TransportPDE)
74    
75      def setInitialTemperature(self,T):      def setInitialTemperature(self,T):
76          """          """
77          Same as L{setInitialSolution}.          Same as `setInitialSolution`.
78          """          """
79          self.setInitialSolution(T)          self.setInitialSolution(T)
80    
# Line 98  class TemperatureCartesian(TransportPDE) Line 98  class TemperatureCartesian(TransportPDE)
98    
99      def getTemperature(self,dt,**kwargs):      def getTemperature(self,dt,**kwargs):
100          """          """
101          Same as L{getSolution}.          Same as `getSolution`.
102          """          """
103          return self.getSolution(dt,**kwargs)          return self.getSolution(dt,**kwargs)
104    
# Line 107  class Tracer(TransportPDE): Line 107  class Tracer(TransportPDE):
107      """      """
108      Represents and solves the tracer problem      Represents and solves the tracer problem
109    
110      M{C_{,t} + v_i C_{,i} - ( k T_{,i})_i) = 0}      *C_{,t} + v_i C_{,i} - ( k T_{,i})_i) = 0*
111    
112      M{C_{,t} = 0} where C{given_C_mask}>0.      *C_{,t} = 0* where ``given_C_mask``>0.
113      M{C_{,i}*n_i=0}      *C_{,i}*n_i=0*
114    
115      Typical usage::      Typical usage::
116    
# Line 130  class Tracer(TransportPDE): Line 130  class Tracer(TransportPDE):
130          """          """
131          Initializes the Tracer advection problem          Initializes the Tracer advection problem
132    
133          @param domain: domain of the problem          :param domain: domain of the problem
134          @param useBackwardEuler: if set the backward Euler scheme is used. Otherwise the Crank-Nicholson scheme is applied. Not that backward Euler scheme will return a safe time step size which is practically infinity as the scheme is unconditional unstable. So other measures need to be applied to control the time step size. The Crank-Nicholson scheme provides a higher accuracy but requires to limit the time step size to be stable.          :param useBackwardEuler: if set the backward Euler scheme is used. Otherwise the Crank-Nicholson scheme is applied. Not that backward Euler scheme will return a safe time step size which is practically infinity as the scheme is unconditional unstable. So other measures need to be applied to control the time step size. The Crank-Nicholson scheme provides a higher accuracy but requires to limit the time step size to be stable.
135          @type useBackwardEuler: C{bool}          :type useBackwardEuler: ``bool``
136          """          """
137          TransportPDE.__init__(self,domain,numEquations=1,useBackwardEuler=useBackwardEuler,**kwargs)          TransportPDE.__init__(self,domain,numEquations=1,useBackwardEuler=useBackwardEuler,**kwargs)
138          self.setReducedOrderOn()          self.setReducedOrderOn()
# Line 140  class Tracer(TransportPDE): Line 140  class Tracer(TransportPDE):
140    
141      def setInitialTracer(self,C):      def setInitialTracer(self,C):
142          """          """
143          Same as L{setInitialSolution}.          Same as `setInitialSolution`.
144          """          """
145          self.setInitialSolution(C)          self.setInitialSolution(C)
146    
# Line 154  class Tracer(TransportPDE): Line 154  class Tracer(TransportPDE):
154    
155      def getTracer(self,dt,**kwargs):      def getTracer(self,dt,**kwargs):
156          """          """
157          Same as L{getSolution}.          Same as `getSolution`.
158          """          """
159          return self.getSolution(dt,**kwargs)          return self.getSolution(dt,**kwargs)
160    

Legend:
Removed from v.2549  
changed lines
  Added in v.2625

  ViewVC Help
Powered by ViewVC 1.1.26