Skip to content

Commit

Permalink
Merge pull request #192 from loganoz/fix/cf
Browse files Browse the repository at this point in the history
Fix/cf
  • Loading branch information
loganoz authored Nov 10, 2023
2 parents 7df024a + d462599 commit c87cdcd
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
14 changes: 10 additions & 4 deletions Solver/src/libs/mesh/SurfaceMesh.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1322,6 +1322,8 @@ Subroutine getU_tauInSurfaces(surfaces, mesh)

!local variables
integer :: surfID, faceID, i, j, meshFaceID
real(kind=RP) :: u_tau_t1, u_tau_t2


if (.not. surfaces % active) return
if (.not. surfaces % saveUt) return
Expand All @@ -1331,20 +1333,24 @@ Subroutine getU_tauInSurfaces(surfaces, mesh)
(surfaces % surfaceTypes(surfID) .eq. SURFACE_TYPE_FWH .and. .not. surfaces % mergeFWHandBC) ) cycle
if (.not. surfaces % isNoSlip(surfID)) cycle
! save u_tau_NS in each face of the no slip bc zones
!!!$omp parallel do default(shared) private(faceID,meshFaceID,i,j)
!!!$omp parallel do default(shared) private(faceID,u_tau_t1,u_tau_t2,meshFaceID,i,j)
do faceID = 1, surfaces % zones(surfID) % no_of_faces
meshFaceID = surfaces % zones(surfID) % faces(faceID)
associate( Q => mesh % faces(meshFaceID) % storage(1) % Q, &
U_x => mesh % faces(meshFaceID) % storage(1) % U_x, &
U_y => mesh % faces(meshFaceID) % storage(1) % U_y, &
U_z => mesh % faces(meshFaceID) % storage(1) % U_z, &
normal => mesh % faces(meshFaceID) % geom % normal, &
tangent => mesh % faces(meshFaceID) % geom % t1, &
tangent_1 => mesh % faces(meshFaceID) % geom % t1, &
tangent_2 => mesh % faces(meshFaceID) % geom % t2, &
u_tau => mesh % faces(meshFaceID) % storage(1) % u_tau_NS )
do j=0,mesh % faces(meshFaceID) % Nf(1) ; do i = 0, mesh % faces(meshFaceID) % Nf(2)
call getFrictionVelocity(Q(:,i,j),U_x(:,i,j),U_y(:,i,j),U_z(:,i,j),normal(:,i,j),tangent(:,i,j),u_tau(i,j))
do j=0,mesh % faces(meshFaceID) % Nf(2) ; do i = 0, mesh % faces(meshFaceID) % Nf(1)
call getFrictionVelocity(Q(:,i,j),U_x(:,i,j),U_y(:,i,j),U_z(:,i,j),normal(:,i,j),tangent_1(:,i,j),u_tau_t1)
call getFrictionVelocity(Q(:,i,j),U_x(:,i,j),U_y(:,i,j),U_z(:,i,j),normal(:,i,j),tangent_2(:,i,j),u_tau_t2)
u_tau(i,j) = sqrt(u_tau_t1**2+u_tau_t2**2)
end do ; end do
end associate

end do
!!!$omp end parallel do

Expand Down
5 changes: 4 additions & 1 deletion Solver/test/NavierStokes/NACA0012/NACA0012.control
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,7 @@ partitioning = SFC
Direction = [0.d0, 1.d0, 0.d0]
Reference surface = 1.d0
#end
-----------------------------------
-----------------------------------
surface save utau = .true.
surface save timestep = 1.D-10
boundaries to save = [AIRFOILT]
7 changes: 7 additions & 0 deletions Solver/test/NavierStokes/NACA0012/horses2plt-surface.control
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
hmesh file = "./MESH/naca_bc001_0000000000.surf.hmesh"
hsol file = "RESULTS/surfaces/naca_bc001_0000000001.surf.hsol"
output variables = Cf
output mode = FE
dimensionless = .true.
! has gradients = .true.
additional variables = "[u_tau]"

0 comments on commit c87cdcd

Please sign in to comment.