I have noticed when running models that the results from the melt fraction post processor and porosity field vary. In the mid ocean ridge cookbook, the difference in these fields can vary significantly at the same timestep (see attached figures ‘porosity’ and ‘melt fraction’ and note the dynamic color scales). Looking at the functions used to calculate the melt fraction post processor and porosity fields (melt_fractions and melt_fraction, respectively), they should produce the same results (unless they are getting different pressures and temperatures). I think the porosity field includes both melt that was generated during the current timestep as well as previous melt that may still be present (and potentially advected), but I am unsure. If this was the case how do we explain the early stages of melting in the mid ocean ridge cookbook (see attached figure ‘incipient melting’) where the porosity field is 0 but we have incipient melts according to the melt fraction post processor?
If they were run with the main branch, can you let us know what the commit was (located near the top of log.txt file)
Would you mind checking if running the same cookbook using version 2.5 of ASPECT produces the discrepancy? If they do not appear on v2.5 and the model above was run with a very recent version of the main branch, I wonder if the discrepancy arose from a change introduced in one of the following PRs (5759, 5795). If yes, my guess is that the melt_fraction post processor may no longer be outputting the melt_fraction calculated from the material model.
You are right, the two properties are supposed to be different. If you use the melt fraction postprocessor with a material model that computes a melt fraction, then they both use the same equations to compute melting. But the postprocessor only takes into account temperature and pressure to compute an equilibrium melt fraction. The porosity is the current amount of melt present in the model. This can be different because material becomes depleted due to melting, so if the melt moves away, it will not just re-melt (because all the things that are easy to melt have already been removed). Likewise, if melt moved to a new location, it will not simply freeze there (unless the temperature drops below the solidus), so the porosity can be higher than the melt fraction. Finally, each model also has a melting time scale that you choose as an input parameter, which means that even if nothing is moving, it will take some time for material to melt (to get the porosity to the equilibrium melt fraction). That could explain why at the beginning stages, your “melt fraction” is larger than the porosity.