﻿ Sample Problems > Usage > Functions > globalmax_3d

# globalmax_3d

Navigation:  Sample Problems > Usage > Functions >

# 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.

}

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(globalmax(Tp), globalmax_x(Tp), globalmax_y(Tp), globalmax_z(Tp)) as "Global Maximum"

report(" ")

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", "upper"), globalmax_x(Tp, "right", "upper"), globalmax_y(Tp, "right", "upper"), globalmax_z(Tp, "right", "upper")) as "Right Upper Maximum"

report(" ")

report(globalmax(Tp, 1), globalmax_x(Tp, 1), globalmax_y(Tp, 1), globalmax_z(Tp, 1)) as "Region 1 Maximum"

report(globalmax(Tp, 2), globalmax_x(Tp, 2), globalmax_y(Tp, 2), globalmax_z(Tp, 2)) as "Region 2 Maximum"

report(globalmax(Tp, 1, 1), globalmax_x(Tp, 1, 1), globalmax_y(Tp, 1, 1), globalmax_z(Tp, 1, 1)) as "Region 1 Layer 1 Maximum"

report(globalmax(Tp, 2, 2), globalmax_x(Tp, 2, 2), globalmax_y(Tp, 2, 2), globalmax_z(Tp, 2, 2)) as "Region 2 Layer 2 Maximum"

end