/[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 1417 by gross, Mon Feb 25 04:45:48 2008 UTC revision 2158 by caltinay, Mon Dec 15 07:17:47 2008 UTC
# Line 1  Line 1 
1  # $Id:$  
2  #  ########################################################
 #######################################################  
 #  
 #       Copyright 2008 by University of Queensland  
3  #  #
4  #                http://esscc.uq.edu.au  # Copyright (c) 2003-2008 by University of Queensland
5  #        Primary Business: Queensland, Australia  # Earth Systems Science Computational Center (ESSCC)
6  #  Licensed under the Open Software License version 3.0  # http://www.uq.edu.au/esscc
 #     http://www.opensource.org/licenses/osl-3.0.php  
7  #  #
8  #######################################################  # Primary Business: Queensland, Australia
9    # Licensed under the Open Software License version 3.0
10    # http://www.opensource.org/licenses/osl-3.0.php
11  #  #
12    ########################################################
13    
14    __copyright__="""Copyright (c) 2003-2008 by University of Queensland
15    Earth Systems Science Computational Center (ESSCC)
16    http://www.uq.edu.au/esscc
17    Primary Business: Queensland, Australia"""
18    __license__="""Licensed under the Open Software License version 3.0
19    http://www.opensource.org/licenses/osl-3.0.php"""
20    __url__="http://www.uq.edu.au/esscc/escript-finley"
21    
22  """  """
23  Some models for heat advection-diffusion  Some models for heat advection-diffusion
# Line 24  Some models for heat advection-diffusion Line 31  Some models for heat advection-diffusion
31  """  """
32    
33  __author__="Lutz Gross, l.gross@uq.edu.au"  __author__="Lutz Gross, l.gross@uq.edu.au"
 __copyright__="""  Copyright (c) 2008 by ACcESS MNRF  
                     http://www.access.edu.au  
                 Primary Business: Queensland, Australia"""  
 __license__="""Licensed under the Open Software License version 3.0  
              http://www.opensource.org/licenses/osl-3.0.php"""  
 __url__="http://www.iservo.edu.au/esys"  
 __version__="$Revision:$"  
 __date__="$Date:$"  
34    
35  # from escript import *  # from escript import *
36  import util  import util
# Line 39  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 64  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,num_equations=1,theta=theta,**kwargs)          TransportPDE.__init__(self,domain,numEquations=1,theta=theta,**kwargs)
74          self.setReducedOn()          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 94  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.solve(dt,**kwargs)            return self.getSolution(dt,**kwargs)
101    

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

  ViewVC Help
Powered by ViewVC 1.1.26