23.2. Instationary transport equation#
Let \(w \in L_{\infty}^d\) be a given vectorfield, called the wind. We search for a concentration \(u : \Omega \times [0,T] \) such that
We split the boundary into inflow and outflow boundaries:
On the inflow, we can specify the concentration as a Dirichlet boundary condition:
from ngsolve import *
from ngsolve.webgui import Draw
mesh = Mesh(unit_square.GenerateMesh(maxh=0.05))
fes = H1(mesh, order=4, dirichlet="left|bottom")
u,v = fes.TnT()
gfu = GridFunction(fes)
wind = CF( (1, 0.2) )
gfu.Set (exp(-100*( (x-0.2)**2 + (y-0.5)**2) ))
n = specialcf.normal(2)
Atrans = BilinearForm(-u*wind*grad(v)*dx + wind*n*u*v*ds).Assemble()
f = LinearForm(fes)
mass = BilinearForm(u*v*dx).Assemble()
massinv = mass.mat.Inverse(freedofs=fes.FreeDofs(), inverse="sparsecholesky")
scene = Draw(gfu, min=0, max=1)
dt = 0.0002
tend = 0.8
t = 0
while t < tend:
gfu.vec.data += dt * massinv * (f.vec-Atrans.mat*gfu.vec)
t += dt
scene.Redraw()
23.2.1. Exercises:#
try different wind fields, e.g. \(w(x,y) = (1, 0.1 \sin (30 x))\)
improve timestepping to \(2^{nd}\) order Runge Kutta
add a diffusion term to the transport equation:
\[ \frac{\partial u}{\partial t} - \varepsilon \Delta u + \operatorname{div} (w u) = f \]add a source term \(f\)
discretization methods tailored for transport equations are Discontinuous Galerkin methods, https://jschoeberl.github.io/iFEM/DG/stationary.html
23.2.2. Reynolds’ transport theorem#
The transport equation arises from conservation equations on moving control volumina.
Let
describe the deformation of a reference domain \(\Omega\), e.g. the particles of a continuum.
Call \(V_0 \subset \Omega\) a control volume, e.g. all particles colored with red paint.
Define
Theorem: For proper functions \(u(x,t)\) there holds
with velocity \(w(x,t) = \frac{\partial \Phi}{\partial t}(x,t)\).
Next, apply Gauss’ theorem to obtain:
If some quantity \(\int_V u \, dx\) is preserved over time for all moving control volumina, then it satisfies the transport equation
Examples of preserved quantities in fluid dynamics are mass \(\int \rho \, dx\), and momentum \(\int \rho u dx\)