[mesa-users] Total Energy Integral
Bill Paxton
paxton at kitp.ucsb.edu
Mon Mar 9 19:25:16 EDT 2015
Hi,
I'd suggest a careful reading of the following two lines of code -- think about what the various terms mean. check where things are defined (cell center vs cell boundary). what's the difference between dm and dm_bar, and why do we use dm for total energy and dm_bar for gravitational energy? what's the definition of s% energy(k)? what disagreements could arise between dm or dm_bar vs 4*pi*r^2*rho*dr given that we are considering finite volumes rather than differential equations? hopefully enlightenment will follow. ;D
we sum the following for k = 1, s% nz
total_internal_energy = dot_product(s% dm(1:k), s% energy(1:k))
total_gravitational_energy = -dot_product(s% dm_bar(1:k), &
s% cgrav(1:k)*s% m_grav(1:k)/s% r(1:k))
Cheers,
Bill
On Mar 9, 2015, at 1:22 PM, Michael Medford wrote:
> Hello everyone,
>
> Over the last few weeks I have been investigating the profile column variable labelled total_energy_integral. The description of this variable is "sum from surface inwards of dm*(v^2/2 - G m / r + E) (ergs)". I was confused as to whether this sum includes the necessary volume elements to properly sum the spherical shells within this integral. So I set about calculating my own energy integral using the necessary data from each cell within the profile. Here is how I calculated my integral:
>
> -Routines to shift each of the mass, radii and density terms to the center of each cell by taking averages of the outer and inner boundaries
> -Define "dr" as the radii width of each shell
> -Defining an "energy element" = (-Gm/r + E) * (4*pi*r^2*density*dr) where all of the terms are in cgs and the velocity of all of the cells are 0
> -Sum from the surface inwards of this energy element
>
> Attached you will see the results of my variable versus the output from the profile's total_energy_integral. As the energy integral claims to have a dm multiplied into each term, I did not multiply the total_energy_integral times anything, since this should be equivalent to (4*pi*r^2*density*dr).
>
> Does anyone know why these two values would be different, and by such large orders of magnitude? What am I missing about the total_energy_integral and what it is recording? Or am I manually summing the integral incorrectly?
>
> Thanks so much for the help.
> ~Michael
>
> ----
> Michael Medford
> Northwestern University
> <Energy_Integrals_2.png><Energy_Integrals_1.png>------------------------------------------------------------------------------
> Dive into the World of Parallel Programming The Go Parallel Website, sponsored
> by Intel and developed in partnership with Slashdot Media, is your hub for all
> things parallel software development, from weekly thought leadership blogs to
> news, videos, case studies, tutorials and more. Take a look and join the
> conversation now. http://goparallel.sourceforge.net/_______________________________________________
> mesa-users mailing list
> mesa-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mesa-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.mesastar.org/pipermail/mesa-users/attachments/20150309/133b8c06/attachment.html>
More information about the Mesa-users
mailing list