Obtaining Pressure Coefficient on the airfoil

197 views
Skip to first unread message

CFD Engineer

unread,
Aug 22, 2021, 1:29:40 AM8/22/21
to Nek5000
Hello Nek experts,

I am simulating flow over an airfoil (2D & 3D) in Nek5000 and have the results with me for both the cases. I have 2 separate walls (one upper and one lower wall of airfoil) and need to compute average pressure coefficient on both the walls separately (lower and upper).

So far what I came up with is to include the following subroutine in my usr file to get the average pressure. But dont know what should I do to get the pressure coefficient value from it. Any sort of help will be highly appreciated.


Thanks



      subroutine planar_avg_pressure(pa,p,hndl)

      include 'SIZE'
      include 'TOTAL'

      real pa(*)
      real p (*)
      common /scrcg/ wrk(lx2*ly2*lz2*lelv)

      n = nx2*ny2*nz2*nelv

      call copy(wrk,bm2,n)                   ! Set the averaging weights
      call fgslib_gs_op(hndl,wrk,1,1,0) ! Sum weights
      call invcol1(wrk,n)

      do i=1,n
         pa(i) = bm2(i,1,1,1)*p(i)*wrk(i)
      enddo

      call fgslib_gs_op(hndl,pa,1,1,0) ! Sum weighted values

      return
      end 


Fischer, Paul

unread,
Aug 22, 2021, 10:59:58 AM8/22/21
to CFD Engineer, Nek5000
I recommend to look at subroutine torque_calc in navier5.f

There are examples of this being called in nekexamples
(grep torq */*.usr).

You can define the upper surface of your airfoil as object 1
and the lower half as object 2

torque calc will report the integrals over the individual objects (each, just a collection of faces) as well as the sum over all
objects.

You will get forces in x and y direction as well as moments (torque) about a prescribed point, x0.

hth,

Paul


  subroutine torque_calc(scale,x0,ifdout,iftout)




From: nek...@googlegroups.com <nek...@googlegroups.com> on behalf of CFD Engineer <gr8be...@gmail.com>
Sent: Sunday, August 22, 2021 12:29 AM
To: Nek5000 <nek...@googlegroups.com>
Subject: [nek5000] Obtaining Pressure Coefficient on the airfoil
 
--
You received this message because you are subscribed to the Google Groups "Nek5000" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nek5000+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nek5000/aafb2f2e-87ab-4cc8-915a-e80e3735e254n%40googlegroups.com.

CFD Engineer

unread,
Aug 26, 2021, 11:28:11 PM8/26/21
to Nek5000
Thank you so much for your reply. I've a bit of confusion, from your explanation it seems that I will get an integral value of cp (pressure coefficient) along each surface of my airfoil. But infact what I am looking for is to obtain cp vs airfoil surface plot. So, I need a sub-routine to plot cp along the wall of my airfoil. Could you please clarify further if I am able to do that somehow?

Thanks.
Reply all
Reply to author
Forward
0 new messages