<< Click to Display Table of Contents >> scaled_z |
{ SCALED_Z.PDE
This example applies a 10:1 expansion to the z coordinate in a single imbedded layer.
Compare solution to UNSCALED_Z.PDE, which does not scale the z-coordinate.
See "Help->Technical Notes->Coordinate Scaling" for a discussion of the techniques
used in this example.
}
title 'Scaled Z-coordinate'
coordinates
cartesian3
variables
Tp
Zs
definitions
long = 1/2 { thickness of the upper and lower layers }
wide = 1
w=0.01 { half-thickness of the imbedded slab }
zscale=1 { The global Z-Scaling factor, defaulted to 1 for top and bottom layers }
zscale2=20 { The desired Z-Scaling factor for the center layer }
ws = w*zscale2 { the scaled half-thickness of the slab }
K =0.1 { thermal conductivity -- modified later by layer }
Q = 0 { Thermal source - modified later by layer }
T0 = 0
initial values
Tp = 0.
equations
{ equations are written using the global scaling factor name.
Layer-specific values will be assigned during evaluation }
Tp: dx(k*dx(Tp))/zscale + dy(k*dy(Tp))/zscale + dz(k*zscale*dz(Tp)) + Q/zscale = 0
then
Zs: dz(Zs) = 1/zscale
extrusion
surface 'bottom' z = -long-ws
layer 'under'
surface 'slab_bottom' z = -ws
layer 'slab'
surface 'slab_top' z= ws
layer 'over'
surface 'top' z= long+ws
boundaries
surface 'bottom' load(Tp)=0.1*(T0-Tp) value(Zs)=0
surface 'top' load(Tp)=0.1*(T0-Tp)
Region 1
layer 2
Q = 100*exp(-x^2-y^2) { a heat source in the slab layer only }
zscale = zscale2 { redefine the Z-scaling factor in layer 2 }
k = 1 { redefine conductivity in layer 2 }
start 'sidewall' (-wide,-wide)
load(Tp) = 0
layer 2 load(Tp)=0.1*(T0-Tp)/zscale2
line to (wide,-wide)
to (wide,wide)
to (-wide,wide)
to close
monitors
contour(Tp) on z=0 as "XY Temp"
contour(Tp) on x=0 as "YZ Temp unscaled"
contour(Tp) on y=0 as "ZX Temp unscaled"
contour(Tp) on grid(y,Zs) on x=0 as "YZ Temp scaled"
contour(Tp) on grid(x,Zs) on y=0 as "ZX Temp scaled"
plots
contour(Zs) on x=0 !temp
contour(Tp) on z=0 as "XY Temp"
contour(Tp) on x=0 as "YZ Temp unscaled"
contour(Tp) on y=0 as "ZX Temp unscaled"
contour(Tp) on grid(y,Zs) on x=0 as "YZ Temp scaled"
contour(Tp) on grid(x,Zs) on y=0 as "ZX Temp scaled"
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-ws) to (0,0,long+ws) as "Z-Axis Temp"
vector(-k*dx(Tp),-k*dz(Tp)) on y=0 as "Flux on Y=0"
vector(-k*dx(Tp),-k*dy(Tp)) on z=0 as "Flux on Z=0"
{ since "k" refers to energy passing a through unit surface area in the unscaled system,
it's value is unmodified: }
elevation(k*dx(Tp)) from (-wide,0,0) to (wide,0,0) as "Center X-Flux"
{ since differentiation with respect to z involves a scaling, the flux must be multiplied by
the scale factor: }
elevation(k*dz(Tp)*zscale) from (0,0,-(long+ws)) to (0,0,(long+ws)) as "Center Z-Flux"
SUMMARY
{ form some integrals for comparison with Unscaled_Z: }
{ the Z flux derivative must be multiplied by the scale factor, but the area of integration
is in true coordinates }
{ flux leaving the slab, evaluated in the slab: }
report(sintegral(-k*zscale2*dz(Tp),'slab_top','slab'))
{ flux leaving the slab, evaluated in the upper layer: }
report(sintegral(-k*1*dz(Tp),'slab_top','over'))
report("--")
{ The transverse fluxes are in the correct units, but the area integration must be
corrected by dividing by the scale factor (notice that "zscale" will evaluate to
"zscale2" in the slab)}
report(sintegral(-normal(k*grad(Tp))/zscale,'sidewall','slab'))
end