Compute the derivatives
Hi Nek's, I have a home-made global stability code, but in order to use it I first need to compute the derivatives of my base flow: dUdX, dUdY, dVdX, dVdY. How could one compute these derivatives using Nek 5k and drop them along with X Y U V in the blah.f**** file (or perhaps another .f**** file) ? I assume I have to make use of the subroutine *dudxyz (du,u,rm1,sm1,tm1,jm1,imsh,isd)*, but I'm not sure what to put as inputs. Regards, JC
dudxyz is somewhat dated and slow... I recommend somthing like: parameter (lt=lx1*ly1*lz1*lelv) common /mygrad/ vxx(lt),vxy(lt),vxz(lt) $ , vyx(lt),vyy(lt),vyz(lt) $ , vzx(lt),vzy(lt),vzz(lt) call gradm1(vxx,vxy,vxz,vx) call gradm1(vyx,vyy,vyz,vy) call gradm1(vzx,vzy,vzz,vz) Note that putting these arrays into a common block, as shown, is a good idea for several reasons, one of which is that it guarantees that the data will be byte-aligned with the cache line. On some machines (e.g., BG/P) this is crucial for proper functionality - for this reason we don't mix variable types in a given common block. If you subsequently wish to access elements of vxx etc. on an element-by-element basis you can of course do something like parameter (lt=lx1*ly1*lz1) common /mygrad/ vxx(lt,lelt),vxy(lt,lelt),vxz(lt,lelt) : : Paul On Wed, 2 Jun 2010, [email protected] wrote:
Hi Nek's,
I have a home-made global stability code, but in order to use it I first need to compute the derivatives of my base flow: dUdX, dUdY, dVdX, dVdY. How could one compute these derivatives using Nek 5k and drop them along with X Y U V in the blah.f**** file (or perhaps another .f**** file) ? I assume I have to make use of the subroutine *dudxyz (du,u,rm1,sm1,tm1,jm1,imsh,isd)*, but I'm not sure what to put as inputs.
Regards, JC
Hi JC, To dump the computed derivatives into separate field files you can use in userchk ifxyo = .true. ! for cooordinates ifpo = .false. ! turn off pressure output ifto = .false. ! turn off pressure output call outpost(vxx,vxy,vxz,pr,t,'dvx') call outpost(vyx,vyy,vyz,pr,t,'dvy') ... Best, Aleks On Wed, 2 Jun 2010, [email protected] wrote:
dudxyz is somewhat dated and slow...
I recommend somthing like:
parameter (lt=lx1*ly1*lz1*lelv) common /mygrad/ vxx(lt),vxy(lt),vxz(lt) $ , vyx(lt),vyy(lt),vyz(lt) $ , vzx(lt),vzy(lt),vzz(lt)
call gradm1(vxx,vxy,vxz,vx) call gradm1(vyx,vyy,vyz,vy) call gradm1(vzx,vzy,vzz,vz)
Note that putting these arrays into a common block, as shown, is a good idea for several reasons, one of which is that it guarantees that the data will be byte-aligned with the cache line. On some machines (e.g., BG/P) this is crucial for proper functionality - for this reason we don't mix variable types in a given common block.
If you subsequently wish to access elements of vxx etc. on an element-by-element basis you can of course do something like
parameter (lt=lx1*ly1*lz1) common /mygrad/ vxx(lt,lelt),vxy(lt,lelt),vxz(lt,lelt) : :
Paul
On Wed, 2 Jun 2010, [email protected] wrote:
Hi Nek's,
I have a home-made global stability code, but in order to use it I first need to compute the derivatives of my base flow: dUdX, dUdY, dVdX, dVdY. How could one compute these derivatives using Nek 5k and drop them along with X Y U V in the blah.f**** file (or perhaps another .f**** file) ? I assume I have to make use of the subroutine *dudxyz (du,u,rm1,sm1,tm1,jm1,imsh,isd)*, but I'm not sure what to put as inputs.
Regards, JC
_______________________________________________ Nek5000-users mailing list [email protected] https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users
Hi all, Thanks for the tip Aleks. Anyway, I have another question. When I visualize the computed derivatives using VisIt or Tecplot, it appears that discontinuities exist at the interfaces between elements. Is that normal or did I screw up something when setting up the calculation ? Thanks, JC PS: Attached is a small portion of my computational domain on which one can clearly see the discontinuities.
That's ok! The SEM solution is by construction in C0 but not in C1. Note: The jump in the derivative vanishes if N -> infty. If you want to force the derivative to be in C0 just use dssum(). Hth, Stefan On Jun 8, 2010, at 2:30 PM, [email protected] wrote:
Hi all,
Thanks for the tip Aleks. Anyway, I have another question. When I visualize the computed derivatives using VisIt or Tecplot, it appears that discontinuities exist at the interfaces between elements. Is that normal or did I screw up something when setting up the calculation ?
Thanks,
JC
PS: Attached is a small portion of my computational domain on which one can clearly see the discontinuities. _______________________________________________ Nek5000-users mailing list [email protected] https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users
Are you viewing derivatives computed w/ nek, and then dumped and visualized by VisIt? Or are these derivatives computed inside one of the vis packages? (don't know if that's even possible...) If you are well-resolved, derivatives will appear continuous. If you are marginally resolved, they may or may not appear continuous, since the underlying basis is only C0. One option is, say, call gradm1(tx,ty,tz,t) call dsavg(tx) call dsavg(ty) call dsavg(tz) which would project appropriately declared arrays tx,ty,tz into C0 --- it does not always make things look better, but often does. Also, it will make visit happy since Visit expects to visualize C0 fields. hth Paul On Tue, 8 Jun 2010, [email protected] wrote:
Hi all,
Thanks for the tip Aleks. Anyway, I have another question. When I visualize the computed derivatives using VisIt or Tecplot, it appears that discontinuities exist at the interfaces between elements. Is that normal or did I screw up something when setting up the calculation ?
Thanks,
JC
PS: Attached is a small portion of my computational domain on which one can clearly see the discontinuities. _______________________________________________ Nek5000-users mailing list [email protected] https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users
Hi Paul and Aleks, I have a question regarding this. I have implemented this and it is working nicely, however it is dumping out a .f file every step, rather than every iotime step I have specified in the rea. Do you know how to fix this? - Michael ----- Original Message ----- From: [email protected] To: [email protected] Sent: Wednesday, June 2, 2010 10:57:41 AM GMT -06:00 US/Canada Central Subject: Re: [Nek5000-users] Compute the derivatives Hi JC, To dump the computed derivatives into separate field files you can use in userchk ifxyo = .true. ! for cooordinates ifpo = .false. ! turn off pressure output ifto = .false. ! turn off pressure output call outpost(vxx,vxy,vxz,pr,t,'dvx') call outpost(vyx,vyy,vyz,pr,t,'dvy') ... Best, Aleks On Wed, 2 Jun 2010, [email protected] wrote:
dudxyz is somewhat dated and slow...
I recommend somthing like:
parameter (lt=lx1*ly1*lz1*lelv) common /mygrad/ vxx(lt),vxy(lt),vxz(lt) $ , vyx(lt),vyy(lt),vyz(lt) $ , vzx(lt),vzy(lt),vzz(lt)
call gradm1(vxx,vxy,vxz,vx) call gradm1(vyx,vyy,vyz,vy) call gradm1(vzx,vzy,vzz,vz)
Note that putting these arrays into a common block, as shown, is a good idea for several reasons, one of which is that it guarantees that the data will be byte-aligned with the cache line. On some machines (e.g., BG/P) this is crucial for proper functionality - for this reason we don't mix variable types in a given common block.
If you subsequently wish to access elements of vxx etc. on an element-by-element basis you can of course do something like
parameter (lt=lx1*ly1*lz1) common /mygrad/ vxx(lt,lelt),vxy(lt,lelt),vxz(lt,lelt) : :
Paul
On Wed, 2 Jun 2010, [email protected] wrote:
Hi Nek's,
I have a home-made global stability code, but in order to use it I first need to compute the derivatives of my base flow: dUdX, dUdY, dVdX, dVdY. How could one compute these derivatives using Nek 5k and drop them along with X Y U V in the blah.f**** file (or perhaps another .f**** file) ? I assume I have to make use of the subroutine *dudxyz (du,u,rm1,sm1,tm1,jm1,imsh,isd)*, but I'm not sure what to put as inputs.
Regards, JC
_______________________________________________ Nek5000-users mailing list [email protected] https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users
_______________________________________________ Nek5000-users mailing list [email protected] https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users
participants (1)
-
nek5000-users@lists.mcs.anl.gov