Hi, I am relatively new to FEniCS and the Variational formulation so I was hoping for some help or pointers with a relatively complex problem that I’m having. I want to solve a nonlinear diffusion equation with a mix of Neumann and Dirichlet boundary conditions:
\frac{\partial u}{\partial t} = \frac{1}{g} \nabla \cdot \left ( g \hat D \nabla u \right ) \; \mathrm{in} \; \Omega,
u=0 \; \mathrm{on} \; \Gamma_D,
D_{xx} \frac{\partial u}{\partial x} + D_{xy}\frac{\partial u}{\partial y}=0 \; \mathrm{on} \; \Gamma_N
Here \hat D is a 2 \times 2 diffusion coefficients tensor with D_{xx}, D_{xy}, and D_{yy} are functions of (x, y) and time, meanwhile, and g is a scalar function of (x, y).
The way to represent this equation in the variational formulation is straightforward until I hit an integral
\int_\Omega \frac{v}{g}\nabla \cdot \left ( g \hat D \nabla u \right ) \mathrm{d}x
I am not sure how to rewrite it in terms of the first order derivatives for u and v. So any pointers or suggestions would be greatly appreciated.