Skip to content
Merged
Changes from 3 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
24 changes: 12 additions & 12 deletions src/particle.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1990,7 +1990,7 @@ subroutine particle_domain_check(particle,num_active_particles)

if(npart>npexit) exit

if(pa%x(1)<0) then
if(pa%x(1)<0._mytype) then

! xmin face
call particle_bc(face=1,bctype=bc_particle(1),particle=pa,particle_deduce=counter)
Expand All @@ -2002,7 +2002,7 @@ subroutine particle_domain_check(particle,num_active_particles)

endif

if(pa%x(2)<0) then
if(pa%x(2)<0._mytype) then

! ymin face
call particle_bc(face=3,bctype=bc_particle(3),particle=pa,particle_deduce=counter)
Expand All @@ -2014,7 +2014,7 @@ subroutine particle_domain_check(particle,num_active_particles)

endif

if(pa%x(3)<0) then
if(pa%x(3)<0._mytype) then

! zmin face
call particle_bc(face=5,bctype=bc_particle(5),particle=pa,particle_deduce=counter)
Expand Down Expand Up @@ -2087,8 +2087,7 @@ subroutine particle_bc(face,bctype,particle,particle_deduce)
integer,intent(inout) :: particle_deduce

! local data
real(mytype) :: iface
real(mytype),save :: bcord(6)
real(mytype),save :: bcord(6),lenpe(6)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency with the rest of the code this should be

real(mytype), dimension(6), save :: bcord, lenpe

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

logical,save :: firstcal=.true.
integer :: idir

Expand All @@ -2101,6 +2100,13 @@ subroutine particle_bc(face,bctype,particle,particle_deduce)
bcord(5)=0.0_mytype
bcord(6)=zlz

lenpe(1)=xlx
lenpe(2)=-xlx
lenpe(3)=yly
lenpe(4)=-yly
lenpe(5)=zlz
lenpe(6)=-zlz
Comment on lines +2105 to +2110
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the length being defined as 2xL in each direction?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps add a comment to explain this


firstcal=.false.
endif

Expand All @@ -2111,14 +2117,8 @@ subroutine particle_bc(face,bctype,particle,particle_deduce)
call decomp_2d_abort(1,"idir error @ particle_bc")
endif

if(mod(face,2)==0) then
Comment thread
mathrack marked this conversation as resolved.
iface=-1._mytype
else
iface= 1._mytype
endif

if(bctype=='periodic') then
particle%x(idir)=particle%x(idir)+bcord(face)*iface
particle%x(idir)=particle%x(idir)+lenpe(face)
elseif(bctype=='reflective') then
particle%x(idir)=-particle%x(idir)+2.0_mytype*bcord(face)
elseif(bctype=='outflow') then
Expand Down