ADflow  v1.0
ADflow is a finite volume RANS solver tailored for gradient-based aerodynamic design optimization.
setCpTarget.f90
Go to the documentation of this file.
1 subroutine setcptargets(cptarget, npts, sps_in)
2  use constants
3  use blockpointers
6  use communication
7  use inputphysics
8  use utils, only: setpointers
9  implicit none
10  !
11  ! Arguments.
12  !
13  integer(kind=intType), intent(in) :: npts, sps_in
14  real(kind=realtype), intent(in) :: cptarget(npts)
15  !
16  ! Local variables.
17  !
18  integer(kind=intType) :: mm, nn, i, j, ii, sps
19  !integer(kind=intType) :: iBeg, iEnd, jBeg, jEnd
20 
21  sps = sps_in
22 
23  ii = 0
24  domains: do nn = 1, ndom
25  call setpointers(nn, 1_inttype, sps)
26 
27  ! Loop over the number of viscous boundary subfaces of this block.
28  ! According to preprocessing/viscSubfaceInfo, visc bocos are numbered
29  ! before other bocos. Therefore, mm_nViscBocos == mm_nBocos
30  bocos: do mm = 1, nbocos
31  if (bctype(mm) == eulerwall .or. bctype(mm) == nswalladiabatic .or. &
32  bctype(mm) == nswallisothermal) then
33  do j = bcdata(mm)%jnBeg, bcdata(mm)%jnEnd
34  do i = bcdata(mm)%inBeg, bcdata(mm)%inEnd
35  ii = ii + 1
36  bcdata(mm)%CpTarget(i, j) = cptarget(ii)
37  end do
38  end do
39  end if
40 
41  end do bocos
42  end do domains
43 
44 end subroutine setcptargets
45 
46 subroutine getcptargets(cptarget, npts, sps)
47 
48  use constants
49  use blockpointers, only: ndom, nbocos, bcdata, bctype
50 ! use flowVarRefState, only : TRef
51  use utils, only: setpointers
52  implicit none
53 
54  ! Input Variables
55  integer(kind=intType), intent(in) :: npts, sps
56  real(kind=realtype), intent(out) :: cptarget(npts)
57 
58  ! Local Variables
59  integer(kind=intType) :: mm, nn, i, j, ii
60  integer(kind=intType) :: iBeg, iEnd, jBeg, jEnd
61 
62  ii = 0
63  domains: do nn = 1, ndom
64  call setpointers(nn, 1_inttype, sps)
65  ! Loop over the number of viscous boundary subfaces of this block.
66  bocos: do mm = 1, nbocos
67  wall: if (bctype(mm) == eulerwall .or. bctype(mm) == nswalladiabatic .or. &
68  bctype(mm) == nswallisothermal) then
69  do j = bcdata(mm)%jnBeg, bcdata(mm)%jnEnd
70  do i = bcdata(mm)%inBeg, bcdata(mm)%inEnd
71  ii = ii + 1
72  cptarget(ii) = bcdata(mm)%CpTarget(i, j)
73  end do
74  end do
75  end if wall
76  end do bocos
77  end do domains
78 end subroutine getcptargets
Definition: BCData.F90:1
integer(kind=inttype) nbocos
integer(kind=inttype), dimension(:), pointer bctype
integer(kind=inttype), parameter eulerwall
Definition: constants.F90:262
integer(kind=inttype), parameter nswalladiabatic
Definition: constants.F90:260
integer(kind=inttype), parameter nswallisothermal
Definition: constants.F90:261
Definition: utils.F90:1
subroutine setpointers(nn, mm, ll)
Definition: utils.F90:3237
subroutine getcptargets(cptarget, npts, sps)
Definition: setCpTarget.f90:47
subroutine setcptargets(cptarget, npts, sps_in)
Definition: setCpTarget.f90:2