# Problems with depth(position) into a melt simple material model

Hi All,

I need to calculate the molten (melt fraction) into a cartesian
geometry using a simple equation that depend on the
depth. The material models that I am running now, solve the
viscosity-temperature dependent and the tidal dissipation, except the
melt fractions. At the beggining, I was computing a new model using
the MeltSimple template just for the calculus of melt fractions and
extract the melt statistics in the postprocessors, but I can not do it
because the puglin is designed to return a double and if I want to use
the â€śconst double depth =
this->get_geometry_model().depth(in.position[i]);â€ť I should do the
declaration of position, then the declaration of â€śinâ€ť and finally I
should replace the double for the void.

I donâ€™t know which can be the best solution for this. The goal of my
models is to localize the melting points and I think that the melt
statistits postprocessor might give me this information. I was
considering just use the following comand and add the parameters of
the equation I am using, but I am working with the Boussinessq
Approximation and I am not clear how to replace the
â€śadiabatic_conditionsâ€ť because I need to analize the convection.

melt_fractions (const MaterialModel::MaterialModelInputs &in,
std::vector &melt_fractions) const
{
for (unsigned int q=0; q<in.n_evaluation_points(); ++q)
melt_fractions[q] = this->melt_fraction(in.temperature[q],

}

Please, help me with this I am so confused.

Hi Katherine,

I am not the best person to answer your question, but I can get things started.

Itâ€™s hard to work out from your question how you have approached solving your scientific problem, and where you are having trouble (with ASPECT structure or C++ in general). It is often useful to show us what youâ€™ve tried, and what isnâ€™t working.

For example, if I wanted help with one of my branches, I might post this link: Comparing geodynamics:main...bobmyhill:default_field_types Â· geodynamics/aspect Â· GitHub
and ask a question about line 261 in `include/aspect/material_model/visco_plastic.h` on the branch `default_field_types`.

I was computing a new model using the MeltSimple template just for the calculus of melt fractions and extract the melt statistics in the postprocessors, but I can not do it because the plugin is designed to return a double and if I want to use the â€śconst double depth = this->get_geometry_model().depth(in.position[i]);â€ť I should do the declaration of position, then the declaration of â€śinâ€ť and finally I should replace the double for the void.

If I thought that this was something you should be changing, I would ask you to show us what you tried and what the error was. But for your problem, I do not understand why you are trying to change this bit of `melt_simple.cc`, which already does what you want it to do â€¦ take a pressure and temperature and calculate a melt fraction.

You may wish to use `melt_global.cc` as a template rather than `melt_simple.cc`, as a relevant cookbook uses that material model (see below), and you may end up writing less code.

The goal of my models is to localize the melting points and I think that the melt statistics postprocessor might give me this information.

The Visualization postprocessor should give you melt fraction (search for â€śmelt fractionâ€ť in the test prms to find several examples).

â€¦ I am working with the Boussinessq Approximation and I am not clear how to replace the â€śadiabatic_conditionsâ€ť because I need to analyze the convection.

Iâ€™m not sure what your problem is here, so letâ€™s look at this another way; what do you need to add to existing ASPECT functionality to solve your scientific problem? The most relevant cookbook is `cookbooks/global_melt/global_melt.prm`, which is the second example described here: Melt migration in a 2D mantle convection model â€” ASPECT 2.5.0-pre. It implements melting, melt migration and convection.

Using that as a starting point, you need to change the melt model from the anhydrous mantle model to a Ganymede-relevant one (itâ€™s not obvious to me how you want to do that, because I think of ice sheets as pure water ice, and one-component systems need special treatment, see Prof. Dannberg et alâ€™s 2022 paper; entropy method for geodynamic modelling of phase transitions: capturing sharp and broad transitions in a multiphase assemblage | Geophysical Journal International | Oxford Academic), and also add tidal shear heating (which it sounds like youâ€™ve done). Are there more things you need to consider / problems you need to solve?

Best wishes,
Bob

1 Like

Hi Katherine,

I agree with everything Bob has said. We would need more information to figure out what exactly the problem is that you try to solve and what you have tried already. If you follow his suggestion to explain this in more detail, I am happy to have a look as well!

Juliane

Dr. MyHill, Dr. Dannberg,

Many thanks so much for your help.
For my problem, I just need to save some melt statistics from my model that depend on the temperature and depth. For that, I use the equation X_melt = Cp/L*(T - T_melt) where T_melt = 273*(1 - rho * gravity * depth/385)^1/9. I computed the equations in the melt_global.cc and run the melt_global.prm adding my two libraries where I described the law for the viscosity-temperature dependence and the law for the tidal heating; but unfortunately, I can not run it using my tidal heating model (as it is shown in the picture below).

I would like to ask you if there is a way to implement those two equations and extract the melt statistics as a postprocessor without using the melt_global.prm, isnâ€™t there?
The melt global.cc uses an adiabatic heating that I donâ€™t need.

Kind regards.
Katherine

Dear Katherine,

The error message tells you that â€śtidal heatingâ€ť is not registered as a valid heating model.

We need to see your branch to figure out why that is the case. One possibility is that you havenâ€™t explicitly instantiated your new model (see the last few lines of any existing heating model file, such as `source/heating_model/shear_heating_with_melt.cc`).

Your last question has a large number of parts (use of equations, postprocessors, modifying source and prm files). Letâ€™s try to fix one problem at a time.

Best wishes,
Bob

Hi Bob,

I realized that is not feasible to implement the melt_global model for
the problem I try to solve because it includes the adiabatic heating
model. One option I found is adding a postprocessor library to my
principal prm file and extract the melt statistics. The postprocessor
temperature_anomaly.cc depends on the temperature and depth which are
the two principal variables I need to implement. I modified the
puglins temperature_anomaly.cc and temperature_anomaly.h and changed
their names as deltaX.cc and deltaX.h. But, when I run the code I
receive the message (deltaX.h: No such file or directory #include
), and I donâ€™t know which can be the mistake.

Please, could you help me to find the error?
I attached the cc and h files, the CMake list and the screenshot of
the error from the compilation.

thank you so much.

Dear Katherine,

Please fork ASPECT to your GitHub repository, then push your full working branch to that repository, rather than individual files into a stand-alone repo. That way we can see what you changed, other than trying to guess where your files should go.

You may need to do a little research into how git works to understand how to do this, but it will be worth it.

The first step, cloning the aspect repo to your local machine (which you may already have done) is here: