1
0
Fork 0
mirror of https://gitlab.rlp.net/mobitar/ReCo.jl.git synced 2024-12-21 00:51:21 +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(;
N::Int64,
T::Float64,
v::Float64=20.0,
δt::Float64=2e-5,
v::Float64,
δt::Float64=1e-5,
save_at::Float64=0.1,
framerate::Int64=0,
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,
)
Random.seed!(42)
@ -23,7 +24,7 @@ function run(;
N = grid_n^2
l = float(sqrt(N))
l = sqrt(N * π / packing_ratio) * σ / 4
grid_box_width = 2 * l / grid_n
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
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
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
end
@ -73,7 +98,7 @@ function run(;
end
if save_variables_to_JSON
save_JSON(filename, args, n_steps_before_save)
save_JSON(filename, args, additional_variables)
end
return (; sol, args, filename)