MESAHub / MESAHub/mesa

Thermohaline hackathon: FRG24 model with safety=3 fails due to ill-conditioned matrix

Open
#738 1 comment 0 reactions 1 assignee Claimed by @pmocz View on GitHub
Dominant language
Fortran
Stars
249
Forks
82
Avg merge
1d 3h
Merged PRs (30d)
3

Description

The FRG24 model as currently implemented in the `thermohaline_hackathon` and `thermohaline_keep_on_hacking` feature branches appears to work great with `safety=0`, but crashes in pesky edge cases with `safety=3` (which implements the full model without the approximations used by `safety=0` to speed up the model---see #633). The problem arises when evaluating the model in regions that are very weakly unstable, with density ratio R_0 approaching the diffusivity ratio 1/tau. There, the flow speed w_f is comparable to machine precision, and the resulting matrix whose eigenvalues are sought becomes extremely ill-conditioned, so that the eigenvalues it spits out are unreliable, and the routine doesn't know how to proceed. Fortunately, the model seems to work fine with `safety=0`, so the FRG24 model can still be used. Still, it would be nice to be able to run calculations with `safety=3` in case users want to test the validity of the approximations employed when running with `safety=0`.

Opening this up as an issue so that @rhdtownsend, @JarRosenberg, and I can keep track of progress while we try to get to the bottom of this. Current leading candidates for addressing this problem involve (1) changing the nondimensionalization employed when writing out the matrix whose eigenvalues are needed, and (2) trying to employ matrix perturbation theory to get the eigenvalues in this problematic regime perturbatively rather than calculating them via brute force. We should also probably test other choices of `safety` to see if they run into similar problems.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.