Open glwagner opened 3 years ago
Two issues are 1. the filtered state may not be communicated correctly if filtering is implemented in
update_auxiliary_state!
, because communication is initiated prior to callingupdate_auxiliary_state!
update_auxiliary_state!
and update_auxiliary_state_gradient!
are assumed to either be local or involve the stack of dofs in a stacked mesh. This allows us to apply the update aux functions on the local / real elements and then after communication on communicated degrees of freedom.
If you want to filter the state, then you'd want to introduce an update_state!
or something function which happens before communication (and leave update aux where it is for overlapping communication and computation).
- we may need to filter the
state_gradient_flux
; @jkozdon please advise).
There is an update_auxiliary_state_gradient!
for this purpose
Looking forward to the results!!!!
Just a reminder, we did add custom_filter!
, which operates in the same way that update_auxiliary_state!
does and updates the prognostic state
@charleskawczynski where is custom_filter!
invoked? I could not find it in the files linked above. Is it invoked twice, as it needs to be to act on both the state and the state gradient flux?
update_state!
sounds right. And update_state_gradient_flux!
?
@thomasgibson @jkozdon do we still believe the approach outlined in this issue will work? Has it been tried?
Filters can be used to effect over-integration. This technique seems equivalent to the "2/3 deliasing" strategy used in some spectral codes, in which high aliased modes are "zeroed out" after calculating the products of terms (here we may need to dealias after both linear and nonlinear calculations).
Currently filters can be applied to the model state as callbacks (which can be run every time-step), or within functions like
update_auxiliary_state!
(which execute every RHS evaluation). For example, inHydrostaticBoussinesqModel
, filters are applied inupdate_auxiliary_state!
:https://github.com/CliMA/ClimateMachine.jl/blob/4e317d42909bb31e535463aa13b83a4cc410058e/src/Ocean/HydrostaticBoussinesq/HydrostaticBoussinesqModel.jl#L656-L680
With this technique, the state is filtered prior to the RHS calculation:
https://github.com/CliMA/ClimateMachine.jl/blob/4e317d42909bb31e535463aa13b83a4cc410058e/src/Numerics/DGMethods/DGModel.jl#L141-L147
(Note that in
HydrostaticBoussinesqModel
, the filter is only applied during the first call toupdate_auxiliary_state!
forrealelems
. Also, it's unclear whether only filtering the state can effect full overintegration. Two issues are 1. the filtered state may not be communicated correctly if filtering is implemented inupdate_auxiliary_state!
, because communication is initiated prior to callingupdate_auxiliary_state!
and 2. we may need to filter thestate_gradient_flux
; @jkozdon please advise).An alternative strategy suggested by @jkozdon is to apply a cutoff filter both to to the
state_gradient_flux
afterupdate_auxiliary_state_gradient!
:https://github.com/CliMA/ClimateMachine.jl/blob/4e317d42909bb31e535463aa13b83a4cc410058e/src/Numerics/DGMethods/DGModel.jl#L237
and after the
tendency
calculation is complete.https://github.com/CliMA/ClimateMachine.jl/blob/4e317d42909bb31e535463aa13b83a4cc410058e/src/Numerics/DGMethods/DGModel.jl#L417
Presumably, this strategy ensures that the tendency used by time steppers to update the state vector does not have energy in high, aliased modes.