Contents of /trunk/doc/examples/diffusion.py

Revision 2344 - (show annotations)
Mon Mar 30 02:13:58 2009 UTC (12 years, 1 month ago) by jfenwick
File MIME type: text/x-python
File size: 1558 byte(s)
```Change __url__ to launchpad site

```
 1 2 ######################################################## 3 # 4 # Copyright (c) 2003-2008 by University of Queensland 5 # Earth Systems Science Computational Center (ESSCC) 6 7 # 8 # Primary Business: Queensland, Australia 9 # Licensed under the Open Software License version 3.0 10 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 20 __url__= 21 22 from esys.escript import * 23 from esys.escript.linearPDEs import LinearPDE 24 from esys.finley import Rectangle 25 #... set some parameters ... 26 xc=[0.02,0.002] 27 r=0.001 28 qc=50.e6 29 Tref=0. 30 rhocp=2.6e6 31 eta=75. 32 kappa=240. 33 tend=5. 34 # ... time, time step size and counter ... 35 t=0 36 h=0.1 37 i=0 38 #... generate domain ... 39 mydomain = Rectangle(l0=0.05,l1=0.01,n0=250, n1=50) 40 #... open PDE ... 41 mypde=LinearPDE(mydomain) 42 mypde.setSymmetryOn() 43 mypde.setValue(A=kappa*kronecker(mydomain),D=rhocp/h,d=eta,y=eta*Tref) 44 # ... set heat source: .... 45 x=mydomain.getX() 46 qH=qc*whereNegative(length(x-xc)-r) 47 # ... set initial temperature .... 48 T=Tref 49 # ... start iteration: 50 while t

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision