Problem with Spatial Derivatives of field
Hi Neks, I'm having some problems with computing the gradients of vorticity. So what I do in the usercheck is something like : call call comp_vort3(vort,work1,work2,vxp,vyp,vzp) ! Computing vorticity of perturbations call gradm1(derivvortx,derivvorty,derivvortz,vort(1,1)) However, by doing this I do observe some abnormal results when I plot the fields : derivvortx, derivvorty, derivvortz. Attached you will find a snapshot of the magnitude of derivvortx and derivvorty (obtained using paraview) I am wondering why I am having extremely high values a the boudary of the elements. Has anyone noticed or faced such a problem? Even when I increase lx1, reduce dt and reduce the mesh size, the problem remains.. Thank you for your time, Best wishes, Arnold -- *Arnold Wakim* Doctorant, Département d´Aérodynamique Fondamentale et Expérimentale Tél: +33 1 46 23 51 83 ONERA - The French Aerospace Lab -Centre de Meudon 8, rue des Vertugadins - 92190 MEUDON Nous suivre sur : www.onera.fr <http://www.onera.fr/> | Twitter <http://www.twitter.com/@onera_fr> | LinkedIn <http://www.linkedin.com/company/onera> | Facebook <http://www.facebook.fr/thefrenchaerospacelab>
Hi Arnold, The velocity is only in C^0, which means it is continuous. The first derivative is defined everywhere, but is discontinuous, meaning that the vorticity is discontinuous. The derivative of the vorticity involves the second derivative of velocity, and this is not defined. All that being said, the vorticity will converge to a continuous function exponentially fast with increasing polynomial order. So if you want to differentiate the vorticity you have the option of increasing the polynomial order. Alternatively, you can try to regularize the vorticity prior to differentiating it. A common strategy is to call dsavg( . ) for each component of vorticity -- which makes it continuous, but this wouldn't necessarily make the derivatives better. Other alternatives would be to use a combination of dsavg() and some type of low-pass filtering, e.g., by solving a Helmholtz problem of the form (I-L^2 \nabla^2) vbar = v, where L is the filter length. Another option is to look at the context in which you want to use your differentiated vorticity. Perhaps this can be recast in a weak form, in which one of the derivatives is moved onto the (continuous and differentiable) test functions, etc. hth, Paul ________________________________ From: [email protected] [[email protected]] on behalf of [email protected] [[email protected]] Sent: Friday, March 03, 2017 6:02 AM To: [email protected] Subject: [Nek5000-users] Problem with Spatial Derivatives of field Hi Neks, I'm having some problems with computing the gradients of vorticity. So what I do in the usercheck is something like : call call comp_vort3(vort,work1,work2,vxp,vyp,vzp) ! Computing vorticity of perturbations call gradm1(derivvortx,derivvorty,derivvortz,vort(1,1)) However, by doing this I do observe some abnormal results when I plot the fields : derivvortx, derivvorty, derivvortz. Attached you will find a snapshot of the magnitude of derivvortx and derivvorty (obtained using paraview) I am wondering why I am having extremely high values a the boudary of the elements. Has anyone noticed or faced such a problem? Even when I increase lx1, reduce dt and reduce the mesh size, the problem remains.. Thank you for your time, Best wishes, Arnold -- [cid:[email protected]]Arnold Wakim Doctorant, Département d´Aérodynamique Fondamentale et Expérimentale Tél: +33 1 46 23 51 83 ONERA - The French Aerospace Lab -Centre de Meudon 8, rue des Vertugadins - 92190 MEUDON Nous suivre sur : www.onera.fr<http://www.onera.fr/> | Twitter<http://www.twitter.com/@onera_fr> | LinkedIn<http://www.linkedin.com/company/onera> | Facebook<http://www.facebook.fr/thefrenchaerospacelab>
Hi Arnold, I looked into this issue some when I was trying to calculate the curvature of some of my temperature isosurfaces. Aleks Obabko suggested that I tried smoothing the derivatives across the element boundaries. So basically, I tried doing this: ! Calculate the gradient of the temperature field ! This derivative will be continuous within the element, but there will be jumps across the element boundaries call gradm1(dTdx, dTdy, dTdz, t) ! Smooth the derivative (dT/dx) so that it is continuous across the element boundaries. call col2(dTdx,bm1,n) ! collocate with the mass matrix call dssum(dTdx,nx1,ny1,nz1) ! smooth call col2(dTdx,bintm1,n) ! collocate with the inverse mass matrix (Note: dssum just returns the sum of the shared GLL points across the element boundaries.) I ran a test case, and I found that, in that case, this procedure does generate good first and second derivatives. The test case was basically just an artificial sphere that I set up in Nek5000. The temperature varied with the radius of the sphere, and my goal was to calculate smooth first and second derivatives of the temperature so that I could accurately calculate the curvature of the sphere. I looked at some comparisons between the calculated first and second derivatives and the analytical solution. Generally, the accuracy was good given the pretty low resolution that I was using. (However, in order to find the curvature, I needed to multiply, raise to powers, and divide the derivatives, so that ultimately the relatively small derivative errors were magnified into unacceptably large curvature errors.) So, ultimately, I think that this smoothing procedure should definitely work well enough for most (but not all) purposes. If you just want smooth derivatives for visualization, or you just want to measure just the derivative itself, this will probably work. In your case of looking at the derivatives of the vorticity, you could try doing this two ways and see which one works better. 1) Calculate the vorticity, smooth the vorticity, take the derivative, then smooth the derivative 2) Calculate the vorticity, take the derivative, smooth the derivative The first option has more smoothing steps, but the second option preserves the representation of the vorticity within the element as you take the derivative. Aleks generally recommends the second option. What do you need the derivatives of the vorticity for exactly? Depending on your end goal, one of the methods Paul suggested may work better than this one. Elizabeth On 03/03/2017 06:32 AM, [email protected] wrote:
Hi Arnold,
The velocity is only in C^0, which means it is continuous. The first derivative is defined everywhere, but is discontinuous, meaning that the vorticity is discontinuous.
The derivative of the vorticity involves the second derivative of velocity, and this is not defined.
All that being said, the vorticity will converge to a continuous function exponentially fast with increasing polynomial order. So if you want to differentiate the vorticity you have the option of increasing the polynomial order.
Alternatively, you can try to regularize the vorticity prior to differentiating it. A common strategy is to call dsavg( . ) for each component of vorticity -- which makes it continuous, but this wouldn't necessarily make the derivatives better. Other alternatives would be to use a combination of dsavg() and some type of low-pass filtering, e.g., by solving a Helmholtz problem of the form (I-L^2 \nabla^2) vbar = v, where L is the filter length. Another option is to look at the context in which you want to use your differentiated vorticity. Perhaps this can be recast in a weak form, in which one of the derivatives is moved onto the (continuous and differentiable) test functions, etc.
hth,
Paul
------------------------------------------------------------------------ *From:* [email protected] [[email protected]] on behalf of [email protected] [[email protected]] *Sent:* Friday, March 03, 2017 6:02 AM *To:* [email protected] *Subject:* [Nek5000-users] Problem with Spatial Derivatives of field
Hi Neks,
I'm having some problems with computing the gradients of vorticity.
So what I do in the usercheck is something like :
call call comp_vort3(vort,work1,work2,vxp,vyp,vzp) ! Computing vorticity of perturbations
call gradm1(derivvortx,derivvorty,derivvortz,vort(1,1))
However, by doing this I do observe some abnormal results when I plot the fields : derivvortx, derivvorty, derivvortz.
Attached you will find a snapshot of the magnitude of derivvortx and derivvorty (obtained using paraview)
I am wondering why I am having extremely high values a the boudary of the elements. Has anyone noticed or faced such a problem?
Even when I increase lx1, reduce dt and reduce the mesh size, the problem remains..
Thank you for your time,
Best wishes,
Arnold
--
*Arnold Wakim* Doctorant, D�partement d�A�rodynamique Fondamentale et Exp�rimentale T�l: +33 1 46 23 51 83
ONERA - The French Aerospace Lab -Centre de Meudon 8, rue des Vertugadins - 92190 MEUDON
Nous suivre sur : www.onera.fr <http://www.onera.fr/> | Twitter <http://www.twitter.com/@onera_fr> | LinkedIn <http://www.linkedin.com/company/onera> | Facebook <http://www.facebook.fr/thefrenchaerospacelab>
_______________________________________________ Nek5000-users mailing list [email protected] https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users
Good Morning, Sorry for taking so long to answer. First I wanted to say that I really appreciate all of your help! I am currently trying all these methods : - as suggested by Paul Fischer, increasing LX1 and low pass filtering. - and smoothing the derivatives. I will keep you posted on the results. What I am trying to do is studying optimal perturbations using a DIRECT-ADJOINT approach so as to optimize quantities. However, when I am writing the equations, I have no choice but taking the spatial derivatives of vorticity. Computing the derivatives is made for every DIRECT Numerical Simulation of the perturbations. Then I call the ADJOINT solver of Nek5000 In order to converge towards optimum this may take several iterations let's say N ( roughly N=10 however since the gradients are not well resolved then I cannot tell whether I'm converged or not). The point is that I am computing vorticity, then computing the gradients of the same initial field, and this, N times. This leads to the problem I am facing. Hope that helps understanding the issue. If you have more questions, please do not hesitate to ask. Best wishes, Arnold Le 03/03/2017 � 21:33, [email protected] a �crit :
call col2(dTdx,bm1,n) ! collocate with the mass matrix call dssum(dTdx,nx1,ny1,nz1) ! smooth call col2(dTdx,bintm1,n) ! collocate with the inverse mass matrix
-- *Arnold Wakim* Doctorant, D�partement d�A�rodynamique Fondamentale et Exp�rimentale T�l: +33 1 46 23 51 83 ONERA - The French Aerospace Lab -Centre de Meudon 8, rue des Vertugadins - 92190 MEUDON Nous suivre sur : www.onera.fr <http://www.onera.fr/> | Twitter <http://www.twitter.com/@onera_fr> | LinkedIn <http://www.linkedin.com/company/onera> | Facebook <http://www.facebook.fr/thefrenchaerospacelab>
participants (1)
-
nek5000-users@lists.mcs.anl.gov