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
18 changes: 17 additions & 1 deletion src/BC-Channel-flow.f90
Original file line number Diff line number Diff line change
Expand Up @@ -265,12 +265,15 @@ subroutine boundary_conditions_channel (ux,uy,uz,phi)
use var, only : di2
use variables
use decomp_2d
use mhd, only : Bm, mhd_active, mhd_equation

implicit none

real(mytype),dimension(xsize(1),xsize(2),xsize(3)) :: ux,uy,uz
real(mytype),dimension(xsize(1),xsize(2),xsize(3),numscalar) :: phi

integer j

if (.not. cpg ) then ! if not constant pressure gradient
if (idir_stream == 1) then
call channel_cfr(ux,two/three)
Expand Down Expand Up @@ -300,6 +303,15 @@ subroutine boundary_conditions_channel (ux,uy,uz,phi)
!if (nclySn.eq.2) g_sc(:,2) = zero
endif
endif

if( mhd_active .and. iimplicit==0 .and. mhd_equation ) then
Bm(:,1,:,2) = one
Bm(:,ny,:,2) = one
Bm(:,1,:,1) = zero
Bm(:,ny,:,1) = zero
Bm(:,1,:,3) = zero
Bm(:,ny,:,3) = zero
endif

end subroutine boundary_conditions_channel
!############################################################################
Expand Down Expand Up @@ -394,7 +406,7 @@ subroutine visu_channel(ux1, uy1, uz1, pp3, phi1, ep1, num)
use var, only : ta2,tb2,tc2,td2,te2,tf2,di2,ta3,tb3,tc3,td3,te3,tf3,di3
use var, ONLY : nzmsize
use visu, only : write_field
use mhd, only : mhd_active,Je
use mhd, only : mhd_active,Je, Bm

use ibm_param, only : ubcx,ubcy,ubcz

Expand Down Expand Up @@ -458,6 +470,10 @@ subroutine visu_channel(ux1, uy1, uz1, pp3, phi1, ep1, num)
call write_field(Je(:,:,:,1), ".", "J_x", num, flush = .true.)
call write_field(Je(:,:,:,2), ".", "J_y", num, flush = .true.)
call write_field(Je(:,:,:,3), ".", "J_z", num, flush = .true.)
call write_field(Bm(:,:,:,1), ".", "B_x", num, flush = .true.)
call write_field(Bm(:,:,:,2), ".", "B_y", num, flush = .true.)
call write_field(Bm(:,:,:,3), ".", "B_z", num, flush = .true.)

endif

end subroutine visu_channel
Expand Down
Loading