/[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 3975 - (show annotations)
Thu Sep 20 01:54:06 2012 UTC (7 years ago) by caltinay
File MIME type: text/x-python
File size: 1591 byte(s)
Merged symbolic branch into trunk. Curious what daniel and spartacus have to
say...

1
2 ########################################################
3 #
4 # Copyright (c) 2003-2012 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-2012 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 from esys.weipa import saveVTK
26 #... set some parameters ...
27 xc=[0.02,0.002]
28 r=0.001
29 qc=50.e6
30 Tref=0.
31 rhocp=2.6e6
32 eta=75.
33 kappa=240.
34 tend=5.
35 # ... time, time step size and counter ...
36 t=0
37 h=0.1
38 i=0
39 #... generate domain ...
40 mydomain = Rectangle(l0=0.05,l1=0.01,n0=250, n1=50)
41 #... open PDE ...
42 mypde=LinearPDE(mydomain)
43 mypde.setSymmetryOn()
44 mypde.setValue(A=kappa*kronecker(mydomain),D=rhocp/h,d=eta,y=eta*Tref)
45 # ... set heat source: ....
46 x=mydomain.getX()
47 qH=qc*whereNegative(length(x-xc)-r)
48 # ... set initial temperature ....
49 T=Tref
50 # ... start iteration:
51 while t<tend:
52 i+=1
53 t+=h
54 print("time step :",t)
55 mypde.setValue(Y=qH+rhocp/h*T)
56 T=mypde.getSolution()
57 saveVTK("T.%d.vtu"%i,temp=T)
58

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/pasowrap/doc/examples/usersguide/diffusion.py:3661-3674 /branches/py3_attempt2/doc/examples/usersguide/diffusion.py:3871-3891 /branches/restext/doc/examples/usersguide/diffusion.py:2610-2624 /branches/ripleygmg_from_3668/doc/examples/usersguide/diffusion.py:3669-3791 /branches/symbolic_from_3470/doc/examples/usersguide/diffusion.py:3471-3974 /branches/symbolic_from_3470/ripley/test/python/doc/examples/usersguide/diffusion.py:3517-3974 /trunk/doc/examples/usersguide/diffusion.py:1388-2483 /trunk/ripley/test/python/doc/examples/usersguide/diffusion.py:3480-3515

  ViewVC Help
Powered by ViewVC 1.1.26