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 |
import os |
20 |
|
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 |
tt.velocity=numarray.array([1,-1,0]) |
48 |
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 |
s=Simulation([sqe,dom,tt,probe],debug=True) |
60 |
s.writeXML() |
61 |
s.run() |