1 |
jgs |
147 |
# $Id$ |
2 |
|
|
|
3 |
|
|
# |
4 |
|
|
# small test problem fro temperture advection: |
5 |
|
|
# |
6 |
|
|
# p=(x0+x1)*t |
7 |
|
|
# |
8 |
elspeth |
628 |
__copyright__=""" Copyright (c) 2006 by ACcESS MNRF |
9 |
|
|
http://www.access.edu.au |
10 |
|
|
Primary Business: Queensland, Australia""" |
11 |
|
|
__license__="""Licensed under the Open Software License version 3.0 |
12 |
|
|
http://www.opensource.org/licenses/osl-3.0.php""" |
13 |
|
|
|
14 |
gross |
706 |
import os |
15 |
jgs |
150 |
from esys.escript.modelframe import Link,Simulation |
16 |
|
|
from esys.modellib.geometry import RectangularDomain,VectorConstrainer |
17 |
|
|
from esys.modellib.input import Sequencer |
18 |
|
|
from esys.modellib.probe import Probe,EvaluateExpression |
19 |
|
|
from esys.modellib.flow import SteadyIncompressibleFlow |
20 |
jgs |
147 |
|
21 |
|
|
dom=RectangularDomain() |
22 |
|
|
dom.order=2 |
23 |
|
|
|
24 |
|
|
constraints=VectorConstrainer() |
25 |
|
|
constraints.domain=Link(dom) |
26 |
|
|
constraints.left=[1,0,0] |
27 |
|
|
constraints.right=[1,0,0] |
28 |
|
|
constraints.top=[0,1,0] |
29 |
|
|
constraints.bottom=[0,1,0] |
30 |
|
|
constraints.front=[0,0,1] |
31 |
|
|
constraints.back=[0,0,1] |
32 |
|
|
|
33 |
|
|
sqe=Sequencer() |
34 |
|
|
sqe.dt_max=0.3 |
35 |
|
|
sqe.t_end=1. |
36 |
|
|
|
37 |
|
|
source=EvaluateExpression() |
38 |
|
|
source.domain=Link(dom) |
39 |
|
|
source.t=Link(sqe) |
40 |
|
|
source.expression=["t","t"] |
41 |
|
|
|
42 |
|
|
flow=SteadyIncompressibleFlow() |
43 |
|
|
flow.domain=Link(dom) |
44 |
|
|
flow.internal_force=Link(source,"out") |
45 |
|
|
flow.location_prescribed_velocity=Link(constraints,"location_of_constraint") |
46 |
|
|
flow.prescribed_velocity=[0.,0.] |
47 |
|
|
|
48 |
|
|
ptest=Probe() |
49 |
|
|
ptest.expression="(x[0]+x[1]-1.)*t" |
50 |
|
|
ptest.t=Link(sqe) |
51 |
|
|
ptest.value=Link(flow,"pressure") |
52 |
|
|
|
53 |
gross |
728 |
s=Simulation([sqe,Simulation([flow],debug=True),ptest],debug=True) |
54 |
jgs |
147 |
s.writeXML() |
55 |
|
|
s.run() |