Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a function to calculate shell masses #2434

Merged
merged 3 commits into from
Oct 9, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions tardis/energy_input/gamma_ray_transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,28 @@ def initialize_packets(
)


def calculate_shell_masses(model):

"""Function to calculate shell masses
Parameters
----------
model : tardis.Radial1DModel
The tardis model to calculate gamma ray propagation through
Returns
-------
numpy.ndarray
shell masses in units of g

"""
outer_velocities = model.v_outer.to("cm/s").value
andrewfullard marked this conversation as resolved.
Show resolved Hide resolved
inner_velocities = model.v_inner.to("cm/s").value
ejecta_density = model.density.to("g/cm^3").value
ejecta_volume = model.volume.to("cm^3").value
shell_masses = ejecta_volume * ejecta_density

return shell_masses


def main_gamma_ray_loop(
num_decays,
model,
Expand Down
Loading