/[escript]/trunk/doc/examples/usersguide/diffusion.py
ViewVC logotype

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2881 - (show annotations)
Thu Jan 28 02:03:15 2010 UTC (9 years, 4 months ago) by jfenwick
File MIME type: text/x-python
File size: 1559 byte(s)
Don't panic.
Updating copyright stamps

1
2 ########################################################
3 #
4 # Copyright (c) 2003-2010 by University of Queensland
5 # Earth Systems Science Computational Center (ESSCC)
6 # http://www.uq.edu.au/esscc
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-2010 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__="https://launchpad.net/escript-finley"
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<tend:
51 i+=1
52 t+=h
53 print "time step :",t
54 mypde.setValue(Y=qH+rhocp/h*T)
55 T=mypde.getSolution()
56 saveVTK("T.%d.vtu"%i,temp=T)
57

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision
svn:mergeinfo /branches/lapack2681/doc/examples/usersguide/diffusion.py:2682-2741 /branches/restext/doc/examples/usersguide/diffusion.py:2610-2624 /trunk/doc/examples/usersguide/diffusion.py:1388-2483

  ViewVC Help
Powered by ViewVC 1.1.26