1 |
# $Id$ |
# $Id$ |
2 |
from mytools import Helmholtz |
from mytools import Helmholtz |
3 |
from esys.escript import Lsup,length |
from esys.escript import Lsup,length,whereNegative,saveVTK |
4 |
from esys.finley import Rectangle |
from esys.finley import Rectangle |
5 |
#... set some parameters ... |
#... set some parameters ... |
6 |
xc=[0.02,0.002] |
xc=[0.02,0.002] |
21 |
mypde=Helmholtz(mydomain) |
mypde=Helmholtz(mydomain) |
22 |
# ... set heat source: .... |
# ... set heat source: .... |
23 |
x=mydomain.getX() |
x=mydomain.getX() |
24 |
q=qc*(length(x-xc)-r).whereNegative() |
q=qc*whereNegative(length(x-xc)-r) |
25 |
# ... set initial temperature .... |
# ... set initial temperature .... |
26 |
T=Tref |
T=Tref |
27 |
# ... start iteration: |
# ... start iteration: |
31 |
print "time step :",t |
print "time step :",t |
32 |
mypde.setValue(kappa=kappa,omega=rhocp/h,f=q+rhocp/h*T,eta=eta,g=eta*Tref) |
mypde.setValue(kappa=kappa,omega=rhocp/h,f=q+rhocp/h*T,eta=eta,g=eta*Tref) |
33 |
T=mypde.getSolution() |
T=mypde.getSolution() |
34 |
T.saveDX("T%d.dx"%i) |
saveVTK("T%d.xml"%i,temp=T) |