geodynamics / aspect

A parallel, extensible finite element code to simulate convection in both 2D and 3D models.
https://aspect.geodynamics.org/
Other
228 stars 238 forks source link

Check/correct how multicomponent material models average properties (by mass or volume) #3827

Open bobmyhill opened 4 years ago

bobmyhill commented 4 years ago

In opening PR #3826, it became clear that several plugins assume that the composition fields correspond to volume fractions of components. Volume is not locally-conserved, and @gassmoeller and @dannberg tell me that we should really use mass fractions instead. Any models that allow >1 composition should also be checked to make sure that they average things in a consistent way (i.e mass fraction averaging for specific properties, volume averaging for density, thermal expansivity and compressibility). This is true of the following plugins (at least, based on the places in the code that use compute_volume_fractions):

This issue is only relevant to those models that have evaluation points with >1 component and where the components have different densities.

I think there are a couple of utilities functions which would help ensure that multicomponent averaging is done the same way everywhere:

bobmyhill commented 3 years ago

In PR #3826, the function compute_volume_fractions was renamed to compute_fractions_from_compositional_fields. However, these fractions are still implicitly volume fractions unless the following lines convert from mass fraction to volume fraction.