-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Density-dependent diffusion #27
Comments
Hi,
This is essentially done in Example106. With
I don't understand this question completely. Geometry dependent scaling (division by point distance and multiplication by interface width) is done outside of the flux functions. |
I feel like your FVM solver would be a good method to use to solve the (equilibrium) Fokker-Planck equation since probability mass is conserved:
If we let diffusion matrix function jdx(jdx,ρ,∂ω,θ)
# I have data θ that passes a function θ.∇V that computes the gradient given x and parameters θ.θ
x1,x2 = ∂ω[:,1],∂ω[:,2] # I noticed edge[:,1] and edge[:,2] give the coordinates of the centers of Voronoi regions, not edge verteces?
ρ1,ρ2 = ρ[1,1],ρ[1,2]
x = (x1+x2)/2 # point x on edge ∂ω between the two Voronoi regions
dx = norm(x1-x2)
∇Vdx = project(∂ω,θ.∇V(x,θ.θ)) # projecting vector ∇V(x) on edge
D = project(∂ω,diag(θ.D))/dx # projecting magnitude of diffusion in x and y directions on edge, but want D not Ddx
-∇Vdx > 0 ? jdx1 = -∇Vdx*ρ1 : jdx1 = -∇Vdx*ρ2
jdx2 = -D*(ρ2-ρ1)
jdx[1] = jdx1 + jdx2
end I used the upwind method here, because I couldn't get the Bernoulli function method to even run, but even this doesn't give a solution I'd expect... Would a problem like this be solvable using your solver? |
Hi, in principle it could work.
Yes. In fact in 2D, the notation "edge" is a bit ambiguous. I use With ansiotropic diffusion however you should be careful. This would work correctly only on grids aligned with the anisotropy directions aligned to the grid lines (I think I have a remark on that in the docs). I have a master student writing a thesis on a finite volume approach in the more general case, I hope to have some Julia implementation before summer. |
Hello, I had asked a question a while ago about time and space dependence in the flux and reaction terms. I'm not sure if that has been resolved, but I was also wondering how one would go about modeling a flux term like
j = -D(u/K)ᵐ∇u
? This was my attempt (by averagingu[1,1]
andu[1,2]
), but I'm not sure about it:Or more generally what would I do for
j = -f(u)∇u
? Also, sincej⋅n̂
is approximated byg(uₖ,uₗ)/|xₖ-xₗ|
, wouldn't we need to multiply theu
by something like(abs ∘ -)(∂ω.coord[1:2]...)
? Thank you in advance!The text was updated successfully, but these errors were encountered: