Skip to content

Commit 97bb6fd

Browse files
committed
feat: Update make_particles.py to include disk mass calculation
This commit modifies the make_particles.py script to include the calculation of the disk mass. The disk mass is now calculated based on the sum of the masses of the particles in the output data. This ensures that the disk mass is accurately represented in the simulation.
1 parent b8a1d6d commit 97bb6fd

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

tools/make_particles.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,15 @@ def norm_dist(x0=0.3, scale=0.01, xmin=0, xmax=1.0):
8181
data_in = {}
8282
names = ["mass", "a", "e", "M", "w", "R"]
8383
# PARÁMETROS A VARIAR (Poner unidades de ser necesario)
84-
data_in["mass"] = [rndm(12, 15, lambda x: 10 ** x)]
84+
data_in["mass"] = [rndm(0.0, 1.)]
8585
data_in["a"] = [0.0]
8686
data_in["e"] = [0.0] # Podría ser: rayleigh_dist(0, 0.1, 1)
8787
data_in["M"] = [rndm(0.0, 360.0)]
8888
data_in["w"] = [0.0]
89-
data_in["R"] = [n_steps(0.5, 3.5, 4)]
89+
data_in["R"] = [n_steps(0.5, 3.5, 4000)]
90+
91+
# Disk mass (in kg)
92+
disk_mass = 6.3e15
9093

9194
# -----------------
9295
# OUTPUT
@@ -228,6 +231,9 @@ def shuffle_matrix(matrix):
228231
# Remove mass if not needed
229232
if not use_mass:
230233
data_out = data_out[:, 1:]
234+
elif disk_mass > 0:
235+
temp = np.sum(data_out[:, 0])
236+
data_out[:, 0] = disk_mass * data_out[:, 0] / temp
231237

232238
# Guardamos
233239
if not check_continue(filename):

0 commit comments

Comments
 (0)