From 574cb561c3a4e412f978351ab37d72c36f84d5db Mon Sep 17 00:00:00 2001 From: Mo8it Date: Wed, 26 Jan 2022 14:39:42 +0100 Subject: [PATCH] Better constant naming --- src/run.jl | 8 ++++---- src/simulation.jl | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/run.jl b/src/run.jl index 1458847..067dd34 100644 --- a/src/run.jl +++ b/src/run.jl @@ -84,10 +84,10 @@ function run_sim( skin_r=sim_consts.skin_r, skin_r²=sim_consts.skin_r^2, n_snapshots=n_snapshots, - c₁=4 * sim_consts.ϵ * 6 * sim_consts.σ^6 * sim_consts.δt * sim_consts.μₜ, - c₂=2 * sim_consts.σ^6, - c₃=sqrt(2 * sim_consts.Dₜ * sim_consts.δt), - c₄=sqrt(2 * sim_consts.Dᵣ * sim_consts.δt), + ϵσ⁶δtμₜ24=24 * sim_consts.ϵ * sim_consts.σ^6 * sim_consts.δt * sim_consts.μₜ, + σ⁶2=2 * sim_consts.σ^6, + sqrt_Dₜδt2=sqrt(2 * sim_consts.Dₜ * sim_consts.δt), + sqrt_Dᵣδt2=sqrt(2 * sim_consts.Dᵣ * sim_consts.δt), v₀δt=sim_consts.v₀ * sim_consts.δt, μₜ=sim_consts.μₜ, interaction_r=sim_consts.interaction_r, diff --git a/src/simulation.jl b/src/simulation.jl index b276e9b..3380694 100644 --- a/src/simulation.jl +++ b/src/simulation.jl @@ -57,7 +57,7 @@ function euler!( state_update_helper_hook!(env_helper, id1, id2, r⃗₁₂) if overlapping - factor = args.c₁ / (distance²^4) * (args.c₂ / (distance²^3) - 1.0) + factor = args.ϵσ⁶δtμₜ24 / (distance²^4) * (args.σ⁶2 / (distance²^3) - 1.0) dc = factor * r⃗₁₂ p1.tmp_c -= dc @@ -71,8 +71,8 @@ function euler!( @simd for p in args.particles si, co = sincos(p.φ) p.tmp_c += SVector( - args.v₀δt * co + args.c₃ * rand_normal01(), - args.v₀δt * si + args.c₃ * rand_normal01(), + args.v₀δt * co + args.sqrt_Dₜδt2 * rand_normal01(), + args.v₀δt * si + args.sqrt_Dₜδt2 * rand_normal01(), ) restrict_coordinates!(p, args.half_box_len) @@ -81,7 +81,7 @@ function euler!( RL.act_hook!(p, env_helper, args.δt, si, co) - p.φ += args.c₄ * rand_normal01() + p.φ += args.sqrt_Dᵣδt2 * rand_normal01() p.c = p.tmp_c end