Skip to content

Commit

Permalink
avg pgradient
Browse files Browse the repository at this point in the history
  • Loading branch information
nandu90 committed May 14, 2024
1 parent e1a0e29 commit db1885f
Showing 1 changed file with 28 additions and 11 deletions.
39 changes: 28 additions & 11 deletions core/experimental/rans_wallfunctions.f
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,9 @@ subroutine pcorrected_ktau_wf(ix,iy,iz,iside,e,tw1,
save icalld
data icalld /0/

real asum
logical ifpmean

method_ut2 = 1 !tomboulides
method_ut2 = 2 !saini

Expand All @@ -326,10 +329,24 @@ subroutine pcorrected_ktau_wf(ix,iy,iz,iside,e,tw1,
! Get the surface normal
call getSnormal (usn,ix,iy,iz,iside,e)

! Get the tangent of pressure gradient
dpx = dpdx(ix,iy,iz,e)
dpy = dpdy(ix,iy,iz,e)
dpz = dpdz(ix,iy,iz,e)
! Compute using mean of pressure gradient on face
ifpmean = .true.
! ifpmean = .false.

if(.not.ifpmean)then
dpx = dpdx(ix,iy,iz,e)
dpy = dpdy(ix,iy,iz,e)
dpz = dpdz(ix,iy,iz,e)
else
call fcsum2(dpx,asum,dpdx,e,iside)
call fcsum2(dpy,asum,dpdy,e,iside)
call fcsum2(dpz,asum,dpdz,e,iside)
dpx = dpx/asum
dpy = dpy/asum
dpz = dpz/asum
endif

! Get the tangent of pressure gradient
if(if3d)then !Pressure normal
dpn = dpx*usn(1)+dpy*usn(2)+dpz*usn(3)
else
Expand Down Expand Up @@ -360,14 +377,14 @@ subroutine pcorrected_ktau_wf(ix,iy,iz,iside,e,tw1,
! Get the pressure velocity scale
up3 = visc*dpw/dens
ut3 = utold(ix,iy,iz,e)**3.0
if(up3/ut3 .gt. 0.001)then
! if(up3/ut3 .gt. 0.001)then
up = up3**(1./3.)
else
up = 0.0
dpt1 = 0.0
dpt2 = 0.0
dpw = 0.0
endif
! else
! up = 0.0
! dpt1 = 0.0
! dpt2 = 0.0
! dpw = 0.0
! endif

! Get the tangential velocity
! Velocity from previous time step should be tangential
Expand Down

0 comments on commit db1885f

Please sign in to comment.