1 |
# $Id$ |
2 |
|
3 |
# |
4 |
# small test problem fro temperture advection: |
5 |
# |
6 |
# p=(x0+x1)*t |
7 |
# |
8 |
from escript.modelframe import Link,Simulation |
9 |
from modellib.geometry import RectangularDomain,VectorConstrainer |
10 |
from modellib.input import Sequencer |
11 |
from modellib.probe import Probe,EvaluateExpression |
12 |
from modellib.flow import SteadyIncompressibleFlow |
13 |
|
14 |
dom=RectangularDomain() |
15 |
dom.order=2 |
16 |
|
17 |
constraints=VectorConstrainer() |
18 |
constraints.domain=Link(dom) |
19 |
constraints.left=[1,0,0] |
20 |
constraints.right=[1,0,0] |
21 |
constraints.top=[0,1,0] |
22 |
constraints.bottom=[0,1,0] |
23 |
constraints.front=[0,0,1] |
24 |
constraints.back=[0,0,1] |
25 |
|
26 |
sqe=Sequencer() |
27 |
sqe.dt_max=0.3 |
28 |
sqe.t_end=1. |
29 |
|
30 |
source=EvaluateExpression() |
31 |
source.domain=Link(dom) |
32 |
source.t=Link(sqe) |
33 |
source.expression=["t","t"] |
34 |
|
35 |
flow=SteadyIncompressibleFlow() |
36 |
flow.domain=Link(dom) |
37 |
flow.internal_force=Link(source,"out") |
38 |
flow.location_prescribed_velocity=Link(constraints,"location_of_constraint") |
39 |
flow.prescribed_velocity=[0.,0.] |
40 |
|
41 |
ptest=Probe() |
42 |
ptest.expression="(x[0]+x[1]-1.)*t" |
43 |
ptest.t=Link(sqe) |
44 |
ptest.value=Link(flow,"pressure") |
45 |
|
46 |
s=Simulation([dom,sqe,Simulation([flow],debug=True),ptest],debug=True) |
47 |
s.writeXML() |
48 |
s.run() |