From 1003ccf851a583cf1ac08b5d899af8b268bcab7c Mon Sep 17 00:00:00 2001 From: Mo8it Date: Tue, 25 Jan 2022 22:15:42 +0100 Subject: [PATCH] Fixed rdf --- Manifest.toml | 14 +- ...g_of_r_d_ratio_with_0_37_packing_ratio.csv | 221 ++++++++++++++++++ ...g_of_r_d_ratio_with_0_45_packing_ratio.csv | 149 ------------ .../radial_distribution_function.jl | 34 +-- src/setup.jl | 4 +- 5 files changed, 247 insertions(+), 175 deletions(-) create mode 100644 analysis/radial_distribution_function/g_of_r_d_ratio_with_0_37_packing_ratio.csv delete mode 100644 analysis/radial_distribution_function/g_of_r_d_ratio_with_0_45_packing_ratio.csv diff --git a/Manifest.toml b/Manifest.toml index 93c2adc..2ecb052 100644 --- a/Manifest.toml +++ b/Manifest.toml @@ -467,10 +467,10 @@ uuid = "e9467ef8-e4e7-5192-8a1a-b1aee30e663a" version = "0.5.1" [[deps.GPUArrays]] -deps = ["Adapt", "LinearAlgebra", "Printf", "Random", "Serialization", "Statistics"] -git-tree-sha1 = "d9681e61fbce7dde48684b40bdb1a319c4083be7" +deps = ["Adapt", "LLVM", "LinearAlgebra", "Printf", "Random", "Serialization", "Statistics"] +git-tree-sha1 = "cf91e6e9213b9190dc0511d6fff862a86652a94a" uuid = "0c68f7d7-f131-5f86-a1c3-88cf8149b2d7" -version = "8.1.3" +version = "8.2.1" [[deps.GPUCompiler]] deps = ["ExprTools", "InteractiveUtils", "LLVM", "Libdl", "Logging", "TimerOutputs", "UUIDs"] @@ -945,9 +945,9 @@ version = "0.7.3" [[deps.ModernGL]] deps = ["Libdl"] -git-tree-sha1 = "1b4ca9b2956401690dfbf1b49e345ca539b54b03" +git-tree-sha1 = "344f8896e55541e30d5ccffcbf747c98ad57ca47" uuid = "66fc600b-dfda-50eb-8b99-91cfa97b1301" -version = "1.1.3" +version = "1.1.4" [[deps.MosaicViews]] deps = ["MappedArrays", "OffsetArrays", "PaddedViews", "StackViews"] @@ -1153,9 +1153,9 @@ uuid = "9abbd945-dff8-562f-b5e8-e1ebf5ef1b79" [[deps.ProfileView]] deps = ["Cairo", "Colors", "FileIO", "FlameGraphs", "Graphics", "Gtk", "GtkObservables", "InteractiveUtils", "IntervalSets", "MethodAnalysis", "Preferences", "Profile", "UUIDs"] -git-tree-sha1 = "6a9fe54afc52e4b98029e15dbd0552d82a2c5b94" +git-tree-sha1 = "93b795da19d3668ff3ba5463481d137ba7fb3c2a" uuid = "c46f51b8-102a-5cf2-8d2c-8597cb0e0da7" -version = "1.3.1" +version = "1.4.0" [[deps.ProgressMeter]] deps = ["Distributed", "Printf"] diff --git a/analysis/radial_distribution_function/g_of_r_d_ratio_with_0_37_packing_ratio.csv b/analysis/radial_distribution_function/g_of_r_d_ratio_with_0_37_packing_ratio.csv new file mode 100644 index 0000000..307c866 --- /dev/null +++ b/analysis/radial_distribution_function/g_of_r_d_ratio_with_0_37_packing_ratio.csv @@ -0,0 +1,221 @@ +# Source: https://arxiv.org/abs/1305.4185 +# Figure 2a (repulsive part) +r_d_ratio,g_of_r_d_ratio +0.0,0.0 +0.96164,0.02786 +0.9636,0.05169 +0.96512,0.07895 +0.96598,0.09856 +0.96706,0.12817 +0.96784,0.15225 +0.9686,0.17769 +0.96907,0.19467 +0.96977,0.2209 +0.97045,0.24789 +0.97088,0.26584 +0.9715,0.29227 +0.97209,0.31884 +0.97266,0.34494 +0.973,0.36144 +0.97349,0.38545 +0.97409,0.41577 +0.97448,0.43706 +0.97485,0.4579 +0.97531,0.48519 +0.97563,0.50565 +0.97605,0.53368 +0.97637,0.55542 +0.9767,0.5783 +0.97705,0.60237 +0.97742,0.62761 +0.9778,0.65412 +0.97806,0.67228 +0.97846,0.69978 +0.97874,0.71947 +0.97915,0.74789 +0.97943,0.76801 +0.97987,0.7982 +0.98015,0.81826 +0.98046,0.83951 +0.98091,0.8711 +0.9812,0.89179 +0.98151,0.91314 +0.98182,0.93526 +0.9823,0.96875 +0.9826,0.99014 +0.9829,1.01183 +0.98321,1.03383 +0.98352,1.05614 +0.98384,1.07882 +0.98415,1.10194 +0.9846,1.13513 +0.98489,1.15685 +0.98518,1.17867 +0.98547,1.20062 +0.98575,1.22282 +0.98604,1.24547 +0.98643,1.27759 +0.98668,1.29838 +0.98693,1.31941 +0.98717,1.3411 +0.98749,1.37117 +0.98769,1.39103 +0.98799,1.4212 +0.98816,1.43999 +0.98842,1.46943 +0.98858,1.4877 +0.98881,1.51643 +0.98896,1.53465 +0.98918,1.56293 +0.98933,1.58148 +0.98955,1.60964 +0.98971,1.62871 +0.98994,1.65717 +0.99011,1.67668 +0.99038,1.70607 +0.99061,1.72559 +0.99108,1.75567 +0.9915,1.77461 +0.99241,1.80404 +0.99318,1.82202 +0.9948,1.84898 +0.99706,1.87388 +1.00018,1.89554 +1.00644,1.91739 +1.02588,1.91493 +1.03854,1.89243 +1.05122,1.86333 +1.06076,1.83878 +1.06695,1.82204 +1.07627,1.79596 +1.08567,1.76895 +1.09166,1.75157 +1.10064,1.72551 +1.10949,1.70024 +1.11802,1.67669 +1.12623,1.65491 +1.13425,1.63457 +1.14478,1.60937 +1.15521,1.58598 +1.16575,1.56367 +1.17662,1.54153 +1.18805,1.51868 +1.20011,1.49464 +1.20946,1.47603 +1.22195,1.45125 +1.23452,1.42643 +1.24686,1.40221 +1.25576,1.38489 +1.26961,1.35834 +1.28181,1.33561 +1.29262,1.31644 +1.30701,1.29284 +1.32042,1.27245 +1.33623,1.24913 +1.35114,1.22743 +1.36684,1.20483 +1.38272,1.18229 +1.39815,1.16079 +1.41519,1.13777 +1.43063,1.11803 +1.44812,1.09736 +1.46689,1.07698 +1.48837,1.05493 +1.50839,1.0351 +1.52903,1.01524 +1.54947,0.99615 +1.57224,0.97577 +1.59447,0.95741 +1.62068,0.93843 +1.64551,0.92314 +1.67523,0.90722 +1.70718,0.89197 +1.73659,0.87931 +1.77156,0.86746 +1.80855,0.86016 +1.84519,0.85849 +1.88439,0.86139 +1.92032,0.8688 +1.9503,0.88389 +1.97435,0.90228 +1.99621,0.92162 +2.0194,0.94113 +2.04386,0.95977 +2.06806,0.97691 +2.09549,0.99406 +2.12575,1.00839 +2.15951,1.02065 +2.19533,1.03215 +2.22914,1.04031 +2.26856,1.04517 +2.30741,1.04651 +2.34319,1.04605 +2.38102,1.04457 +2.42199,1.04218 +2.45815,1.03938 +2.49681,1.03527 +2.53604,1.03007 +2.57029,1.02504 +2.61109,1.01866 +2.64646,1.01281 +2.68495,1.00623 +2.72073,1.00032 +2.75703,0.99521 +2.79567,0.99138 +2.83291,0.98871 +2.87019,0.98648 +2.91148,0.98494 +2.95074,0.98421 +2.98565,0.98414 +3.02438,0.985 +3.06253,0.98701 +3.10261,0.98965 +3.13977,0.99201 +3.17689,0.99414 +3.21799,0.99623 +3.25632,0.99799 +3.29591,0.99968 +3.33017,1.00105 +3.36996,1.00251 +3.40917,1.00378 +3.44734,1.0048 +3.48395,1.00552 +3.52307,1.00603 +3.56237,1.0063 +3.60025,1.00627 +3.63863,1.00577 +3.67946,1.00484 +3.71481,1.00392 +3.75646,1.00287 +3.79209,1.00211 +3.8327,1.0014 +3.8704,1.0008 +3.90587,1.00023 +3.94426,0.99959 +3.98355,0.99897 +4.02159,0.99846 +4.06123,0.99813 +4.10093,0.99822 +4.14072,0.99854 +4.17676,0.99881 +4.22138,0.99907 +4.25186,0.9992 +4.29599,0.99935 +4.33118,0.99946 +4.36795,0.99957 +4.40578,0.99968 +4.44436,0.99979 +4.48347,0.9999 +4.52299,1.00002 +4.56276,1.00014 +4.60262,1.00028 +4.64249,1.00042 +4.68236,1.00058 +4.72224,1.00074 +4.76211,1.00091 +4.78846,1.00102 +4.82784,1.0012 +4.86729,1.00138 +4.90678,1.00156 +4.94633,1.00175 +4.98591,1.00193 diff --git a/analysis/radial_distribution_function/g_of_r_d_ratio_with_0_45_packing_ratio.csv b/analysis/radial_distribution_function/g_of_r_d_ratio_with_0_45_packing_ratio.csv deleted file mode 100644 index 39928d0..0000000 --- a/analysis/radial_distribution_function/g_of_r_d_ratio_with_0_45_packing_ratio.csv +++ /dev/null @@ -1,149 +0,0 @@ -# Source: https://www.researchgate.net/publication/223333736_Reconstruction_of_Ross'_linear-mixing_model_for_the_equation_of_state_of_deuterium -r_d_ratio,g_of_r_d_ratio -0.99392,0.08604 -0.99388,0.18421 -0.99384,0.28847 -0.99382,0.34463 -0.99378,0.42994 -0.99372,0.52947 -0.99365,0.63441 -0.99361,0.68891 -0.99354,0.77406 -0.99344,0.87468 -0.99332,0.98013 -0.99325,1.03317 -0.99314,1.11822 -0.99297,1.21964 -0.99278,1.32539 -0.99267,1.37722 -0.99249,1.4622 -0.99224,1.56412 -0.99194,1.67 -0.99179,1.72089 -0.99152,1.8058 -0.99116,1.90793 -0.99074,2.01372 -0.99053,2.06399 -0.99015,2.1488 -0.98965,2.25086 -0.98909,2.35636 -0.98881,2.40637 -0.98831,2.49108 -0.98767,2.5925 -0.98699,2.69664 -0.98665,2.74669 -0.98607,2.83091 -0.98538,2.92885 -0.98467,3.02834 -0.98395,3.12761 -0.98362,3.17414 -0.98304,3.25677 -0.98242,3.34772 -0.98183,3.43776 -0.98129,3.52581 -0.98081,3.61118 -0.98043,3.69358 -0.98015,3.77322 -0.98,3.85156 -0.98014,3.95169 -0.98089,4.03823 -0.98357,4.10894 -0.9944,4.032 -1.00014,3.93792 -1.00441,3.85868 -1.00862,3.77571 -1.01272,3.69218 -1.01669,3.61072 -1.0216,3.51176 -1.02638,3.42062 -1.03128,3.33517 -1.03664,3.25085 -1.04281,3.16285 -1.04804,3.09295 -1.05614,2.98982 -1.06293,2.90588 -1.07039,2.81547 -1.07549,2.75441 -1.08352,2.65945 -1.09202,2.56047 -1.09758,2.49642 -1.10625,2.39796 -1.11214,2.33189 -1.12071,2.23742 -1.12939,2.14379 -1.13793,2.05435 -1.14612,1.97171 -1.15388,1.89756 -1.16359,1.81176 -1.17456,1.72585 -1.18615,1.64833 -1.19996,1.56268 -1.21169,1.47967 -1.22345,1.39143 -1.23543,1.30583 -1.24773,1.23043 -1.26375,1.14911 -1.28235,1.06205 -1.30026,0.97628 -1.32001,0.89731 -1.34607,0.8185 -1.38029,0.74139 -1.42373,0.67706 -1.47928,0.62965 -1.54985,0.64005 -1.60887,0.68208 -1.65956,0.742 -1.70693,0.80174 -1.75549,0.86677 -1.7997,0.93281 -1.8408,0.99879 -1.88278,1.07151 -1.92418,1.14479 -1.96069,1.20961 -2.00089,1.27998 -2.06624,1.29427 -2.12188,1.24296 -2.16454,1.1732 -2.20365,1.10578 -2.2468,1.03273 -2.28968,0.97094 -2.34711,0.92061 -2.40659,0.87706 -2.47617,0.86598 -2.54506,0.87775 -2.6091,0.91495 -2.67198,0.9548 -2.73415,0.99707 -2.79524,1.03776 -2.86004,1.06782 -2.92949,1.08716 -2.99726,1.09694 -3.06572,1.07401 -3.13305,1.0512 -3.20406,1.01975 -3.26722,0.99225 -3.33163,0.96833 -3.40415,0.95312 -3.46976,0.95561 -3.53944,0.96948 -3.61034,0.98695 -3.68191,1.00826 -3.74431,1.02656 -3.81351,1.04126 -3.88832,1.04634 -3.95948,1.04227 -4.02721,1.03357 -4.09307,1.02294 -4.16757,1.01022 -4.23256,0.99784 -4.30367,0.98757 -4.3786,0.98803 -4.44527,0.99118 -4.51289,0.99726 -4.58223,1.00774 -4.65288,1.01261 -4.72314,1.01386 -4.79174,1.02311 -4.86131,1.03134 -4.93191,1.0253 -4.98585,1.01943 diff --git a/analysis/radial_distribution_function/radial_distribution_function.jl b/analysis/radial_distribution_function/radial_distribution_function.jl index dea9ae9..7eed4f2 100644 --- a/analysis/radial_distribution_function/radial_distribution_function.jl +++ b/analysis/radial_distribution_function/radial_distribution_function.jl @@ -163,7 +163,7 @@ function plot_radial_distributions( yticks=0:ceil(Int64, max_g), xlabel=L"r / d", ylabel=L"g", - limits=(min_lower_radius, max_lower_radius, min_g, max_g), + limits=(min_lower_radius - 0.03, max_lower_radius + 0.03, min_g, max_g * 1.03), ) lines!( @@ -175,25 +175,25 @@ function plot_radial_distributions( linewidth=1, ) - expected = CSV.read( - "analysis/radial_distribution_function/g_of_r_d_ratio_with_0_45_packing_ratio.csv", - DataFrames.DataFrame; - header=2, - ) - lines!( - ax, - expected.r_d_ratio, - expected.g_of_r_d_ratio; - label="Expectation for dense hard spheres", - color=:green, - ) - for (g_ind, g) in enumerate(gs) scatterlines!( ax, lower_radii, g; markersize=3, linewidth=0.5, label=L"v_0 = %$(v₀s[g_ind])" ) end + comparison_curve = CSV.read( + "analysis/radial_distribution_function/g_of_r_d_ratio_with_0_37_packing_ratio.csv", + DataFrames.DataFrame; + header=3, + ) + lines!( + ax, + comparison_curve.r_d_ratio, + comparison_curve.g_of_r_d_ratio; + label="Similar system", + color=:green, + ) + axislegend(ax; position=:rt, padding=3, rowgap=-3) save_fig("radial_distribution.pdf", fig) @@ -202,16 +202,16 @@ function plot_radial_distributions( end function run_radial_distribution_analysis() - v₀s = (0.0, 80.0) + v₀s = (0.0, 20.0) n_particles = 1000 sim_dirs = radial_distribution_simulation(; - n_particles=n_particles, v₀s=v₀s, T=100.0, packing_ratio=0.45 + n_particles=n_particles, v₀s=v₀s, T=100.0, packing_ratio=0.37 ) lower_radii, gs, particle_radius = radial_distribution(; - sim_dirs=sim_dirs, n_radii=75, n_last_snapshots=200, n_particles=n_particles + sim_dirs=sim_dirs, n_radii=56, n_last_snapshots=200, n_particles=n_particles ) plot_radial_distributions(v₀s, lower_radii, gs, particle_radius) diff --git a/src/setup.jl b/src/setup.jl index 42048cf..c2b040b 100644 --- a/src/setup.jl +++ b/src/setup.jl @@ -1,6 +1,6 @@ const DEFAULT_PACKING_RATIO = 0.5 const DEFAULT_δt = 1e-5 -const DEFAULT_SKIN_TO_INTERACTION_R_RATIO = 1.5 +const DEFAULT_SKIN_TO_INTERACTION_R_RATIO = 2.0 const DEFAULT_EXPORTS_DIR = "exports" const DEFAULT_PARENT_DIR = "" const DEFAULT_COMMENT = "" @@ -67,7 +67,7 @@ function gen_sim_consts( ϵ = DEFAULT_ϵ interaction_r = 2^(1 / 6) * σ - buffer = 1.8 + buffer = 2.5 max_approach_after_one_integration_step = buffer * (2 * v₀ * δt) / interaction_r @assert skin_to_interaction_r_ratio >= 1 + max_approach_after_one_integration_step