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

Revision 729 - (show annotations)
Mon May 15 03:16:53 2006 UTC (16 years, 1 month ago) by gross
File MIME type: text/x-python
File size: 1641 byte(s)
```cut down the number of time steps
```
 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 9 Primary Business: Queensland, Australia""" 10 __license__="""Licensed under the Open Software License version 3.0 11 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.05 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]) 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.1 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,tt,probe],debug=True) 60 s.writeXML() 61 s.run()

## Properties

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

 ViewVC Help Powered by ViewVC 1.1.26