1
0
Fork 0
mirror of https://gitlab.rlp.net/mobitar/ReCo.jl.git synced 2024-09-19 19:01:17 +00:00

packing ratio

This commit is contained in:
MoBit 2021-11-17 20:43:20 +01:00
parent 7a1268a4ea
commit b0796d8563

View file

@ -1,12 +1,13 @@
function run(; function run(;
N::Int64, N::Int64,
T::Float64, T::Float64,
v::Float64=20.0, v::Float64,
δt::Float64=2e-5, δt::Float64=1e-5,
save_at::Float64=0.1, save_at::Float64=0.1,
framerate::Int64=0, framerate::Int64=0,
save_data::Bool=true, save_data::Bool=true,
n_steps_before_verlet_list_update::Int64=100, n_steps_before_verlet_list_update::Int64=1000,
packing_ratio::Float64=0.5,
debug::Bool=false, debug::Bool=false,
) )
Random.seed!(42) Random.seed!(42)
@ -23,7 +24,7 @@ function run(;
N = grid_n^2 N = grid_n^2
l = float(sqrt(N)) l = sqrt(N * π / packing_ratio) * σ / 4
grid_box_width = 2 * l / grid_n grid_box_width = 2 * l / grid_n
skin_r = 1.1 * (2 * v * n_steps_before_verlet_list_update * δt + 2 * interaction_r) skin_r = 1.1 * (2 * v * n_steps_before_verlet_list_update * δt + 2 * interaction_r)
@ -60,8 +61,32 @@ function run(;
save_variables_to_JSON = false save_variables_to_JSON = false
additional_variables = (;
T,
δt,
save_at,
framerate,
n_steps_before_verlet_list_update,
packing_ratio,
debug,
μ,
D₀,
particle_diameter,
Dᵣ,
σ,
ϵ,
interaction_r,
grid_n,
l,
grid_box_width,
skin_r,
integration_steps,
n_steps_before_save,
end_time,
)
if save_data if save_data
save_data_jld(filename, sol, args, n_steps_before_verlet_list_update) save_data_jld(filename, sol, args, additional_variables)
save_variables_to_JSON = true save_variables_to_JSON = true
end end
@ -73,7 +98,7 @@ function run(;
end end
if save_variables_to_JSON if save_variables_to_JSON
save_JSON(filename, args, n_steps_before_save) save_JSON(filename, args, additional_variables)
end end
return (; sol, args, filename) return (; sol, args, filename)