[Nek5000-users] Problem with Spatial Derivatives of field

nek5000-users at lists.mcs.anl.gov nek5000-users at lists.mcs.anl.gov
Fri Mar 3 14:33:19 CST 2017


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, nek5000-users at lists.mcs.anl.gov 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:* nek5000-users-bounces at lists.mcs.anl.gov 
> [nek5000-users-bounces at lists.mcs.anl.gov] on behalf of 
> nek5000-users at lists.mcs.anl.gov [nek5000-users at lists.mcs.anl.gov]
> *Sent:* Friday, March 03, 2017 6:02 AM
> *To:* nek5000-users at lists.mcs.anl.gov
> *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
> Nek5000-users at lists.mcs.anl.gov
> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/nek5000-users/attachments/20170303/68f10564/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Image1
Type: image/jpeg
Size: 2151 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/nek5000-users/attachments/20170303/68f10564/attachment.jpe>


More information about the Nek5000-users mailing list