next up previous contents
Next: Comp_Deriv Up: Source Code Previous: upwind_mhd_2d_powell

visc.C

This code solves the dffusion equation.

We consider as a model problem teh paraboic equation with variable coefficient v to demonstrate the treatment of the viscous contributions:

\(u_t=\nabla \cdot (\nu \nabla u)+f, \mbox{in}\hspace{2mm} \Omega, u \in L^2(\Omega)\)

\(u=g(x,t), \mbox{on}\hspace{2mm} \partial \Omega\)

We then introduce the flux variable

and re-write the parabolic equation,after integrating by parts twice, we obtain an equivalent formulation which is easier to implement. The new variational problem is:

\((u_t,w)_{E_i}=(-\nabla \cdot q,w)_{E_i}-<w,(q^B-q^I) \cdot n >_{E_i} + (f,w)_{E_i}, \forall w \in L^2(\Omega)\)

\(\frac {1}{\nu}(q,v)=(-\nabla u,v)_{E_i}-<(u^B-u^I)n,v>_{\partial E_i}, \forall v \in H(grad;\Omega)\)

u=g(x,t), on \(\partial \Omega\)



 

Guang Lin
2001-03-08