Skip to content

Commit

Permalink
Harmonic potential
Browse files Browse the repository at this point in the history
  • Loading branch information
comecattin committed Jun 10, 2024
1 parent 4b0bf37 commit 813e100
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/energies.f90
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,24 @@ subroutine yukawa_potential(r, mass, q1, q2, alpha_param, yukawa_p)

end subroutine yukawa_potential

subroutine lennard_jones(r, lj_p)
subroutine lennard_jones_potential(r, lj_p)

real(8), intent(in) :: r
real(8), intent(out) :: lj_p

lj_p = 4 * epsilon * ((sigma / r)**12 - (sigma / r)**6)

end subroutine lennard_jones
end subroutine lennard_jones_potential

subroutine harmonic_potential(r, r_eq, kb, harmonic_p)

real(8), intent(in) :: r
real(8), intent(in) :: r_eq, kb
real(8), intent(out) :: harmonic_p

harmonic_p = 0.5 * kb * (r - r_eq)**2

end subroutine harmonic_potential


end module energies_module

0 comments on commit 813e100

Please sign in to comment.