Skip to content

Commit 10d4a49

Browse files
fangjianfangjian
authored andcommitted
noslip_adibatic for all directions
1 parent df5424f commit 10d4a49

File tree

1 file changed

+168
-52
lines changed

1 file changed

+168
-52
lines changed

src/bc.F90

Lines changed: 168 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -6375,7 +6375,7 @@ subroutine noslip(ndir,tw)
63756375
tmp(i,j,k) =tw
63766376
!
63776377
if(num_species>0) then
6378-
spc(i,j,k,1)=num1d3*(4.d0*spc(i+1,j,k,1)-spc(i,j+2,k,1))
6378+
spc(i,j,k,1)=num1d3*(4.d0*spc(i+1,j,k,1)-spc(i+2,j,k,1))
63796379
endif
63806380
!
63816381
if(nondimen) then
@@ -6634,7 +6634,21 @@ subroutine noslip(ndir,tw)
66346634
endif
66356635
!
66366636
end subroutine noslip
6637-
!!
6637+
6638+
!+-------------------------------------------------------------------+
6639+
!| Subroutine: noslip_adibatic |
6640+
!| |
6641+
!| Purpose: |
6642+
!| Applies no-slip adiabatic wall boundary conditions along |
6643+
!| a given normal direction (ndir). Supports optional wall |
6644+
!| blowing/suction from input file and includes k-omega turbulence |
6645+
!| model variable initialization if enabled. |
6646+
!| |
6647+
!| Input: |
6648+
!| ndir : integer, direction index (1=Xmin, 2=Xmax, 3=Ymin, 4=Ymax)|
6649+
!| |
6650+
!| Author: Fang Jian |
6651+
!|-------------------------------------------------------------------+
66386652
subroutine noslip_adibatic(ndir)
66396653
!
66406654
use commvar, only : Reynolds,turbmode,lreport,nondimen,spcinf
@@ -6658,69 +6672,171 @@ subroutine noslip_adibatic(ndir)
66586672
logical,save :: lfirstcal=.true.
66596673
!
66606674
beta1=0.075d0
6661-
!
6662-
if(ndir==3) then
6675+
6676+
if(lreport) lfirstcal=.true.
6677+
6678+
!---------------------------------------------------------------
6679+
! Read wall blowing/suction configuration
6680+
!---------------------------------------------------------------
6681+
if(lfirstcal) then
66636682
!
6664-
if(jrk==0) then
6683+
if(mpirank==0) then
6684+
!
6685+
filewbs='datin/wallbs.dat'
6686+
!
6687+
inquire(file=trim(filewbs), exist=lexist)
6688+
!
6689+
if(lexist) then
6690+
fh=get_unit()
6691+
open(fh,file=trim(filewbs),action='read')
6692+
read(fh,*)
6693+
read(fh,*)
6694+
read(fh,*)wallamplit,beter,xa,xb,xc
6695+
read(fh,*)
6696+
read(fh,*)nmod_t,nmod_z
6697+
close(fh)
6698+
print*,' >> ',trim(filewbs)
6699+
!
6700+
print*,' ------------- wall blowing & suction parameters -------------'
6701+
write(*,"(38x,A,1X,F12.5)") ' amplitude:',wallamplit
6702+
write(*,"(38x,A,1X,F12.5)") ' frequency:',beter
6703+
write(*,"(23x,3(A,1X,F12.5))")' x extent:',xa,' ~',xb,' ~',xc
6704+
write(*,"(42x,(A,1X,I0))")' temporal modes:',nmod_t
6705+
write(*,"(42x,(A,1X,I0))")' spanwise modes:',nmod_z
6706+
print*,' --------------------------------------------------------------'
6707+
else
6708+
wallamplit=0.d0
6709+
beter=1.d0
6710+
xa=0.d0
6711+
xb=0.d0
6712+
xc=0.d0
6713+
nmod_t=0
6714+
nmod_z=0
6715+
endif
66656716
!
6666-
if(lreport) lfirstcal=.true.
6717+
endif
6718+
!
6719+
call bcast(wallamplit,comm=mpi_jmin)
6720+
call bcast(beter,comm=mpi_jmin)
6721+
call bcast(xa,comm=mpi_jmin)
6722+
call bcast(xb,comm=mpi_jmin)
6723+
call bcast(xc,comm=mpi_jmin)
6724+
call bcast(nmod_t,comm=mpi_jmin)
6725+
call bcast(nmod_z,comm=mpi_jmin)
6726+
!
6727+
!
6728+
lfirstcal=.false.
6729+
!
6730+
endif
6731+
!
6732+
if(ndims==3 .and. wallamplit>1.d-10) then
6733+
vwall=wallbs_rand(beter,wallamplit,xa,xb,xc,nmod_t,nmod_z)
6734+
else
6735+
vwall=0.d0
6736+
endif
6737+
6738+
!---------------------------------------------------------------
6739+
! Apply no-slip adiabatic conditions
6740+
!---------------------------------------------------------------
6741+
if(ndir==1) then
6742+
! Xmin
6743+
!
6744+
if(irk==0) then
66676745
!
6668-
if(lfirstcal) then
6746+
i=0
6747+
do k=0,km
6748+
do j=0,jm
6749+
pe=num1d3*(4.d0*prs(i+1,j,k)-prs(i+2,j,k))
6750+
te=num1d3*(4.d0*tmp(i+1,j,k)-tmp(i+2,j,k))
66696751
!
6670-
if(mpirank==0) then
6752+
vel(i,j,k,1)=0.d0
6753+
vel(i,j,k,2)=0.d0
6754+
vel(i,j,k,3)=0.d0
6755+
prs(i,j,k) =pe
6756+
tmp(i,j,k) =te
6757+
!
6758+
if(num_species>0) then
6759+
spc(i,j,k,1)=num1d3*(4.d0*spc(i+1,j,k,1)-spc(i+2,j,k,1))
6760+
endif
6761+
!
6762+
if(nondimen) then
6763+
rho(i,j,k) =thermal(pressure=prs(i,j,k),temperature=tmp(i,j,k))
66716764
!
6672-
filewbs='datin/wallbs.dat'
6765+
call fvar2q( q= q(i,j,k,:), &
6766+
density=rho(i,j,k), &
6767+
velocity=vel(i,j,k,:), &
6768+
pressure=prs(i,j,k), &
6769+
species=spc(i,j,k,:) )
66736770
!
6674-
inquire(file=trim(filewbs), exist=lexist)
6771+
else
66756772
!
6676-
if(lexist) then
6677-
fh=get_unit()
6678-
open(fh,file=trim(filewbs),action='read')
6679-
read(fh,*)
6680-
read(fh,*)
6681-
read(fh,*)wallamplit,beter,xa,xb,xc
6682-
read(fh,*)
6683-
read(fh,*)nmod_t,nmod_z
6684-
close(fh)
6685-
print*,' >> ',trim(filewbs)
6686-
!
6687-
print*,' ------------- wall blowing & suction parameters -------------'
6688-
write(*,"(38x,A,1X,F12.5)") ' amplitude:',wallamplit
6689-
write(*,"(38x,A,1X,F12.5)") ' frequency:',beter
6690-
write(*,"(23x,3(A,1X,F12.5))")' x extent:',xa,' ~',xb,' ~',xc
6691-
write(*,"(42x,(A,1X,I0))")' temporal modes:',nmod_t
6692-
write(*,"(42x,(A,1X,I0))")' spanwise modes:',nmod_z
6693-
print*,' --------------------------------------------------------------'
6694-
else
6695-
wallamplit=0.d0
6696-
beter=1.d0
6697-
xa=0.d0
6698-
xb=0.d0
6699-
xc=0.d0
6700-
nmod_t=0
6701-
nmod_z=0
6702-
endif
6773+
rho(i,j,k) =thermal(pressure=prs(i,j,k),temperature=tmp(i,j,k),species=spc(i,j,k,:))
6774+
!
6775+
call fvar2q( q= q(i,j,k,:), &
6776+
density=rho(i,j,k), &
6777+
velocity=vel(i,j,k,:), &
6778+
temperature=tmp(i,j,k), &
6779+
species=spc(i,j,k,:) )
67036780
!
67046781
endif
6782+
6783+
enddo
6784+
enddo
6785+
!
6786+
endif
6787+
6788+
elseif(ndir==2) then
6789+
!
6790+
if(irk==irkm) then
6791+
!
6792+
i=im
6793+
6794+
do k=0,km
6795+
do j=0,jm
6796+
pe=num1d3*(4.d0*prs(i-1,j,k)-prs(i-2,j,k))
6797+
te=num1d3*(4.d0*tmp(i-1,j,k)-tmp(i-2,j,k))
67056798
!
6706-
call bcast(wallamplit,comm=mpi_jmin)
6707-
call bcast(beter,comm=mpi_jmin)
6708-
call bcast(xa,comm=mpi_jmin)
6709-
call bcast(xb,comm=mpi_jmin)
6710-
call bcast(xc,comm=mpi_jmin)
6711-
call bcast(nmod_t,comm=mpi_jmin)
6712-
call bcast(nmod_z,comm=mpi_jmin)
6713-
!
6799+
vel(i,j,k,1)=0.d0
6800+
vel(i,j,k,2)=0.d0
6801+
vel(i,j,k,3)=0.d0
6802+
prs(i,j,k) =pe
6803+
tmp(i,j,k) =te
67146804
!
6715-
lfirstcal=.false.
6805+
if(num_species>0) then
6806+
spc(i,j,k,1)=num1d3*(4.d0*spc(i-1,j,k,1)-spc(i,j-2,k,1))
6807+
endif
67166808
!
6717-
endif
6809+
if(nondimen) then
6810+
rho(i,j,k) =thermal(pressure=prs(i,j,k),temperature=tmp(i,j,k))
6811+
!
6812+
call fvar2q( q= q(i,j,k,:), &
6813+
density=rho(i,j,k), &
6814+
velocity=vel(i,j,k,:), &
6815+
pressure=prs(i,j,k), &
6816+
species=spc(i,j,k,:) )
6817+
!
6818+
else
6819+
!
6820+
rho(i,j,k) =thermal(pressure=prs(i,j,k),temperature=tmp(i,j,k),species=spc(i,j,k,:))
6821+
!
6822+
call fvar2q( q= q(i,j,k,:), &
6823+
density=rho(i,j,k), &
6824+
velocity=vel(i,j,k,:), &
6825+
temperature=tmp(i,j,k), &
6826+
species=spc(i,j,k,:) )
6827+
!
6828+
endif
6829+
6830+
enddo
6831+
enddo
67186832
!
6719-
if(ndims==3 .and. wallamplit>1.d-10) then
6720-
vwall=wallbs_rand(beter,wallamplit,xa,xb,xc,nmod_t,nmod_z)
6721-
else
6722-
vwall=0.d0
6723-
endif
6833+
endif
6834+
6835+
elseif(ndir==3) then
6836+
!
6837+
if(jrk==0) then
6838+
!
6839+
67246840
!
67256841
j=0
67266842
!

0 commit comments

Comments
 (0)