[mesa-users] total internal energy in history.data
Matteo Cantiello
cantiel at kitp.ucsb.edu
Thu Jun 13 17:42:22 EDT 2013
Yep,
alternatively you can use the DOT_PRODUCT function, which makes this extra easy.
Something like this should work:
energy = dot_product(s% E(1:nz), s% dm(1:nz)))
-M
On Jun 13, 2013, at 2:28 PM, William Wolf wrote:
> 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)
> end
>
> 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.
>
> Regards,
>
> Bill
>
> 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
>
> ------------------------------------------------------------------------------
> 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
Dr. Matteo Cantiello ------------------------
Kavli Institute for Theoretical Physics
Room 2411 Kohn Hall CA 93106-4030
University of California, Santa Barbara
---------------- http://matteocantiello.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.mesastar.org/pipermail/mesa-users/attachments/20130613/ffaf11c3/attachment.html>
More information about the Mesa-users
mailing list