Commit e2959a91 authored by Olaf's avatar Olaf

Main only calls execute file

parent 1159f63b
......@@ -10,6 +10,46 @@ from post import *
from init.parameters import *
def conversion_natural_units(density_ph, h_ph, T_init_ph, T_final_ph, T_delta_ph, N_argon, N_steps, N_steps_set_T):
"""
Function to converse to natural units.
last modified: 27-03-2019
Parameters
----------
density_ph : float
Physical density
h_ph : float
Physical timestep
T_init_ph : float
Physical inital temperature
T_final_ph : float
Desired physical temperature after rescaling
T_delta_ph : float
Physical temperature step taken in rescaling
N_argon : float
Number of argon particles
N_steps : float
Number of timesteps
N_steps_set_T : float
Number of timesteps between temperature rescale
Returns
-------
density : float
Natural density
h : float
Timestep in natural units
T_init : float
Natural initial temperature
T_final : float
Desired natural temperature after rescaling
T_delta : float
Natural temperature step taken in rescaling
L_box : float
Size of box
N_steps : float
Number of steps
"""
density = density_ph*sigma**3 # Particle density (dimensionless)
h = h_ph/tau # Timestep (dimensionless)
......@@ -20,11 +60,48 @@ def conversion_natural_units(density_ph, h_ph, T_init_ph, T_final_ph, T_delta_ph
L_box = (N_argon/density)**(1/3) # Dimensions of box/Scaling factor (dimensionless)
N_steps = N_steps + 10*N_steps_set_T # Add time steps for temperature rescaling
# Return
return(density, h, T_init, T_final, T_delta, L_box, N_steps)
def execute_calculations(density_ph, h_ph, T_init_ph, T_final_ph, T_delta_ph, N_argon, N_steps, N_steps_set_T, N_steps_av_E, init_org, plot_org):
"""
Function to converse to natural units.
last modified: 27-03-2019
Parameters
----------
density_ph : float
Physical density
h_ph : float
Physical timestep
T_init_ph : float
Physical inital temperature
T_final_ph : float
Desired physical temperature after rescaling
T_delta_ph : float
Physical temperature step taken in rescaling
N_argon : float
Number of argon particles
N_steps : float
Number of timesteps
N_steps_set_T : float
Number of timesteps between temperature rescale
N_steps_av_E : float
Number of timesteps over which the last kinetic energies are averaged for new temperature transition
init_org : string
Organization of the initial particle positions
plot_org : string
Desired units of graphical representation
Returns
-------
X : (N_steps, N_argon, topology) array
Positions of all particles at all times
L_box : float
Size of box
"""
# CONVERSION TO NATURAL UNITS
density, h, T_init, T_final, T_delta, L_box, N_steps = conversion_natural_units(density_ph, h_ph, T_init_ph, T_final_ph, T_delta_ph, N_argon, N_steps, N_steps_set_T)
......@@ -104,5 +181,5 @@ def execute_calculations(density_ph, h_ph, T_init_ph, T_final_ph, T_delta_ph, N_
# VALIDATE
validation_table = validate.validation_table(density, T_init, E_kin, P_scalar, N_argon, U, Cv)
# Return
return X, L_box
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment