Skip to content

Commit

Permalink
Update in Cottrell and deposition count
Browse files Browse the repository at this point in the history
Corrected the code that can be used to study ideal deposition (Cottrell
regime). Added a Li (CG) deposition counter (output in depo.dat), and a counter of particles
selected to try a deposition (output in try.dat).
  • Loading branch information
pauvals committed Aug 28, 2023
1 parent 7db3607 commit c84937e
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 28 deletions.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,23 @@ Repo for a Molecular Dynamics program to study Li+ ions deposition onto a Li met
### + info
There are three possible reservoir types to study, and two positions integrators.

### Compiling and testing

# After changes in Makefile.am or configure.ac
autoreconf -fi
# To create Makefile
./configure

make clean
make # or make dist, distributable
cd tests
./test.sh

<!---
Agregar sobre:
Contacto
Licencia
Salida de datos
comments? questions? email us at info at welcometonightvale dot com. or follow us on twitter, at nightvaleradio. or listen to your walls for a while
dana's name has its roots in WtNV's Dana Cardinal :)
-->

Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

AC_INIT([dana],
[m4_esyscmd_s([git describe --always --abbrev=4 --dirty])],
[pauvsaravia@mi.unc.edu.ar])
[[email protected]])

AC_CONFIG_SRCDIR(src/)

Expand Down
72 changes: 46 additions & 26 deletions src/dana.F90
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ program dana
! Varios
integer :: idum ! Semilla
integer :: i,j,k ! Enteros
integer :: try, depo ! Parts. cercanas a electrodo y deposic.
real(dp) :: dist, rhomedia, cstdev, factor, factor2

! Ermak
Expand Down Expand Up @@ -154,11 +155,21 @@ program dana
open(12,File='E.dat')
open(13,File='T.dat')
open(14,File='rho.dat')
open(15,File='try.dat')
open(16,File='depo.dat')

! Para contar partículas que intentan deposic.
try= 0
depo= 0

call salida() ! config. inic. en el primer paso ;)

call timer_start()

! Para contar partículas que intentan deposic.
try= 0
depo= 0

do i=1,nst
! Da un paso #wii

Expand All @@ -176,26 +187,6 @@ program dana
! Para usar din. Browniana, y ~esferas duras
call cbrownian_hs(hs,h)

! Para estudiar influencia deposic. en perfiles Cottrell:
! la=> hs%ref%alist
! do j = 1, hs%ref%nat
! la=> la%next
! o1=> la%o
! if (o1%sym/='F') cycle
! lb => la%prev
! call o1%dest()
! deallocate(o1)
! la => lb
! ! Fin chequeo
! enddo
! la=> hs%ref%alist
! do j = 1, hs%ref%nat
! la=> la%next
! o1=> la%o
! if (o1%sym/='F') cycle
! print *, 'error'
! stop
! enddo
endif

! Update neighbors
Expand All @@ -210,6 +201,28 @@ program dana
msd_t= msd_t/hs%ref%nat
msd_max= max(msd_max,msd_t)

! Para estudiar influencia deposic. en perfiles Cottrell:
! la=> hs%ref%alist
! do j = 1, hs%ref%nat
! la=> la%next
! o1=> la%o
! if (o1%sym/='F') cycle
! lb => la%prev
! ! if(s_gcmc) call gcmc%detach(o1)
! call o1%dest()
! deallocate(o1)
! la => lb
! ! Fin chequeo
! enddo
! la=> hs%ref%alist
! do j = 1, hs%ref%nat
! la=> la%next
! o1=> la%o
! if (o1%sym/='F') cycle
! print *, 'error'
! stop
! enddo

! Add new CG to the ref group
! NOTE: Should we allow chain reaction instead?
la=> hs%ref%alist
Expand Down Expand Up @@ -876,11 +889,14 @@ recursive subroutine overlap_moveback(g)

! Deposicion por contacto con otra particula metalica
! 1.19 es el radio de Mayers

if (o2%z==2) then
! if(dr> 1.4161_dp) cycle

try= try + 1
ne=ran(idum)
if(ne<prob) then
depo= depo + 1 ! para contar CG
call o1%setz(3) ! F. Es inerte en este paso de tiempo

! Permite deposicion en cadena pero depende del atom id.
Expand Down Expand Up @@ -1151,6 +1167,14 @@ subroutine salida() ! Escribe los datos calc. :P
write(13,*)t,temp

write(14,*)t,rho

write(15,*)t,try
try= 0
write(16,*)t,depo
depo= 0

flush(16)
flush(15)
flush(14)
flush(13)
flush(12)
Expand Down Expand Up @@ -1207,18 +1231,14 @@ subroutine atom_pbc(o1, depos)

! Si toca el electrodo implicito ¿se congela? (probabilidad ne)
if(o1%pos(3)<=0._dp) then
try= try + 1
ne=ran(idum)

if(ne<prob) then
depo= depo + 1
call o1%setz(3) ! Es inerte en este paso de tiempo
depos= .true.

! Para estudiar Cottrell
! call o1%dest()
! deallocate(o1)
! o1%pos(:)=[0.,0.,-1.e3]
! return

endif

! XXX: atomos depositados también rebotan. Sería + consistente
Expand Down

0 comments on commit c84937e

Please sign in to comment.