<< Click to Display Table of Contents >> globalmax_3d |
{ GLOBALMAX_3D.PDE
This sample demonstrates the use of the GLOBALMAX function and its variants in 3D.
It is a copy of the example 3D_BRICKS+TIME.PDE.
}
title 'steady-state 3D heat conduction'
select
regrid=off { use fixed grid }
coordinates
cartesian3
variables
Tp
definitions
long = 1
wide = 1
K { thermal conductivity -- values supplied later }
Q = 10*exp(-x^2-y^2-z^2) { thermal source }
initial values
Tp = 0.
equations
Tp : div(k*grad(Tp)) + Q = 0 { the heat equation }
extrusion { divide Z into two layers }
surface z = -long
layer "lower"
surface z = 0
layer "upper"
surface z = long
boundaries
Surface 1 value(Tp)=0 { fix bottom surface temp }
Surface 3 value(Tp)=0 { fix top surface temp }
Region 1 "right" { define full domain boundary in base plane }
layer 1 k = 1 { bottom right brick }
layer 2 k = 0.1 { top right brick }
start(-wide,-wide)
value(Tp) = 0 { fix all side temps }
line to (wide,-wide) { walk outer boundary in base plane }
to (wide,wide)
to (-wide,wide)
to close
Region 2 "left" { overlay a second region in left half }
layer 1 k = 0.2 { bottom left brick }
layer 2 k = 0.4 { top left brick }
start(-wide,-wide)
line to (0,-wide) { walk left half boundary in base plane }
to (0,wide)
to (-wide,wide)
to close
monitors
contour(Tp) on z=0 as "XY Temp"
contour(Tp) on x=0 as "YZ Temp"
contour(Tp) on y=0 as "XZ Temp"
elevation(Tp) from (-wide,0,0) to (wide,0,0) as "X-Axis Temp"
elevation(Tp) from (0,-wide,0) to (0,wide,0) as "Y-Axis Temp"
elevation(Tp) from (0,0,-long) to (0,0,long) as "Z-Axis Temp"
plots
contour(Tp) on z=0 as "XY Temp"
contour(Tp) on x=0 as "YZ Temp"
contour(Tp) on y=0 as "XZ Temp"
contour(Tp) on x=globalmax_x(Tp) as "YZ Temp at max" report(globalmax_x(Tp)) as "X_max"
elevation(Tp) from (-wide,0,0) to (wide,0,0) as "X-Axis Temp"
elevation(Tp) from (0,-wide,0) to (0,wide,0) as "Y-Axis Temp"
elevation(Tp) from (0,0,-long) to (0,0,long) as "Z-Axis Temp"
summary
report("Maxima (value, xposition, yposition, zposition)")
report(" ")
report(globalmax(Tp), globalmax_x(Tp), globalmax_y(Tp), globalmax_z(Tp)) as "Global Maximum"
report(globalmax(Tp, "left"), globalmax_x(Tp, "left"), globalmax_y(Tp, "left"), globalmax_z(Tp, "left")) as "Left Maximum"
report(globalmax(Tp, "right"), globalmax_x(Tp, "right"), globalmax_y(Tp, "right"), globalmax_z(Tp, "right")) as "Right Maximum"
report(globalmax(Tp, "lower"), globalmax_x(Tp, "lower"), globalmax_y(Tp, "lower"), globalmax_z(Tp, "lower")) as "Lower Maximum"
report(globalmax(Tp, "upper"), globalmax_x(Tp, "upper"), globalmax_y(Tp, "upper"), globalmax_z(Tp, "upper")) as "Upper Maximum"
report(globalmax(Tp, "right", "lower"), globalmax_x(Tp, "right", "lower"), globalmax_y(Tp, "right", "lower"), globalmax_z(Tp, "right", "lower")) as "Right Lower Maximum"
report(globalmax(Tp, "left", "upper"), globalmax_x(Tp, "left", "upper"), globalmax_y(Tp, "left", "upper"), globalmax_z(Tp, "left", "upper")) as "Left Upper Maximum"
end