Skip to content

Commit

Permalink
remove small bugs in channel set up
Browse files Browse the repository at this point in the history
  • Loading branch information
slaizet committed Jan 30, 2024
1 parent 43e511f commit 453287a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions src/BC-Channel-flow.f90
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ subroutine init_channel (ux1,uy1,uz1,ep1,phi1)
um=exp(-zptwo*y*y)
do i=1,xsize(1)
if (idir_stream == 1) then
ux1(i,j,k)=0.5+0.5*y!one-y*y
ux1(i,j,k)=one-y*y
uy1(i,j,k)=zero
uz1(i,j,k)=sin(real(i-1,mytype)*dx)+cos(real(k-1,mytype)*dz)
else
print *,'test'
uz1(i,j,k)=0.5+0.5*y!one-y*y
uz1(i,j,k)=one-y*y
uy1(i,j,k)=zero
ux1(i,j,k)=zero
endif
Expand All @@ -118,11 +118,11 @@ subroutine init_channel (ux1,uy1,uz1,ep1,phi1)
um=exp(-zptwo*y*y)
do i=1,xsize(1)
if (idir_stream == 1) then
ux1(i,j,k)=init_noise*um*(two*ux1(i,j,k)-one)+0.5*y!one-y*y
ux1(i,j,k)=init_noise*um*(two*ux1(i,j,k)-one)+one-y*y
uy1(i,j,k)=init_noise*um*(two*uy1(i,j,k)-one)
uz1(i,j,k)=init_noise*um*(two*uz1(i,j,k)-one)
else
uz1(i,j,k)=init_noise*um*(two*ux1(i,j,k)-one)+0.5*y!one-y*y
uz1(i,j,k)=init_noise*um*(two*ux1(i,j,k)-one)+one-y*y
uy1(i,j,k)=init_noise*um*(two*uy1(i,j,k)-one)
ux1(i,j,k)=init_noise*um*(two*uz1(i,j,k)-one)
endif
Expand Down Expand Up @@ -162,9 +162,9 @@ subroutine boundary_conditions_channel (ux,uy,uz,phi)

if (.not. cpg ) then ! if not constant pressure gradient
if (idir_stream == 1) then
! call channel_cfr(ux,two/three)
call channel_cfr(ux,two/three)
else
! call channel_cfr(uz,two/three)
call channel_cfr(uz,two/three)
endif
end if

Expand Down
6 changes: 3 additions & 3 deletions src/navier.f90
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ subroutine pre_correc(ux,uy,uz,ep)
enddo
do k=1,xsize(3)
do i=1,xsize(1)
ux(i,1,k)=-0.5!byx1(i,k)+dpdxy1(i,k)
ux(i,1,k)=byx1(i,k)+dpdxy1(i,k)
uy(i,1,k)=byy1(i,k)
uz(i,1,k)=byz1(i,k)+dpdzy1(i,k)
enddo
Expand All @@ -643,15 +643,15 @@ subroutine pre_correc(ux,uy,uz,ep)
if (dims(1)==1) then
do k=1,xsize(3)
do i=1,xsize(1)
ux(i,xsize(2),k)=0.5!byxn(i,k)+dpdxyn(i,k)
ux(i,xsize(2),k)=byxn(i,k)+dpdxyn(i,k)
uy(i,xsize(2),k)=byyn(i,k)
uz(i,xsize(2),k)=byzn(i,k)+dpdzyn(i,k)
enddo
enddo
elseif (ny - (nym / dims(1)) == xstart(2)) then
do k=1,xsize(3)
do i=1,xsize(1)
ux(i,xsize(2),k)=0.5!byxn(i,k)+dpdxyn(i,k)
ux(i,xsize(2),k)=byxn(i,k)+dpdxyn(i,k)
uy(i,xsize(2),k)=byyn(i,k)
uz(i,xsize(2),k)=byzn(i,k)+dpdzyn(i,k)
enddo
Expand Down

0 comments on commit 453287a

Please sign in to comment.