Use multiply_rho true for potential temperature evolution
Summary
Use multiply_rho true for potential temperature evolution and adapt for multiphase sims.
Pull request type
Please check the type of change introduced:
- [ ] Bugfix
- [x] Feature
- [ ] Code style update (formatting, renaming)
- [ ] Refactoring (no functional changes, no api changes)
- [ ] Build related changes
- [ ] Documentation content changes
- [ ] Other (please describe):
Checklist
The following is included:
- [ ] new unit-test(s)
- [ ] new regression test(s)
- [ ] documentation for new capability
This PR was tested by running:
- the unit tests
- [ ] on GPU
- [ ] on CPU
- the regression tests
- [ ] on GPU
- [ ] on CPU
Closes #1493
The following tests FAILED:
25 - abl_stable (Failed) no_ci regression -> O(1e-10) diffs
31 - abl_multiphase_laminar (Failed) no_ci regression -> machine diffs
32 - abl_waves_terrain (Failed) no_ci regression -> machine diffs
33 - act_abl_joukowskydisk (Failed) no_ci regression -> machine diffs
34 - act_abl_uniformctdisk (Failed) no_ci regression -> machine diffs
87 - hbl_godunov (Failed) no_ci regression -> O(1e-6) diffs
95 - forest_drag (Failed) no_ci regression -> machine diffs
107 - abl_meso_input_dpa (Failed) no_ci regression -> machine diffs
108 - abl_meso_input_ipa (Failed) no_ci regression -> machine diffs
109 - abl_meso_tendency (Failed) no_ci regression -> O(1e-6) diffs
110 - abl_kosovic_neutral (Failed) no_ci regression -> machine diffs
112 - abl_kosovic_neutral_ib (Failed) no_ci regression -> machine diffs
113 - nrel_precursor (Failed) no_ci regression -> machine diffs
129 - abl_multiphase_w2a (Failed) no_ci regression -> O(1) diffs
what do we think of these @mbkuhn ?
fun. looks like I need to check the abl_stable, hbl_godunov, abl_meso_tendency, and abl_multiphase_w2a tests. I'm not too worried about the machine diffs. By the way, are these diffs between main and this PR, or are they diffs for this PR, before and after my commits to it?
these are diffs between main and this PR
For the reg tests with bigger diffs (listed below), I get the same diffs between main and your first commit e6eaab5, which just sets multiply_rho = true, as between main and the latest commit on this PR. These also match the diffs you report.
- abl_stable
- hbl_godunov
- abl_meso_tendency
This means I was wrong about the implications of tweaking incflo_advance. That appears to have no effect, while multiply_rho is actually having a noticeable effect for certain cases. I'll still have to analyze, separately from this, where the large diffs in abl_multiphase_w2a are coming from.
we can now redo the reg test on this one, comparing to the latest main
Ok I am seeing these fail:
The following tests FAILED:
25 - abl_stable (Failed) no_ci regression
31 - abl_multiphase_laminar (Failed) no_ci regression
32 - abl_waves_terrain (Failed) no_ci regression
33 - act_abl_joukowskydisk (Failed) no_ci regression
34 - act_abl_uniformctdisk (Failed) no_ci regression
87 - hbl_godunov (Failed) no_ci regression
95 - forest_drag (Failed) no_ci regression
107 - abl_meso_input_dpa (Failed) no_ci regression
108 - abl_meso_input_ipa (Failed) no_ci regression
109 - abl_meso_tendency (Failed) no_ci regression
110 - abl_kosovic_neutral (Failed) no_ci regression
112 - abl_kosovic_neutral_ib (Failed) no_ci regression
113 - nrel_precursor (Failed) no_ci regression
129 - abl_multiphase_w2a (Failed) no_ci regression
134 - abl_bndry_input_native_inout (Failed) no_ci regression
140 - abl_multiphase_laminar_input (Not Run) no_ci regression
145 - nrel_terrain (Not Run) no_ci regression
146 - nrel_terrain_amr (Not Run) no_ci regression
But only these are more than machine:
abl_multiphase_w2a
abl_bndry_input_native_inout
abl_meso_input_ipa
abl_meso_input_dpa
abl_meso_tendency
ok, so we fixed abl_stable and hbl_godunov, but we have some new ones to understand
I just looked into the abl_multiphase_w2a case, and it makes sense that there are diffs. For this case, there is a temperature gradient across the interface, so the differences in how density is incorporated into the algorithm should make a difference. There are differences in time integration (multiply_rho = false means dividing RHS by rho^{n+1/2}, but multiply_rho = true means dividing RHS by rho^{n+1}), but I think the biggest reason is the advection. The advection treatment is vastly different in this PR compared to main, which should show up significantly when there is a temperature gradient at the interface in the presence of velocity. Which is what we have here.
By contrast, a nice check that we have the new phase-aware advection set up properly is that it shouldn't make a difference when the temperature is uniform near the interface in the presence of velocity. And that is confirmed by the very low diffs for the abl_multiphase_laminar case. See below the difference in the temperature profile between the two cases.
So I think our list is reduced to
abl_bndry_input_native_inout
abl_meso_input_ipa
abl_meso_input_dpa
abl_meso_tendency
which is heavily involving the meso-micro coupling. I will look at the unrelated inout one first.
Nice work!
abl_bndry_input_native_inout
This one has clear diffs only for the temperature equation. The presence of diffs makes sense because this is an anelastic flow (ABL.anelastic = 1), which means the density is not constant, which means that advecting (rho*theta) or (theta) should make a difference here. Screenshots of the temperature show clearly difference signatures after 10 steps even though the magnitude is tiny (see scale).
this branch
main branch (multiply_rho = false)
abl_bndry_input_native_inout
density field for this case:
So we just have to figure out the meso reg tests
Remaining diffs for the three cases
Only machine diffs now for the meso reg tests!