# Does solenoidal field orthogonal to dilatational field?

 Register Blogs Members List Search Today's Posts Mark Forums Read

April 15, 2019, 19:20
#41
Senior Member

Join Date: Oct 2017
Location: United States
Posts: 228
Blog Entries: 1
Rep Power: 8
Quote:
 Originally Posted by FMDenaro "But the resulting y is practically zero" what do you mean? I run your code at w=1,16,33 and checked the y and yp vectors and they are not zero
yeah, everything is good, I guess I was looking at the wrong variable.

Anyway, for w = 33, the recovered function yp is perfectly fine; the derivative has serious errors (can see in the figure below; the exact derivative is ye = w * cos(w*x) ); the results are off by a negative sign. However, I don't see significant imaginary parts in the derivative (dydx).

What do you think?

Screen Shot 2019-04-15 at 3.18.57 PM.jpg

Code:
clearvars;  clc;    close all

N = 64;
L = 2*pi;
dx = L / N;

x = 0 : dx : L;

w = 2;
y = sin(w * x);

% FFT/iFFT
yk = fft(y(1:end-1));
yp = ifft(yk);

% derivative
k = [0:N/2-1, -N/2:-1];
dydxhat = 1i * k .* yk;

dydx = ifft(dydxhat);

dydxe = w * cos(w*x);   % exact derivative

plot(x(1:end-1), dydxe(1:end-1), 'b', x(1:end-1), real(dydx), 'r:', 'linewidth', 2)

l = legend('exact', 'numerical');
legend boxoff
set(l, 'fontsize', 14);

April 16, 2019, 04:15
#42
Senior Member

Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,192
Rep Power: 66
Quote:
 Originally Posted by TurbJet yeah, everything is good, I guess I was looking at the wrong variable. Anyway, for w = 33, the recovered function yp is perfectly fine; the derivative has serious errors (can see in the figure below; the exact derivative is ye = w * cos(w*x) ); the results are off by a negative sign. However, I don't see significant imaginary parts in the derivative (dydx). What do you think? Attachment 69426 Code: clearvars; clc; close all N = 64; L = 2*pi; dx = L / N; x = 0 : dx : L; w = 2; y = sin(w * x); % FFT/iFFT yk = fft(y(1:end-1)); yp = ifft(yk); % derivative k = [0:N/2-1, -N/2:-1]; dydxhat = 1i * k .* yk; dydx = ifft(dydxhat); dydxe = w * cos(w*x); % exact derivative plot(x(1:end-1), dydxe(1:end-1), 'b', x(1:end-1), real(dydx), 'r:', 'linewidth', 2) l = legend('exact', 'numerical'); legend boxoff set(l, 'fontsize', 14);

The effect of wavenumbers that are beyond the Nyquist frequency is clearly illustrated at page 10 of the note of Trefethen I poste above. The appearence of aliasing is worsened by the multiplication by k in the derivative

April 16, 2019, 19:09
#43
Senior Member

-
Join Date: Jul 2012
Location: Germany
Posts: 158
Rep Power: 12
Quote:
 Originally Posted by TurbJet 1. I would say no. It is just the velocity field u I am looking at. For compressible Homogeneous Isotropic Turbulence, many people decompose the velocity field into solenoidal velocity and dilatational velocity (so that they can look into the energy transfer between these two fields, for example), i.e., I am not looking for some fields that is inherently divergence-free in the compressible flow. I only want to separate the velocity field. 2. Maybe I am not correct on this pressure problem. But it does not concern me right now. 3. I am not sure if I understand this response of yours. What I meant complex, is about when I evaluating the divergence of the solenoidal velocity field (after I do the decomposition) via spectral method, namely, something like where is the inverse Fourier transform. And then the divergence Then I look at the field div, it's complex, and its real part is not exactly divergence-free.
If you want your physical data to be real, then your spectral data must be Hermitian. This leads directly to the question whether the projection operator, which you are using for your splitting, is a Hermitian operator. If this is not the case, your inverse Fourier transformation will always be complex.

If i understand you correctly, there are two possibilities:
1. You take only the real part of the data after splitting, e.g. , and reuse it to get the derivative via spectral derivative, which will result in real derivatives.

But the divergence conditions does not hold.

2. You can take the real and the imaginary part of the data (or simply dont get back to physical space after splitting) and calculate the derivative via spectral derivative, which will results in complex derivatives.

Then you take the real part of the derivatives. Here the divergence conditions does hold.

Is this correct?

April 16, 2019, 22:46
#44
Senior Member

Join Date: Oct 2017
Location: United States
Posts: 228
Blog Entries: 1
Rep Power: 8
Quote:
 Originally Posted by Eifoehn4 If you want your physical data to be real, then your spectral data must be Hermitian. This leads directly to the question whether the projection operator, which you are using for your splitting, is a Hermitian operator. If this is not the case, your inverse Fourier transformation will always be complex. If i understand you correctly, there are two possibilities: You take only the real part of the data after splitting, e.g. , and reuse it to get the derivative via spectral derivative, which will result in real derivatives. But the divergence conditions does not hold. You can take the real and the imaginary part of the data (or simply dont get back to physical space after splitting) and calculate the derivative via spectral derivative, which will results in complex derivatives. Then you take the real part of the derivatives. Here the divergence conditions does hold. Is this correct?
Yes, your 2nd point is what I did.

As for the projection operator, I think I mentioned above, but I just write it again. I follow what Pope says in his Turbulence book

where kappa is the wavenumber. Apply this operator on the velocity will give back which is the solenoidal part. Apparently it's a real-number tensor, and I think it satisfies the Hermitian.

 April 17, 2019, 02:23 #45 Senior Member     - Join Date: Jul 2012 Location: Germany Posts: 158 Rep Power: 12 Yes i also think the second one is the correct one, if your operator is not Hermitian. The first one is wrong. You claim that your inverse FFT should be only real or that your operator should be Hermitian. I don't have such an overview of the paper inside right now. Can you explain why you think this should hold? Last edited by Eifoehn4; April 17, 2019 at 03:25.

April 17, 2019, 21:08
#46
Senior Member

Join Date: Oct 2017
Location: United States
Posts: 228
Blog Entries: 1
Rep Power: 8
Quote:
 Originally Posted by Eifoehn4 Yes i also think the second one is the correct one, if your operator is not Hermitian. The first one is wrong. You claim that your inverse FFT should be only real or that your operator should be Hermitian. I don't have such an overview of the paper inside right now. Can you explain why you think this should hold?
I am not quite sure about your question. Anyway, the purpose here is to separate the solenoidal/dilatational fields, than multiply some constant to these velocity field to construct a linear forcing to the momentum eqns in physical space. I believe the very first idea of linear forcing is proposed by T.S.Lund for incompressible flow.

Since the main idea is to separate the velocity field, I think as long as everything is implemented correctly, the decomposition should return real-value solenoidal/dilatational fields. Since they are physical variables, they should be real. Of course, even if the resulting imaginary part is not perfectly zero, as long as they are close to machine precision, I believe it's fine.

For the projection tensor, as I mentioned above, it's a real-symmetric tensor, I believe it satisfies being Hermitian.

April 18, 2019, 02:56
#47
Senior Member

-
Join Date: Jul 2012
Location: Germany
Posts: 158
Rep Power: 12
Quote:
 Originally Posted by TurbJet I am not quite sure about your question. Anyway, the purpose here is to separate the solenoidal/dilatational fields, than multiply some constant to these velocity field to construct a linear forcing to the momentum eqns in physical space. I believe the very first idea of linear forcing is proposed by T.S.Lund for incompressible flow. Since the main idea is to separate the velocity field, I think as long as everything is implemented correctly, the decomposition should return real-value solenoidal/dilatational fields. Since they are physical variables, they should be real. Of course, even if the resulting imaginary part is not perfectly zero, as long as they are close to machine precision, I believe it's fine. For the projection tensor, as I mentioned above, it's a real-symmetric tensor, I believe it satisfies being Hermitian.
You say " Since they are physical variables, they should be real".

In my opinion it doesnt matter. Like FMDenaro already said, you can evaluate your polynomial basis directly in modal space

with coefficients . It is possible to super sample your whole computational domain by evaluating the modal basis, even on non equidistant points. And you wont even loose information or even have to consider what my data looks like by transformating it in a Langrange (like) representation.

Last edited by Eifoehn4; April 18, 2019 at 11:35.