42
44
dom=RectangularDomain()
45
temp_val=InterpolateOverBox()
46
temp_val.domain=Link(dom,"domain")
47
temp_val.value_left_bottom_front=1.
48
temp_val.value_right_bottom_front=1.
49
temp_val.value_left_top_front=0.
50
temp_val.value_right_top_front=0.
51
temp_val.value_left_bottom_back=1.
52
temp_val.value_right_bottom_back=1.
53
temp_val.value_left_top_back=0.
54
temp_val.value_right_top_back=0.
56
temp_constraints=ScalarConstrainerOverBox()
57
temp_constraints.domain=Link(dom)
58
temp_constraints.top=1
59
temp_constraints.bottom=1
61
vel_constraints=VectorConstrainerOverBox()
62
vel_constraints.domain=Link(dom)
63
vel_constraints.left=[1,0,0]
64
vel_constraints.right=[1,0,0]
65
vel_constraints.top=[0,1,0]
66
vel_constraints.bottom=[0,1,0]
67
vel_constraints.front=[0,0,1]
68
vel_constraints.back=[0,0,1]
70
mat=SimpleEarthModel()
73
mat.rayleigh_number=10000.
76
temp=TemperatureAdvection(debug=True)
78
temp.density=Link(mat,"density0")
79
temp.heat_capacity=Link(mat,"heat_capacity")
80
temp.location_fixed_temperature=Link(temp_constraints,"location_of_constraint")
81
temp.fixed_temperature=Link(temp_val,"out")
82
temp.safety_factor=0.01
83
mat.temperature=Link(temp,"temperature")
87
grav.domain=Link(dom,"domain")
88
grav.direction=[0.,-1.,0.]
89
grav.density=Link(mat,"density")
90
grav.gravity=Link(mat,"gravity")
93
vel=SteadyIncompressibleFlow(debug=True)
95
vel.internal_force=Link(grav,"gravity_force")
96
vel.viscosity=Link(mat,"viscosity")
97
vel.location_prescribed_velocity=Link(vel_constraints,"location_of_constraint")
99
temp.velocity=Link(vel,"velocity")
106
vis.data0=Link(temp,"temperature")
107
vis.data1=Link(vel,"velocity")
109
vis.filename=os.path.join(WORKDIR,"temp.xml")
111
per=GaussianProfile()
113
per.x_c=[0.5,0.5,0.5]
118
lc=LinearCombination()
120
lc.v0=Link(per,"out")
122
lc.v1=Link(temp_val,"out")
123
temp.temperature=Link(lc,"out")
125
s=Simulation([sq,vel_constraints, temp_constraints,Simulation([vel],debug=True),temp,vis],debug=True)
47
temp_val=InterpolateOverBox()
48
temp_val.domain=Link(dom,"domain")
49
temp_val.value_left_bottom_front=1.
50
temp_val.value_right_bottom_front=1.
51
temp_val.value_left_top_front=0.
52
temp_val.value_right_top_front=0.
53
temp_val.value_left_bottom_back=1.
54
temp_val.value_right_bottom_back=1.
55
temp_val.value_left_top_back=0.
56
temp_val.value_right_top_back=0.
58
temp_constraints=ScalarConstrainerOverBox()
59
temp_constraints.domain=Link(dom)
60
temp_constraints.top=1
61
temp_constraints.bottom=1
63
vel_constraints=VectorConstrainerOverBox()
64
vel_constraints.domain=Link(dom)
65
vel_constraints.left=[1,0,0]
66
vel_constraints.right=[1,0,0]
67
vel_constraints.top=[0,1,0]
68
vel_constraints.bottom=[0,1,0]
69
vel_constraints.front=[0,0,1]
70
vel_constraints.back=[0,0,1]
72
mat=SimpleEarthModel()
75
mat.rayleigh_number=10000.
78
temp=TemperatureAdvection(debug=True)
80
temp.density=Link(mat,"density0")
81
temp.heat_capacity=Link(mat,"heat_capacity")
82
temp.location_fixed_temperature=Link(temp_constraints,"location_of_constraint")
83
temp.fixed_temperature=Link(temp_val,"out")
84
temp.safety_factor=0.01
85
mat.temperature=Link(temp,"temperature")
89
grav.domain=Link(dom,"domain")
90
grav.direction=[0.,-1.,0.]
91
grav.density=Link(mat,"density")
92
grav.gravity=Link(mat,"gravity")
95
vel=SteadyIncompressibleFlow(debug=True)
97
vel.internal_force=Link(grav,"gravity_force")
98
vel.viscosity=Link(mat,"viscosity")
99
vel.location_prescribed_velocity=Link(vel_constraints,"location_of_constraint")
101
temp.velocity=Link(vel,"velocity")
108
vis.data0=Link(temp,"temperature")
109
vis.data1=Link(vel,"velocity")
111
vis.filename=os.path.join(WORKDIR,"temp.xml")
113
per=GaussianProfile()
115
per.x_c=[0.5,0.5,0.5]
120
lc=LinearCombination()
122
lc.v0=Link(per,"out")
124
lc.v1=Link(temp_val,"out")
125
temp.temperature=Link(lc,"out")
127
s=Simulation([sq,vel_constraints, temp_constraints,Simulation([vel],debug=True),temp,vis],debug=True)
132
dom=RectangularDomain(esys.dudley)
b'\\ No newline at end of file'