JuliaGeodynamics / LaMEM.jl

Julia interface to LaMEM (Lithosphere and Mantle Evolution Model)
GNU General Public License v3.0
30 stars 13 forks source link

Phase Transitions are not activated #26

Closed boriskaus closed 8 months ago

boriskaus commented 8 months ago

In LaMEM, we can add phase transitions to particles which makes them change phase number when certain criteria are reached. These criteria can be things such as depth, temperature of even Clapeyron slope. This is implemented in LaMEM.jl as well with the PhaseTransition structure:

PT0 = PhaseTransition(ID=0, Parameter_transition="T",       ConstantValue = 1200, PhaseBelow = [2], PhaseAbove=[0], PhaseDirection="BothWays")
PT1 = PhaseTransition(ID=1, Parameter_transition="Depth",   ConstantValue = -660, PhaseBelow = [4], PhaseAbove=[0], PhaseDirection="BothWays")
model.Materials.PhaseTransitions=[PT0, PT1]

Yet, it doesn't work.

boriskaus commented 8 months ago

It turns out that the reason it doesn't work is that this keyword should be set to 1 to activate phase transitions in the *.dat input file:

Phasetrans = 1
wenrongcao commented 8 months ago

Clapeyron slope

I see how constant temperature and depth work. For Clapeyron type transition, can we do it in Julia wrapper using custom Clapeyron parameters? It seems you still need to choose from predefined Clapeyron transition from phase_transiton.cpp.

wenrongcao commented 8 months ago

It turns out that the reason it doesn't work is that this keyword should be set to 1 to activate phase transitions in the *.dat input file:

Phasetrans = 1

I did not fine "Phasetrans = 1" setup in the lamen_input.dat file. When I implemented a constant depth transition (from oceanic crust to eclogite), I did not do "Phasetrans = 1" yet the transition still seems to work.

boriskaus commented 8 months ago

That is interesting; in my test case a depth or T dependent transition did not work when this keyword is not specified.

it was indeed not present in the lamem_input.dat file (I added it earlier today) as this was apparently forgotten (and set to zero by default). That is also the reason that it was not present in the julia wrapper as I only translated options from that file to Julia.

boriskaus commented 8 months ago

Clapeyron slope

For Clapeyron type transition, can we do it in Julia wrapper using custom Clapeyron parameters? It seems you still need to choose from predefined Clapeyron transition from phase_transiton.cpp.

I would have to look to the LaMEM source code to see if this can be specified from the input file. If yes, we can easily add this to the wrapper. If not, someone should add this to LaMEM first.

wenrongcao commented 8 months ago

That is interesting; in my test case a depth or T dependent transition did not work when this keyword is not specified.

it was indeed not present in the lamem_input.dat file (I added it earlier today) as this was apparently forgotten (and set to zero by default). That is also the reason that it was not present in the julia wrapper as I only translated options from that file to Julia.

Looking forward to the updated and more standard way to add depth/T dependent transition in julia code. It will be very helpful if a few lines of example are shown how to get it done (e.g., either show in a test code or add to the existing TM_subduction example and how to set Phasetrans = 1).

boriskaus commented 8 months ago

this is closed by PR #29

Also note that there is currently an issue in LaMEM with PhaseTransitions & phase=0, so avoid that in combination with phase transitions for now (fix on the way)