How to tackle a Stefan problem in ModelingToolkit

I have a problem similar to a Stefan problem and I wanted to ask if there is any tooling to make this kind of problem simpler/more efficient to solve.

Especially the moving boundary seems difficult to achieve.

Using NeuralPDE.jl might be possible here? Though I have to agree that @StefanKarpinski can be quite a problem.


How would the NeuralPDE be able to handle the free boundary inside the system? Is there a nice way to define the changing domains?

Otherwise a quite manual approach of cell splitting/merging in a finite volume discretization combined with a level set method could be used, I think… but it seems like a lot of work.

You can treat the boundary as larger and use a characteristic function that changes over time. The PINN would be fine with the discontinuity that makes in the untrained version.