Skip to content

Commit 5080850

Browse files
Update ModifiedHypernettedChain closure to include the parameter sigma
1 parent ad37ae4 commit 5080850

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/Closures.jl

+8-7
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ function bridge_function(closure::Khanpour, _, _, γ)
471471
end
472472

473473
"""
474-
ModifiedHypernettedChain <: Closure
474+
ModifiedHypernettedChain <: Closure
475475
476476
Implements the Modified Hypernetted Chain closure \$b(r) = b_{HS}(r) \$. Here \$b_{HS}(r/σ)=\\left((a_1+a_2x)(x-a_3)(x-a_4)/(a_3 a_4)\\right)^2\$ for \$x<a_4\$ and \$b_{HS}(r)=\\left(A_1 \\exp(-a_5(x-a_4))\\sin(A_2(x-a_4))/r\\right)^2\$ is the hard sphere bridge function found in Malijevský & Labík.
477477
The parameters are defined as
@@ -494,12 +494,12 @@ The parameters are defined as
494494
495495
\$a_6 = (2.69757 - 0.86987\\eta)\$
496496
497-
and \$\\eta\$ is the volume fraction of the hard sphere reference system. This closure only works for single component systems in three dimensions. By default, σ = 1.0.
497+
and \$\\eta\$ is the volume fraction of the hard sphere reference system. This closure only works for single component systems in three dimensions. By default, \$\\sigma = 1.0\$.
498498
499499
Example:
500500
```julia
501501
closure = ModifiedHypernettedChain(0.4)
502-
closure = ModifiedHypernettedChain(0.4; σ=0.8)
502+
closure = ModifiedHypernettedChain(0.4; sigma=0.8)
503503
```
504504
505505
References:
@@ -510,17 +510,18 @@ Malijevský, Anatol, and Stanislav Labík. "The bridge function for hard spheres
510510
"""
511511
struct ModifiedHypernettedChain{T, T2} <: Closure
512512
η::T
513-
σ::T2
513+
sigma::T2
514514
end
515515

516-
function ModifiedHypernettedChain(η; σ=1.0)
517-
return ModifiedHypernettedChain(η, σ)
516+
function ModifiedHypernettedChain(η; sigma=1.0)
517+
return ModifiedHypernettedChain(η, sigma)
518518
end
519519

520520
function bridge_function(closure::ModifiedHypernettedChain, r, _, _)
521521
oneunit = one(r[1])
522522
η = closure.η
523-
x = @. r ./ σ - oneunit
523+
sigma = closure.sigma
524+
x = @. r ./ sigma - oneunit
524525
a_1 = η * (1.55707 - 1.85633η) / (1-η)^2
525526
a_2 = η * (1.28127 - 1.82134η) / (1-η)
526527
a_3 = (0.74480 - 0.93453η)

0 commit comments

Comments
 (0)