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

Issue with Helmholtz (Hodge) decomposition

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 26, 2019, 16:28
Default Issue with Helmholtz (Hodge) decomposition
  #1
Senior Member
 
Join Date: Oct 2017
Location: United States
Posts: 233
Blog Entries: 1
Rep Power: 9
TurbJet is on a distinguished road
Greetings,

I am doing decaying compressible homogeneous isotropic turbulence. I need Helmholtz decomposition to separate the solenoidal and dilatational velocity fields. This is the decomposition I am following (according to Wikipedia)
\textbf{u} = \nabla\times\textbf{A} - \nabla\Phi
where A is a vector field, and Phi is a scalar field.

I wrote my own code in MATLAB. Here is a pseudo-code for solving the Poisson equation resulting from the Helmholtz decomposition
Code:
b = \nabla\cdot\textbf{u}
\hat{b} = fft(b)
\hat{\Phi} = \frac{\hat{b}}{kx^2 + ky^2 + kz^2}
\Phi = ifft(\hat{\Phi})
\nabla\times\textbf{A} = \textbf{u} - (-\nabla\Phi)
Here, kx, ky, kz are wave numbers in each direction. Also, I use 4th-order difference for evaluating gradient and divergence: central difference for interior grid points, one-sided difference for boundary points.

I apply the code to the solution of the turbulence. The turbulence is solved with 4th-order DRP in space and 4th-order RK in time.

Apparently, the solenoidal velocity field is equal to \nabla\times\textbf{A}, and the dilatational velocity field is equal to \nabla\Phi. However, when I compute the divergence of the solenoidal velocity field in order to verify my code, it doesn't return zero divergence; instead, I have maximum divergence around 1.4, average divergence in the domain is around 1.13e-4, seems like the resulting solenoidal field is not divergence-free.

I went over my code over and over again. As far as I could, I can't find any bug. The finite difference for computing the gradient and divergence is verified, it should not be a problem. The spectral method does not look wrong to me. So I am lost. Could anyone provide some hints or suggestions? Or is there any benchmark case that I can use for verifying my code? I tried Taylor-Green vortex, but this is not challenging enough.

PS:
1. Is it possible that this error is due to the one-sided difference near the boundaries?
2. Is it possible this error is due the the mixture usage of finite difference and spectral method?

Appreciate it!
TurbJet is offline   Reply With Quote

Old   February 26, 2019, 17:09
Default
  #2
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,772
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by TurbJet View Post
Greetings,

I am doing decaying compressible homogeneous isotropic turbulence. I need Helmholtz decomposition to separate the solenoidal and dilatational velocity fields. This is the decomposition I am following (according to Wikipedia)
\textbf{u} = \nabla\times\textbf{A} - \nabla\Phi
where A is a vector field, and Phi is a scalar field.

I wrote my own code in MATLAB. Here is a pseudo-code for solving the Poisson equation resulting from the Helmholtz decomposition
Code:
b = \nabla\cdot\textbf{u}
\hat{b} = fft(b)
\hat{\Phi} = \frac{\hat{b}}{kx^2 + ky^2 + kz^2}
\Phi = ifft(\hat{\Phi})
\nabla\times\textbf{A} = \textbf{u} - (-\nabla\Phi)
Here, kx, ky, kz are wave numbers in each direction. Also, I use 4th-order difference for evaluating gradient and divergence: central difference for interior grid points, one-sided difference for boundary points.

I apply the code to the solution of the turbulence. The turbulence is solved with 4th-order DRP in space and 4th-order RK in time.

Apparently, the solenoidal velocity field is equal to \nabla\times\textbf{A}, and the dilatational velocity field is equal to \nabla\Phi. However, when I compute the divergence of the solenoidal velocity field in order to verify my code, it doesn't return zero divergence; instead, I have maximum divergence around 1.4, average divergence in the domain is around 1.13e-4, seems like the resulting solenoidal field is not divergence-free.

I went over my code over and over again. As far as I could, I can't find any bug. The finite difference for computing the gradient and divergence is verified, it should not be a problem. The spectral method does not look wrong to me. So I am lost. Could anyone provide some hints or suggestions? Or is there any benchmark case that I can use for verifying my code? I tried Taylor-Green vortex, but this is not challenging enough.

PS:
1. Is it possible that this error is due to the one-sided difference near the boundaries?
2. Is it possible this error is due the the mixture usage of finite difference and spectral method?

Appreciate it!



There are lot of hidden issues when you start from the HH decomposition in continuous form and then use it after a discretization.

The discrete operators must be congruent and a specific setting of the BCs is required.
First of all, I suggest to use standard second order derivative and write the Div Grad operator in discrete form.


More details can be found in my paper here https://www.researchgate.net/publica...ary_conditions
FMDenaro is offline   Reply With Quote

Reply

Tags
compressible turbulence, helmholtz decomposition


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
Issue on zeroGradient BC for system rotation magnushaese OpenFOAM Running, Solving & CFD 2 January 28, 2022 13:43
rhoCentralFoam inviscid airfoil issue (Foam::error::printStack(Foam::Ostream&) at ??) kmkb21 OpenFOAM Running, Solving & CFD 1 March 1, 2018 01:07
Prism Layer - Core Mesh Boundary Issue InfernoxCJC STAR-CCM+ 7 November 21, 2017 15:46
potential flows, helmholtz decomposition and other stuffs pigna Main CFD Forum 1 October 26, 2017 08:34
foamToTecplot360 issue with multiregion solvers manuc OpenFOAM Post-Processing 2 November 21, 2016 13:51


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