<< Click to Display Table of Contents >> channel |
{ CHANNEL.PDE
This example is a modification of the LOWVISC.PDE problem, in which the
no-slip boundary has been placed at the bottom of the domain, with free flow
at the top.
The declared parameters in this problem are chosen for demonstration purposes,
and are not intended to represent any real conditions. The fluid is far more
viscous than water.
}
title 'Flow in 2D channel'
select errlim = 0.005
variables
u(0.1)
v(0.01)
p(1)
definitions
Lx = 5 Ly = 1.5
p0 = 1 { input pressure }
speed2 = u^2+v^2
speed = sqrt(speed2)
dens = 1
visc = 0.04
vxx = -(p0/(2*visc*(2*Lx)))*y^2 { open-channel x-velocity with drag at the bottom }
rball=0.4
cut = 0.1 { value for bevel at the corners of the obstruction }
penalty = 100*visc/rball^2
Re = globalmax(speed)*(Ly/2)/(visc/dens)
initial values
{ In nonlinear problems, Newton's method requires a good initial guess at the solution,
or convergence may not be achieved. You can use SELECT CHANGELIM=0.1 to
force the solver to creep toward a solution from a bad guess.
In our problem, the open channel velocity is a good place to start. }
u = vxx v = 0 p = p0*x/(2*Lx)
equations
u: visc*div(grad(u)) - dx(p) = dens*(u*dx(u) + v*dy(u))
v: visc*div(grad(v)) - dy(p) = dens*(u*dx(v) + v*dy(v))
p: div(grad(p)) = penalty*(dx(u)+dy(v))
boundaries
region 1
start(-Lx,0)
value(u) = 0 value(v) = 0 load(p) = 0
line to (Lx/2-rball,0)
to (Lx/2-rball,rball) bevel(cut)
to (Lx/2+rball,rball) bevel(cut)
to (Lx/2+rball,0)
to (Lx,0)
load(u) = 0 value(v) = 0 value(p) = p0
mesh_spacing=Ly/20
line to (Lx,Ly)
mesh_spacing=100
load(p) = 0
line to (-Lx,Ly)
value(p) = 0
line to close
monitors
contour(speed) report(Re)
plots
contour(u) report(Re)
contour(v) report(Re)
contour(speed) painted report(Re)
vector(u,v) as "flow" report(Re)
contour(p) as "Pressure" painted
contour(dx(u)+dy(v)) as "Continuity Error"
elevation(u) from (-Lx,0) to (-Lx,Ly)
elevation(u) from (0,0) to (0,Ly)
elevation(u) from (Lx/2,0)to (Lx/2,Ly)
elevation(u) from (Lx,0) to (Lx,Ly)
end