Open LenkaNovak opened 4 years ago
The issues here is this: We have relaxation terms in various equations (e.g., microphysics), which look like this:
𝝏f/𝝏t + ... = -(f - g)/𝜏
where f
is some variable (e.g., an energy variable), g
is another variable (or constant), and 𝜏
is a (short timescale). Because the relaxation timescale is short, introducing stiffness, we want to timestep this term implicitly. This is an easy term to treat implicitly because it does not involve spatial derivatives (i.e., the resulting linear system is diagonal).
For example, implicit Euler discretization gives
f_{t+1} = (f_t + (𝞓t/𝞽) g) / (1 + 𝞓t/𝞽).
How do we make this possible in our code? One challenge is that these terms are quite deep down (e.g., in microphysics code).
As we re-factor interfaces, we need to keep in mind that we want to be able to treat such terms implicitly.
An example of such term from our codebase is here:
Implemented here:
I will setup a MWE with an LES type run that only uses the above as source terms and link it here.
@tapios - Thinking about making this particular term implicit, I'm not sure how to evaluate the liquid and ice specific humidities in equilibrium at t+1
?
Some terms can be trivially solved implicitly