﻿ Sample Problems > Usage > Periodicity > periodic_contaminant

# periodic_contaminant

Navigation:  Sample Problems > Usage > Periodicity >

# periodic_contaminant

{  PERIODIC_CONTAMINANT.PDE

This problem computes the flow of contaminant pulses in a periodic channel section.

}

title 'Periodic Contaminant transport in 2D channel'

variables

c(0.01)

select

ngrid=40

definitions

Lx = 5       Ly = 1.5

p0 = 2

dens = 1

visc0 = 0.04

visc = visc0

vxx = -(p0/(2*visc*(2*Lx)))*(Ly^2-y^2)       { open-channel x-velocity }

u = 0.5*vxx

v = 0

speed = sqrt(u^2+v^2)

Re = globalmax(speed)*(Ly/2)/(visc0/dens)

Kc = 0.002       { contaminant diffusivity }

wid=0.3

c0=1

cinput = c0*exp(-(x^2+(y-Ly/2)^2)/wid^2)

Initial Values

c = cinput

equations

c:  dt(c) + u*dx(c) + v*dy(c) = div(Kc*grad(c))

boundaries

region 1

start(-Lx,0)

line to (Lx,0)

periodic(x-2*Lx,y)

line to (Lx,Ly)

mesh_spacing=100

line to(-Lx,Ly)

line to close

time 0 to 10

monitors

for cycle = 10

contour(speed) report(Re)

contour(c) range(0,1) report(Re)

plots

for t=0 by 0.2 to endtime

contour(c) range(0,1) painted report(Re)

contour(u) report(Re)

contour(v) report(Re)

contour(speed) painted report(Re)

vector(u,v) as "flow"   report(Re)

contour(dx(u)+dy(v)) as "Continuity Error"

history(integral(c)) range(0,1.2*integral(cinput))

history(c) at (0,0.8) (2,0.8) (3,0.8) (4,0.8) (Lx,0)

end