You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For multi-dimensional Eigenvalue Problems solved using our current best-practices approach (see examples/evp_1d_rayleigh_benard/rayleigh_benard_evp.py) we run into an edge case with set_modes() when trying to plot eigenmodes.
Best practices are to set up a small dimension in the wave-perturbation direction of size Nx=2, and length Lx = 2 * np.pi / kx, which puts the mode to be studied in the second index. When we do this, and then use set_state, the associated fields have values in coefficient space, but the first transform to grid space zeros out all of the data.
Here is a minimal example that reproduces this, using Rayleigh-Benard convection with stress-free boundaries (where the modes are analytic).:
omega = (3.924211175128554e-20+0.0002884588085073608j)
b[c] max amp = 0.48998225974907084
b[g] max amp = 0.0
b[c] max amp = 0.0
The correct mode is found (an unstable growing mode), but the eigenfunction is zero when evaluated in grid space and remains that way on return to coeff space.
This is related to zeroing of Nyquist modes.
If Nx = 4 is used instead of Nx = 2, then correct behaviour is instead found:
omega = (3.924211175128554e-20+0.0002884588085073608j)
b[c] max amp = 0.48998225974907084
b[g] max amp = 0.5852474523582276
b[c] max amp = 0.4899822597490708
Now the eigenmodes are not zeroed on transform, retain the same coeff amplitudes on return to coeff space, and match both eigenvalue and coeff amplitude with the original implementation. The individual eigenmode structures now also match expectations.
The text was updated successfully, but these errors were encountered:
It's unclear what we want to do to change things here. We could stop zeroing the Nyquist mode for ComplexFourier, which is generally what is used with EVPs. But I think we do want to continue dropping the Nyquist mode for RealFourier since otherwise there will be weird matrix shape errors since only the cosine mode is supported there. That would mean real and complex Fourier have different behavior... but maybe that isn't so bad?
For multi-dimensional Eigenvalue Problems solved using our current best-practices approach (see
examples/evp_1d_rayleigh_benard/rayleigh_benard_evp.py
) we run into an edge case withset_modes()
when trying to plot eigenmodes.Best practices are to set up a small dimension in the wave-perturbation direction of size
Nx=2
, and lengthLx = 2 * np.pi / kx
, which puts the mode to be studied in the second index. When we do this, and then useset_state
, the associated fields have values in coefficient space, but the first transform to grid space zeros out all of the data.Here is a minimal example that reproduces this, using Rayleigh-Benard convection with stress-free boundaries (where the modes are analytic).:
The result of this script is:
The correct mode is found (an unstable growing mode), but the eigenfunction is zero when evaluated in grid space and remains that way on return to coeff space.
This is related to zeroing of Nyquist modes.
If
Nx = 4
is used instead ofNx = 2
, then correct behaviour is instead found:Now the eigenmodes are not zeroed on transform, retain the same coeff amplitudes on return to coeff space, and match both eigenvalue and coeff amplitude with the original implementation. The individual eigenmode structures now also match expectations.
The text was updated successfully, but these errors were encountered: