/[escript]/trunk/modellib/test/python/run_temp.py
ViewVC logotype

Annotation of /trunk/modellib/test/python/run_temp.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 728 - (hide annotations)
Mon May 15 02:01:18 2006 UTC (14 years, 3 months ago) by gross
File MIME type: text/x-python
File size: 1641 byte(s)
modelframe test examples work now
1 jgs 147 # $Id$
2     #
3     # small test problem fro temperture advection:
4     #
5     # T=x0*x1*exp(-t), v=[1,-1]
6     #
7 elspeth 628 __copyright__=""" Copyright (c) 2006 by ACcESS MNRF
8     http://www.access.edu.au
9     Primary Business: Queensland, Australia"""
10     __license__="""Licensed under the Open Software License version 3.0
11     http://www.opensource.org/licenses/osl-3.0.php"""
12    
13     from esys.escript.modelframe import Link,Simulation
14     from esys.modellib.geometry import RectangularDomain,ScalarConstrainer
15     from esys.modellib.input import Sequencer
16     from esys.modellib.probe import Probe,EvaluateExpression
17     from esys.modellib.temperature import TemperatureAdvection
18 jgs 147 import numarray
19 gross 706 import os
20 jgs 147
21     dom=RectangularDomain()
22     dom.order=2
23    
24     sqe=Sequencer()
25     sqe.t=0
26     sqe.t_end=0.1
27    
28     constraints=ScalarConstrainer()
29     constraints.domain=Link(dom)
30     constraints.top=1
31     constraints.bottom=1
32     constraints.right=1
33     constraints.left=1
34    
35     source=EvaluateExpression()
36     source.domain=Link(dom)
37     source.expression="(x[1]-x[0])*exp(-t)-exp(-t)*x[0]*x[1]"
38     source.t=Link(sqe)
39     boundaryvalue=EvaluateExpression()
40     boundaryvalue.domain=Link(dom)
41     boundaryvalue.expression="x[0]*x[1]*exp(-t)"
42     boundaryvalue.t=Link(sqe)
43    
44     tt=TemperatureAdvection()
45     tt.domain=Link(dom)
46     tt.temperature=Link(boundaryvalue,"out")
47 gross 728 tt.velocity=numarray.array([1,-1])
48 jgs 147 tt.thermal_source=Link(source,"out")
49     tt.location_fixed_temperature=Link(constraints,"location_of_constraint")
50     tt.fixed_temperature=Link(boundaryvalue,"out")
51     tt.safety_factor=0.01
52    
53     probe=Probe()
54     probe.expression="x[0]*x[1]*exp(-t)"
55     probe.t=Link(sqe)
56     probe.value=Link(tt,"temperature")
57    
58    
59 gross 728 s=Simulation([sqe,tt,probe],debug=True)
60 jgs 147 s.writeXML()
61     s.run()

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26