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

Annotation of /trunk/doc/user/examples/diffusion.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 327 - (hide annotations)
Wed Dec 7 04:32:28 2005 UTC (17 years, 3 months ago) by gross
File MIME type: text/x-python
File size: 770 byte(s)
make them run again
1 jgs 102 # $Id$
2 jgs 108 from mytools import Helmholtz
3 gross 327 from esys.escript import Lsup,length,whereNegative,saveVTK
4 jgs 108 from esys.finley import Rectangle
5 jgs 102 #... set some parameters ...
6 jgs 108 xc=[0.02,0.002]
7 jgs 102 r=0.001
8 jgs 108 qc=50.e6
9 jgs 102 Tref=0.
10     rhocp=2.6e6
11     eta=75.
12     kappa=240.
13 jgs 108 tend=5.
14     # ... time, time step size and counter ...
15     t=0
16 jgs 102 h=0.1
17     i=0
18     #... generate domain ...
19 jgs 108 mydomain = Rectangle(l0=0.05,l1=0.01,n0=250, n1=50)
20 jgs 102 #... open PDE ...
21     mypde=Helmholtz(mydomain)
22     # ... set heat source: ....
23     x=mydomain.getX()
24 gross 327 q=qc*whereNegative(length(x-xc)-r)
25 jgs 102 # ... set initial temperature ....
26     T=Tref
27     # ... start iteration:
28 jgs 108 while t<tend:
29 jgs 102 i+=1
30     t+=h
31     print "time step :",t
32     mypde.setValue(kappa=kappa,omega=rhocp/h,f=q+rhocp/h*T,eta=eta,g=eta*Tref)
33     T=mypde.getSolution()
34 gross 327 saveVTK("T%d.xml"%i,temp=T)

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26