Hello, I'm working on a nonlinear advection-diffusion equation in 1D but a little unsure about the boundary conditions. The equation depends on a variable q and goes as follows:
$$ \frac{d}{dt}f(y,t) = \nabla [ J(y)f(y,t) + D \nabla f^{2-q}(y, t)] $$
For the time integration I chose an implicit Euler scheme
# velocity field
I = Expression(('(2.0-q)*sinh(x[0])',),q=q,degree=2)
def operator(u, v):
return factor*(2.0-q)*pow(u,1.0-q)*dot(grad(u),grad(v))*dx + u*dot(I, grad(v))*dx
#? + f*v*dx - g*v*ds
F = inner(u-u0, v)*dx + dt*operator(u, v)
The initial condition is composed of two Gauß peaks, symetrically around zero. Since I don't want any of my 'mass' to escape the system I first imposed Dirichlet BC's. But then I discovered this link scicomp.stackexchange.com that argues I need Robin BC's which now makes sense. This would mean
that the term in square brackets from above has to vanish at the boundaries. Do I just have to set g to zero?
Also I just get a solution for values of q in $[1, 1.7]$ even though I should also be able to choose negative values or larger ones than 1.7. But doing that the Newton solver returns NaN and fails. Do my functions have to fulfill continiuty conditions in order for the solver to work? I already tried adjusting my mesh and time sizes, but I get most 3 or 4 time step integrations before it fails. Can this be connected to the boundary conditions?