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

Contents of /trunk/modellib/test/python/temp_test.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 628 - (show annotations)
Thu Mar 23 02:27:57 2006 UTC (14 years, 6 months ago) by elspeth
File MIME type: text/x-python
File size: 1637 byte(s)
Copyright information added.

1 # $Id$
2 #
3 # small test problem fro temperture advection:
4 #
5 # T=x0*x1*exp(-t), v=[1,-1]
6 #
7 __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 import numarray
19
20 dom=RectangularDomain()
21 dom.order=2
22
23 sqe=Sequencer()
24 sqe.t=0
25 sqe.t_end=0.1
26
27 constraints=ScalarConstrainer()
28 constraints.domain=Link(dom)
29 constraints.top=1
30 constraints.bottom=1
31 constraints.right=1
32 constraints.left=1
33
34 source=EvaluateExpression()
35 source.domain=Link(dom)
36 source.expression="(x[1]-x[0])*exp(-t)-exp(-t)*x[0]*x[1]"
37 source.t=Link(sqe)
38 boundaryvalue=EvaluateExpression()
39 boundaryvalue.domain=Link(dom)
40 boundaryvalue.expression="x[0]*x[1]*exp(-t)"
41 boundaryvalue.t=Link(sqe)
42
43 tt=TemperatureAdvection()
44 tt.domain=Link(dom)
45 tt.temperature=Link(boundaryvalue,"out")
46 tt.velocity=numarray.array([1,-1,0])
47 tt.thermal_source=Link(source,"out")
48 tt.location_fixed_temperature=Link(constraints,"location_of_constraint")
49 tt.fixed_temperature=Link(boundaryvalue,"out")
50 tt.safety_factor=0.01
51
52 probe=Probe()
53 probe.expression="x[0]*x[1]*exp(-t)"
54 probe.t=Link(sqe)
55 probe.value=Link(tt,"temperature")
56
57
58 s=Simulation([sqe,dom,tt,probe],debug=True)
59 s.writeXML()
60 s.run()

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26