[Mesa-users] Failure of getting the effective temperature in run_binary_extras
Rob Farmer
r.j.farmer at uva.nl
Mon Mar 15 12:56:51 UTC 2021
Hi,
So the problem is that mass transfer must be computed at the very start of
a step, before most of the data arrays have been set for the new step. See
for instance the notes in star/other/other_wind.f90 which has the same
problem:
! NOTE: don't assume that vars are set at this point.
! so if you want values other than those given as args,
! you should use values from s% xh(:,:) and s% xa(:,:) only.
! rather than things like s% Teff or s% lnT(:) which have not been
set yet.
So in your case you should access the temperature and other surface
properties using the s% xh array with contains the structure variables
while s%xa contains the abundances:
So for the (natural log) surface temperature that is s% xh(i_lnT,1)
With 12115 look in star/public/star_data.inc for the different i_*
variables which define the quantities available in s% xh.
If you really the need the photosphere and not just zone 1, then look at
how mesa computes the photosphere information in get_phot_info in
star/private/star_utils.f90.
Rob
On Sun, 14 Mar 2021 at 01:35, M Sun via Mesa-users <
mesa-users at lists.mesastar.org> wrote:
> Dear MESA users,
>
> I am trying to add a wind mass accretion mechanism in MESA 12115. I failed
> to get the effective temperature of the donor star in the subroutine
> my_other_binary_wind_transfer from src/run_binary_extras.f. I guess that I
> misuse/misunderstand the pointers. Here is the detail ---
>
> The declaration and association of the star and binary pointers are:
> subroutine my_other_binary_wind_transfer(binary_id, s_i, ierr)
> implicit none
> integer, intent(in) :: binary_id, s_i ! s_i is index of the wind
> mass losing star
> integer, intent(out) :: ierr
> type (binary_info), pointer :: b
> type (star_info), pointer :: s
> ierr = 0
> call binary_ptr(binary_id, b, ierr)
> if (ierr /= 0) then
> write(*,*) 'failed in binary_ptr'
> return
> end if
>
> if (s_i == 1) then
> s => b% s1
> else
> s => b% s2
> end if
> print*, b% s1% T(1)
>
> I call the effective temperature by "b% s1% T(1)". The output looks good
> at the very first step, then it becomes "NaN" at the following steps.
>
> I realize T(1) is surface temperature, not the effective temperature, just
> use it as an example of calling the star information from the binary
> module. The run_binary_extras.f and the binary inlist are attached
> (starting at line 99 in run_binary_extras is my code). Please let me know
> if you need more information. Many thanks!!
>
> cheers,
> --------------
> Sun, Meng
> Research Associate
> Department of Astronomy
> University of Wisconsin - Madison
> https://sunmeng1118.wixsite.com/mysite
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.mesastar.org/pipermail/mesa-users/attachments/20210315/184e5c81/attachment.htm>
More information about the Mesa-users
mailing list