Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions src/adjoint/outputForward/sa_d.f90
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ subroutine sasource_d()
real(kind=realtype), parameter :: f23=two*third
! local variables.
integer(kind=inttype) :: i, j, k, nn, ii
real(kind=realtype) :: cv13, kar2inv, cw36, cb3inv
real(kind=realtype) :: fv1, fv2, ft2
real(kind=realtype) :: fv1d, fv2d, ft2d
real(kind=realtype) :: ss, sst, nu, dist2inv, chi, chi2, chi3
Expand Down Expand Up @@ -491,6 +492,7 @@ subroutine sasource()
real(kind=realtype), parameter :: f23=two*third
! local variables.
integer(kind=inttype) :: i, j, k, nn, ii
real(kind=realtype) :: cv13, kar2inv, cw36, cb3inv
real(kind=realtype) :: fv1, fv2, ft2
real(kind=realtype) :: ss, sst, nu, dist2inv, chi, chi2, chi3
real(kind=realtype) :: rr, gg, gg6, termfw, fwsa, term1, term2
Expand Down Expand Up @@ -684,6 +686,7 @@ subroutine saviscous_d()
implicit none
! local variables.
integer(kind=inttype) :: i, j, k, nn, ii
real(kind=realtype) :: cb3inv
real(kind=realtype) :: nu
real(kind=realtype) :: nud
real(kind=realtype) :: fv1, fv2, ft2
Expand All @@ -700,10 +703,7 @@ subroutine saviscous_d()
real(kind=realtype) :: temp
real(kind=realtype) :: temp0
real(kind=realtype) :: temp1
! set model constants
cv13 = rsacv1**3
kar2inv = one/rsak**2
cw36 = rsacw3**6
! set model constant
cb3inv = one/rsacb3
!
! viscous terms in k-direction.
Expand Down Expand Up @@ -1092,17 +1092,15 @@ subroutine saviscous()
implicit none
! local variables.
integer(kind=inttype) :: i, j, k, nn, ii
real(kind=realtype) :: cb3inv
real(kind=realtype) :: nu
real(kind=realtype) :: fv1, fv2, ft2
real(kind=realtype) :: voli, volmi, volpi, xm, ym, zm, xp, yp, zp
real(kind=realtype) :: xa, ya, za, ttm, ttp, cnud, cam, cap
real(kind=realtype) :: nutm, nutp, num, nup, cdm, cdp
real(kind=realtype) :: c1m, c1p, c10, b1, c1, d1, qs
intrinsic max
! set model constants
cv13 = rsacv1**3
kar2inv = one/rsak**2
cw36 = rsacw3**6
! set model constant
cb3inv = one/rsacb3
!
! viscous terms in k-direction.
Expand Down
11 changes: 6 additions & 5 deletions src/adjoint/outputReverse/sa_b.f90
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ subroutine sasource_b()
real(kind=realtype), parameter :: f23=two*third
! local variables.
integer(kind=inttype) :: i, j, k, nn, ii
real(kind=realtype) :: cv13, kar2inv, cw36, cb3inv
real(kind=realtype) :: fv1, fv2, ft2
real(kind=realtype) :: fv1d, fv2d, ft2d
real(kind=realtype) :: ss, sst, nu, dist2inv, chi, chi2, chi3
Expand Down Expand Up @@ -511,6 +512,7 @@ subroutine sasource()
real(kind=realtype), parameter :: f23=two*third
! local variables.
integer(kind=inttype) :: i, j, k, nn, ii
real(kind=realtype) :: cv13, kar2inv, cw36, cb3inv
real(kind=realtype) :: fv1, fv2, ft2
real(kind=realtype) :: ss, sst, nu, dist2inv, chi, chi2, chi3
real(kind=realtype) :: rr, gg, gg6, termfw, fwsa, term1, term2
Expand Down Expand Up @@ -706,6 +708,7 @@ subroutine saviscous_b()
implicit none
! local variables.
integer(kind=inttype) :: i, j, k, nn, ii
real(kind=realtype) :: cb3inv
real(kind=realtype) :: nu
real(kind=realtype) :: nud
real(kind=realtype) :: fv1, fv2, ft2
Expand All @@ -725,7 +728,7 @@ subroutine saviscous_b()
real(kind=realtype) :: temp0
real(kind=realtype) :: tempd0
integer :: branch
! set model constants
! set model constant
cb3inv = one/rsacb3
!$bwd-of ii-loop
do ii=0,nx*ny*nz-1
Expand Down Expand Up @@ -1198,6 +1201,7 @@ subroutine saviscous()
implicit none
! local variables.
integer(kind=inttype) :: i, j, k, nn, ii
real(kind=realtype) :: cb3inv
real(kind=realtype) :: nu
real(kind=realtype) :: fv1, fv2, ft2
real(kind=realtype) :: voli, volmi, volpi, xm, ym, zm, xp, yp, zp
Expand All @@ -1206,10 +1210,7 @@ subroutine saviscous()
real(kind=realtype) :: c1m, c1p, c10, b1, c1, d1, qs
intrinsic mod
intrinsic max
! set model constants
cv13 = rsacv1**3
kar2inv = one/rsak**2
cw36 = rsacw3**6
! set model constant
cb3inv = one/rsacb3
!$ad ii-loop
!
Expand Down
11 changes: 6 additions & 5 deletions src/adjoint/outputReverseFast/sa_fast_b.f90
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ subroutine sasource_fast_b()
real(kind=realtype), parameter :: f23=two*third
! local variables.
integer(kind=inttype) :: i, j, k, nn, ii
real(kind=realtype) :: cv13, kar2inv, cw36, cb3inv
real(kind=realtype) :: fv1, fv2, ft2
real(kind=realtype) :: fv1d, fv2d, ft2d
real(kind=realtype) :: ss, sst, nu, dist2inv, chi, chi2, chi3
Expand Down Expand Up @@ -444,6 +445,7 @@ subroutine sasource()
real(kind=realtype), parameter :: f23=two*third
! local variables.
integer(kind=inttype) :: i, j, k, nn, ii
real(kind=realtype) :: cv13, kar2inv, cw36, cb3inv
real(kind=realtype) :: fv1, fv2, ft2
real(kind=realtype) :: ss, sst, nu, dist2inv, chi, chi2, chi3
real(kind=realtype) :: rr, gg, gg6, termfw, fwsa, term1, term2
Expand Down Expand Up @@ -635,6 +637,7 @@ subroutine saviscous_fast_b()
implicit none
! local variables.
integer(kind=inttype) :: i, j, k, nn, ii
real(kind=realtype) :: cb3inv
real(kind=realtype) :: nu
real(kind=realtype) :: nud
real(kind=realtype) :: fv1, fv2, ft2
Expand All @@ -652,7 +655,7 @@ subroutine saviscous_fast_b()
real(kind=realtype) :: tempd
real(kind=realtype) :: tempd0
integer :: branch
! set model constants
! set model constant
cb3inv = one/rsacb3
!$bwd-of ii-loop
do ii=0,nx*ny*nz-1
Expand Down Expand Up @@ -1020,6 +1023,7 @@ subroutine saviscous()
implicit none
! local variables.
integer(kind=inttype) :: i, j, k, nn, ii
real(kind=realtype) :: cb3inv
real(kind=realtype) :: nu
real(kind=realtype) :: fv1, fv2, ft2
real(kind=realtype) :: voli, volmi, volpi, xm, ym, zm, xp, yp, zp
Expand All @@ -1028,10 +1032,7 @@ subroutine saviscous()
real(kind=realtype) :: c1m, c1p, c10, b1, c1, d1, qs
intrinsic mod
intrinsic max
! set model constants
cv13 = rsacv1**3
kar2inv = one/rsak**2
cw36 = rsacw3**6
! set model constant
cb3inv = one/rsacb3
!$ad ii-loop
!
Expand Down
11 changes: 7 additions & 4 deletions src/turbulence/sa.F90
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ subroutine saSource

! Local variables.
integer(kind=intType) :: i, j, k, nn, ii
real(kind=realType) :: cv13, kar2Inv, cw36, cb3Inv
real(kind=realType) :: fv1, fv2, ft2
real(kind=realType) :: ss, sst, nu, dist2Inv, chi, chi2, chi3
real(kind=realType) :: rr, gg, gg6, termFw, fwSa, term1, term2
Expand Down Expand Up @@ -354,6 +355,7 @@ subroutine saViscous
implicit none
! Local variables.
integer(kind=intType) :: i, j, k, nn, ii
real(kind=realType) :: cb3Inv
real(kind=realType) :: nu
real(kind=realType) :: fv1, fv2, ft2
real(kind=realType) :: voli, volmi, volpi, xm, ym, zm, xp, yp, zp
Expand All @@ -362,10 +364,7 @@ subroutine saViscous
real(kind=realType) :: c1m, c1p, c10, b1, c1, d1, qs


! Set model constants
cv13 = rsaCv1**3
kar2Inv = one / (rsaK**2)
cw36 = rsaCw3**6
! Set model constant
cb3Inv = one / rsaCb3

!
Expand Down Expand Up @@ -720,6 +719,7 @@ subroutine saSolve
! original Spalart-Allmaras model in a decoupled manner using
! a diagonal dominant ADI-scheme.
use blockPointers
use constants
use inputIteration
use inputPhysics
use paramTurb
Expand All @@ -728,6 +728,7 @@ subroutine saSolve
implicit none

integer(kind=intType) :: i, j, k, nn, ii
real(kind=realType) :: cb3Inv
real(kind=realType), dimension(2:max(kl, il, jl)) :: bb, cc, dd, ff
real(kind=realType) :: voli, volmi, volpi, xm, ym, zm, xp, yp, zp
real(kind=realType) :: xa, ya, za, ttm, ttp, cnud, cam, cap
Expand All @@ -740,6 +741,8 @@ subroutine saSolve
logical, dimension(2:il, 2:jl), target :: flagK2, flagKl
logical, dimension(:, :), pointer :: flag

! Set model constant
cb3Inv = one / rsaCb3

! Initialize the wall function flags to .false.

Expand Down