Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImplicitCondensation not immediate anymore #447

Merged
merged 6 commits into from
Feb 21, 2024
Merged

ImplicitCondensation not immediate anymore #447

merged 6 commits into from
Feb 21, 2024

Conversation

milankl
Copy link
Member

@milankl milankl commented Feb 21, 2024

fixes #445

Explicit immediate condensation of humidity $q_i$ at time step $i$ given its saturation $q^\star$ calculated from temperature $T_i$ would be ($q > q^\star$ else $0$)

$$ \begin{aligned} q_{i+1} - q_i &= q^\star(T_i) - q_i \\ T_{i+1} - T_i &= -\frac{L_v}{c_p}( q^\star(T_i) - q_i ) \end{aligned} $$

with latent heat release of that condensation in the second equation. However, treating this explicitly poses the problem that because the saturation humidity is calculated from the current temperature $T_i$, which is increased due to the latent heat release, the humidity after this time step will be undersaturated. Ideally, one would want to condense towards the new saturation humidity $q^\star(T_{i+1})$ so that condensation draws the humidity back down to 100% not below it.
Taylor expansion at $i$ with $\delta T = T_{i+1} - T_i$ (and $\delta q$ similarly) to first order yields

$$q_{i+1} - q_i = q^\star(T_{i+1}) - q_i = q^\star(T_i) + (T_{i+1} - T_i) \frac{\partial q^\star}{\partial T} (T_i) + O(\delta T^2) - q_i$$

Now we make a linear approximation to the derivative, drop the $O(\delta T^2)$ term. Now inserting the (explicit) latent heat release

$$\delta q = q^\star(T_i) + -\frac{L_v}{c_p} \delta q \frac{\partial q^\star}{\partial T} (T_i) - q_i$$

And solving for $\delta q$ yields

$$ \left[ 1 + \frac{L_v}{c_p} \frac{\partial q^\star}{\partial T} (T^i) \right] \delta q = q^\star(T_i) - q_i $$

meaning that the implicit immediate condensation can be formulated as

$$ \begin{aligned} q_{i+1} - q_i &= \frac{q^\star(T_i) - q_i}{1 + \frac{L_v}{c_p} \frac{\partial q^\star}{\partial T}(T_i)} \\ T_{i+1} - T_i &= -\frac{L_v}{c_p}( q_{i+1} - q_i ) \end{aligned} $$

With Euler forward time stepping this is great, but with our leapfrog timestepping + RAW filter this is very dispersive (see #445) although the implicit formulation is already much better. We therefore introduce a timestep $\Delta t_c$ which makes the implicit condensation not immediate anymore but over several time steps $\Delta t$ of the leapfrogging.

$$ \begin{aligned} \frac{q_{i+1} - q_i}{\Delta t} &= \frac{q^\star(T_i) - q_i}{ \Delta t_c \left( 1 + \frac{L_v}{c_p} \frac{\partial q^\star}{\partial T}(T_i) \right)} \\ \frac{T_{i+1} - T_i}{\Delta t} &= -\frac{L_v}{c_p}( \frac{q_{i+1} - q_i}{\Delta t} ) \end{aligned} $$

For $\Delta t = \Delta t_c$ we have an immediate condensation, for $n = \frac{\Delta t_c}{\Delta t}$ condensation takes place over $n$ time steps.

@milankl milankl added parameterizations 🌧️ Parameterizations of unresolved physical processes humidity 💧 Affecting the hydrological cycle time integration 🕙 Time integration of the equations labels Feb 21, 2024
@milankl milankl merged commit c9b2d23 into main Feb 21, 2024
5 checks passed
@milankl milankl deleted the mk/cooling branch February 24, 2024 22:20
This was referenced Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
humidity 💧 Affecting the hydrological cycle parameterizations 🌧️ Parameterizations of unresolved physical processes time integration 🕙 Time integration of the equations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Condensation fireworks
1 participant