{
This problem demonstrates the use of FlexPDE in 3D fluid flow. It shows the flow of fluid
through a plenum box with a circular inlet at the bottom and an offset circular outlet at the top.
The inlet pressure is arbitrarily set at 0.05 units.
The problem runs in two stages, first as a massless fluid to get an initial pressure and velocity
distribution in a linear system, and then with momentum terms included.
Adaptive mesh refinement is turned off for speed in demonstration. In a real application, regridding
could be used to better resolve the flow past the corners of the ducts.
The solution uses a "penalty pressure", in which the pressure variable is used merely to guarantee
mass conservation.
}
title '3D flow through a plenum'
coordinates
cartesian3
variables
vx(1e-6) vy(1e-6) vz(1e-6) p
select
ngrid=20
stages=2
regrid=off
definitions
long = 2
wide = 1
high = 1/2
xin = -1 yin = 0
xout = 1 yout = 0
rc = 0.5
duct = 0.2
dens=staged(0, 1 ) { fluid density }
visc= 0.01 { fluid viscosity }
v=vector(vx,vy,vz)
vm=magnitude(v)
div_v = dx(vx) + dy(vy) + dz(vz)
PENALTY = 1e4*visc/high^2
Pin = 0.05
Pout = 0
INITIAL VALUES
vx=0
vy=0
vz=0
p=Pin+(Pout-Pin)*(z+high+duct)/(2*high+2*duct)
EQUATIONS
vx: dens*(vx*dx(vx) + vy*dy(vx) + vz*dz(vx)) + dx(p) -visc*div(grad(vx)) = 0
vy: dens*(vx*dx(vy) + vy*dy(vy) + vz*dz(vy)) + dy(p) -visc*div(grad(vy)) = 0
vz: dens*(vx*dx(vz) + vy*dy(vz) + vz*dz(vz)) + dz(p) -visc*div(grad(vz)) = 0
p: div(grad(p)) = PENALTY*div_v
extrusion z = -high-duct,-high,high,high+duct
boundaries
Region 1 { plenum box }
surface 2 value(vx)=0 value(vy)=0 value(vz)=0 natural(p)=0
surface 3 value(vx)=0 value(vy)=0 value(vz)=0 natural(p)=0
layer 1 void
layer 3 void
start(-long,-wide)
value(vx)=0 value(vy)=0 value(vz)=0 natural(p)=0 { fix all side values }
line to (long,-wide)
to (long,wide)
to (-long,wide)
to close
limited Region 2 { input hole }
layer 1
surface 1 natural(vx)=0 natural(vy)=0 natural(vz)=0 value(p)=Pin { input duct opening }
start(xin,yin-rc)
layer 1 value(vx)=0 value(vy)=0 value(vz)=0 natural(p)=0 { duct sidewall drag }
arc(center=xin,yin) angle=360
limited Region 3 { exit hole }
layer 3
surface 4 natural(vx)=0 natural(vy)=0 natural(vz)=0 value(p)=Pout { output duct opening }
start(xout,yout-rc)
layer 3 value(vx)=0 value(vy)=0 value(vz)=0 natural(p)=0 { duct sidewall drag }
arc(center=xout,yout) angle=360
monitors
contour(vx) on x=0 report dens report pin
contour(vx) on y=0 report dens report pin
contour(vz) on y=0 report dens report pin
vector(vx,vz) on y=0 report dens report pin
contour(vx) on z=0 report dens report pin
contour(vy) on z=0 report dens report pin
contour(vz) on z=0 report dens report pin
vector(vx,vy) on z=0 report dens report pin
contour(p) on y=0 report dens report pin
plots
contour(vx) on x=0 report dens report pin
contour(vx) on y=0 report dens report pin
contour(vz) on y=0 report dens report pin
vector(vx,vz) on y=0 report dens report pin
contour(vx) on z=0 report dens report pin
contour(vy) on z=0 report dens report pin
contour(vz) on z=0 report dens report pin
vector(vx,vy) on z=0 report dens report pin
contour(p) on y=0 report dens report pin
end