CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

Does solenoidal field orthogonal to dilatational field?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 15, 2019, 19:20
Default
  #41
Senior Member
 
Join Date: Oct 2017
Location: United States
Posts: 233
Blog Entries: 1
Rep Power: 10
TurbJet is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
"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);
TurbJet is offline   Reply With Quote

Old   April 16, 2019, 04:15
Default
  #42
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,896
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by TurbJet View Post
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
FMDenaro is offline   Reply With Quote

Old   April 16, 2019, 19:09
Default
  #43
Senior Member
 
Eifoehn4's Avatar
 
-
Join Date: Jul 2012
Location: Germany
Posts: 184
Rep Power: 14
Eifoehn4 is on a distinguished road
Quote:
Originally Posted by TurbJet View Post
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.,

\bold{u} = \bold{u}_{solenoidal} + \bold{u}_{dilatational}

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

\frac{\partial u}{\partial x} = \mathcal{F}^{-1}(ik\hat{F}_\kappa)

where F^{-1} is the inverse Fourier transform. And then the divergence

div(x, y, z) = \frac{\partial u}{\partial x} + \frac{\partial v}{\partial y} + \frac{\partial w}{\partial z}

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. u^{\bot}, 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?
Eifoehn4 is offline   Reply With Quote

Old   April 16, 2019, 22:46
Default
  #44
Senior Member
 
Join Date: Oct 2017
Location: United States
Posts: 233
Blog Entries: 1
Rep Power: 10
TurbJet is on a distinguished road
Quote:
Originally Posted by Eifoehn4 View Post
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. u^{\bot}, 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?
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

\mathcal{P}_{ij} = \delta_{ij} + \frac{\kappa_i\kappa_j}{\kappa^2}

where kappa is the wavenumber. Apply this operator on the velocity will give back \hat{u}^{\bot} which is the solenoidal part. Apparently it's a real-number tensor, and I think it satisfies the Hermitian.
TurbJet is offline   Reply With Quote

Old   April 17, 2019, 02:23
Default
  #45
Senior Member
 
Eifoehn4's Avatar
 
-
Join Date: Jul 2012
Location: Germany
Posts: 184
Rep Power: 14
Eifoehn4 is on a distinguished road
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.
Eifoehn4 is offline   Reply With Quote

Old   April 17, 2019, 21:08
Default
  #46
Senior Member
 
Join Date: Oct 2017
Location: United States
Posts: 233
Blog Entries: 1
Rep Power: 10
TurbJet is on a distinguished road
Quote:
Originally Posted by Eifoehn4 View Post
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.
TurbJet is offline   Reply With Quote

Old   April 18, 2019, 02:56
Default
  #47
Senior Member
 
Eifoehn4's Avatar
 
-
Join Date: Jul 2012
Location: Germany
Posts: 184
Rep Power: 14
Eifoehn4 is on a distinguished road
Quote:
Originally Posted by TurbJet View Post
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

U(x)= \sum_{k=0}^N \hat{a}_k \cos{k \omega x} +\hat{b}_k \sin{k \omega x} =\sum_{k=0}^N \hat{c}_k e^{ikx}

\hat{c}_k = \begin{cases} \hat{a}_0 , \quad\quad\quad\quad\quad \hspace{0.3cm} \text{if}~k=0 \\ 1/2 ( \hat{a}_k+i \hat{b}_k ), \quad \text{if}~ k<0 \\ 1/2 ( \hat{a}_k-i \hat{b}_k ), \quad \text{if}~ k>0 \end{cases}

with coefficients a_k,~b_k. 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.
Eifoehn4 is offline   Reply With Quote

Reply

Tags
compressible flow, dilatational, helmholtz decomposition, solenoidal


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
simpleDyMFoam on v1806 gamemakerh OpenFOAM Programming & Development 0 November 8, 2018 09:15
potential flows, helmholtz decomposition and other stuffs pigna Main CFD Forum 1 October 26, 2017 09:34
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 07:20
Zero size field taranov OpenFOAM Bugs 2 April 20, 2010 05:51
Problem with rhoSimpleFoam matteo_gautero OpenFOAM Running, Solving & CFD 0 February 28, 2008 07:51


All times are GMT -4. The time now is 16:42.