Skip to content
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

Question about evolving mesh #25

Open
TUZETF opened this issue Dec 3, 2021 · 3 comments
Open

Question about evolving mesh #25

TUZETF opened this issue Dec 3, 2021 · 3 comments

Comments

@TUZETF
Copy link

TUZETF commented Dec 3, 2021

Hi, I am thinking of using VoronoiFVM.jl for solving a set of different PDEs governing the evolution of snow on the ground in 1D. In order to follow the ice-matrix in snow, it is usual to solve diffusion processes and water liquid percolation on a fix grid and then to update the grid (by moving nodes as snow settles) and iterate again on the new grid and so on.
I would like to know if according to you, VoronoiFVM could be applied in such a configuration.

Thank you by advance!

@j-fu
Copy link
Owner

j-fu commented Dec 4, 2021

Hi, I appreciate your interest in the code!.

I did not try such a problem yet, but I think that it is possible. It seems that the authors of https://doi.org/10.1016/j.compchemeng.2021.107412 were sucessful doing something like this.

Just a hint: wenn you just move the points (without adding or removing points), you can try to use the
update_grid! method to recalculate the control volume data, in order to avoid the creation of a new system.

Another interesting option would be the approach used in https://doi.org/10.1016/j.jcp.2012.06.005 , however I did not think yet about how to realize that in this package.

@TUZETF
Copy link
Author

TUZETF commented Dec 6, 2021

Hi!
Thank you very much for your quick response! I had a look to the articles you sent and I think that your package could fit out interest. We are at the start of the project for now and I am pretty new to the world of PDEs so I am not sure that I will use it at the end but if I do I will let you know (and cite your contribution of course).

I have an additional (probably stupid) question:
As far as I understand, you define the functions (e.g storage!) by broadcasting f to u (which appears to be of type Dual).
For now I do not fully understand what is behind but I would like to know how to define a spatially varying coefficient in one of these functions. For instance defining a diffusion coefficient that depends on your gridpoint.
I think that should be pretty easy to do but I don't find an example of that and prefer not digging in the code as I explore many different options at the same time.

@j-fu
Copy link
Owner

j-fu commented Dec 6, 2021

Ok, this is no really well documented:
https://j-fu.github.io/VoronoiFVM.jl/stable/physics/#VoronoiFVM.AbstractEdge
You should be able to do something like:

function flux( y, u, edge)
    x=0.5*(edge[1,1]+edge[1,2])
    y[1]=D(x)*(u[1,1]-u[1,2])
end

The dual number stuff allows to obtain the derivatives, e.g. in the case your D depends on u.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants