[mesa-users] total internal energy in history.data

William Wolf wmwolf at physics.ucsb.edu
Thu Jun 13 17:28:21 EDT 2013

Hi Masanobu,

Yes there is, if you want what I think you do.

In mesa/star/public/star_data.inc you will find a list of everything you have available to you in the star_info (s%) object. I'm guessing the one you want is 

      real(dp), pointer :: lnE(:)     ! log(specific internal energy)

So you would add one to how_many_extra_history_columns and then in data_for_extra_history_columns, set names(1) to whatever you want the column heading to be and vals(1) to the proper sum. You'll probably want to do some sort of do loop a la

	energy = 0
	do k = 1, s% nz
	  energy = energy + EXP(s% lnE(k)) * s% dm(k)

	vals(1) = energy

where you would obviously have had to declare the variables energy and k. (nz and dm are the total number of cells and the baryonic mass in each cell, respectively, as found in star_data.inc).

With that, you should get the output you want in your history file, and I assume the resulting units would be in erg, but you might need to confirm that one was taken form erg/g and that dm is in g, not Msun.



On Jun 13, 2013, at 6:14 AM, Masanobu Kunitomo <kunitomo at geo.titech.ac.jp> wrote:

> Dear all,
> I am using MESA version 4589 and I have a question about how to output the total internal energy of a star.
> Although "energy" for each cell is available in the profile data, there is no line for the total internal energy in the history_columns.list.
> Is it possible to output it using the subroutine ``data_for_extra_history_columns"?
> Sincerely,
> Masanobu Kunitomo
> --
> Masanobu Kunitomo
> Ph.D. student / JSPS Researcher
> Tokyo Institute of Technology
> Dept. of Earth and Planetary Sciences
> Email: kunitomo at geo.titech.ac.jp
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by Windows:
> Build for Windows Store.
> http://p.sf.net/sfu/windows-dev2dev_______________________________________________
> 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/20130613/617f08a7/attachment.html>

More information about the Mesa-users mailing list