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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2344 - (show annotations)
Mon Mar 30 02:13:58 2009 UTC (10 years, 5 months ago) by jfenwick
File MIME type: text/x-python
File size: 2132 byte(s)
Change __url__ to launchpad site

1
2 ########################################################
3 #
4 # Copyright (c) 2003-2008 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-2008 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 #
23 # small test problem fro temperture advection:
24 #
25 # T=x0*x1*exp(-t), v=[1,-1]
26 #
27
28 from esys.escript.modelframe import Link,Simulation
29 from esys.modellib.geometry import RectangularDomain,ScalarConstrainerOverBox
30 from esys.modellib.input import Sequencer
31 from esys.modellib.probe import Probe,EvaluateExpression
32 from esys.modellib.temperature import TemperatureAdvection
33 import numarray
34 import os
35
36 dom=RectangularDomain()
37 dom.order=2
38
39 sqe=Sequencer()
40 sqe.t=0
41 sqe.t_end=0.05
42
43 constraints=ScalarConstrainerOverBox()
44 constraints.domain=Link(dom)
45 constraints.top=1
46 constraints.bottom=1
47 constraints.right=1
48 constraints.left=1
49
50 source=EvaluateExpression()
51 source.domain=Link(dom)
52 source.expression="(x[1]-x[0])*exp(-t)-exp(-t)*x[0]*x[1]"
53 source.t=Link(sqe)
54 boundaryvalue=EvaluateExpression()
55 boundaryvalue.domain=Link(dom)
56 boundaryvalue.expression="x[0]*x[1]*exp(-t)"
57 boundaryvalue.t=Link(sqe)
58
59 tt=TemperatureAdvection()
60 tt.domain=Link(dom)
61 tt.temperature=Link(boundaryvalue,"out")
62 tt.velocity=numarray.array([1,-1])
63 tt.thermal_source=Link(source,"out")
64 tt.location_fixed_temperature=Link(constraints,"location_of_constraint")
65 tt.fixed_temperature=Link(boundaryvalue,"out")
66 tt.safety_factor=0.1
67
68 probe=Probe()
69 probe.expression="x[0]*x[1]*exp(-t)"
70 probe.t=Link(sqe)
71 probe.value=Link(tt,"temperature")
72
73
74 s=Simulation([sqe,constraints,tt,probe],debug=True)
75 s.writeXML()
76 s.run()

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26