{ COUPLED_CONTAMINANT.PDE
This example shows the use of FlexPDE in a contaminant transport calculation in
which the fluid viscosity is strongly dependent on the contaminant concentration.
The example LOWVISC_FULL.PDE must first be solved to establish flow velocities.
This time-dependent modification of that example then reads the initial values and
computes the flow of a contaminant in the channel.
Fluid equations are solved fully implicitly with the contaminant concentration.
}
title 'Contaminant transport in 2D channel, Re > 40'
variables
u(0.1)
v(0.01)
p(1)
c(0.01)
definitions
Lx = 5 Ly = 1.5
p0 = 2
speed2 = u^2+v^2
speed = sqrt(speed2)
dens = 1
visc = 0.04*(1+c)
vxx = (p0/(2*visc*(2*Lx)))*(Ly-y)^2 { open-channel x-velocity }
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)
{ program a contaminant pulse in space and time
use SWAGE to eliminate discontinuous changes }
swagepulse(f,a,b) = swage(f-a,0,1,0.1*(b-a))*swage(f-b,1,0,0.1*(b-a))
cinput = swagepulse(y,-0.4,0.4 )*swagepulse(t,0,1)
Kc = 0.002 { contaminant diffusivity }
transfermesh("lowvisc_full_01.dat", uin, vin, pin)
initial values
u = uin
v = vin
p = pin
equations
u: visc*div(grad(u)) - dx(p) = dens*dt(u) + dens*(u*dx(u) + v*dy(u))
v: visc*div(grad(v)) - dy(p) = dens*dt(v) + dens*(u*dx(v) + v*dy(v))
p: div(grad(p)) = penalty*(dx(u)+dy(v))
c: dt(c) + u*dx(c) + v*dy(c) = div(Kc*grad(c))
boundaries
region 1
start(-Lx,-Ly)
value(u) = 0 value(v) = 0 load(p) = 0 load(c)=0
line to (Lx,-Ly)
load(u) = 0 value(v) = 0 value(p) = p0
{ Introduce a lump of contaminant: }
value(c) = cinput
mesh_spacing=Ly/20
line to (Lx,Ly)
mesh_spacing=100
value(u)=0 value(v)=0 load(p)= 0 load(c)=0
line to(-Lx,Ly)
load(u) = 0 value(v) = 0 value(p) = 0
line to close
exclude
start(Lx/2-rball,0)
value(u)=0 value(v)=0 load(p)= 0 load(c)=0
line to (Lx/2-rball,-rball) bevel(cut)
to (Lx/2+rball,-rball) bevel(cut)
to (Lx/2+rball,rball) bevel(cut)
to (Lx/2-rball,rball) bevel(cut)
line to close
time 0 to 10
monitors
for cycle = 1
contour(speed) report(Re)
contour(c) range(0,1) report(Re)
elevation(cinput) from (Lx,-Ly) to (Lx,Ly)
plots
for t=0 by 0.05 to endtime
contour(min(max(c,0),1)) range(0,1) painted nominmax report(Re)
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"
history(integral(c))
history(u) at (0,0.8) (2,0.8) (3,0.8) (4,0.8) (Lx,0)
history(v) at (0,0.8) (2,0.8) (3,0.8) (4,0.8)
end
Page url: index.html?applications_fluids_coupled_contaminant.html