underworldcode / underworld2

underworld2: A parallel, particle-in-cell, finite element code for Geodynamics.
http://www.underworldcode.org/
Other
168 stars 58 forks source link

Melt volume calculation #410

Closed Prasanna2989 closed 5 years ago

Prasanna2989 commented 5 years ago

Hi All,

I have a general question related to melt production in a mantle convection model. In my model, the melt was generated comparing the temperature of the particle with the solidus of the particular material. Then the melt fraction is calculated as follows.

M = (T - Tsolidus)/(Tliquidus-Tsolidus) - (Gerya 2010)

When the melt fraction M>0.04, the particle is converted to melt particle. In this kind of a model, what is the best way to measure the melt volume using the particles? I herewith attached a screen shot for your reference. I need to measure the volume of the orange color region using particles. Also, when the melt is produced, I add particles to the model to represent melt as well as depleted mantle. Therefore, number of particles increase with the time.(Particle addition can be removed if it is required)

Screen Shot 2019-08-18 at 8 51 41 am
gthyagi commented 5 years ago

I am assuming this is a 2D problem. If you are running these models on a single processor then check Shapely python package. Use polygon module to extract the boundary points of the melt then find the area using extracted boundary points.

adambeall commented 5 years ago

If you're not set on creating new particles, then another option is to create a swarm variable to track melt fraction. You can then use utils.Integral to integrate the total volume of depletion or melt, which will give you a more accurate volume that counting particles. You can combine it with a branching.conditional function if you want to calculate the volume of material with at least a particular percentage of melt, rather than the absolute melt percentage.

Prasanna2989 commented 5 years ago

Thank you for the answers.

rbeucher commented 5 years ago

Hi @Prasanna2989

Please consider creating an example and submit it to us. We will be happy to add it as community resource!

@rbeucher