[Mesa-users] Obtaining information inside __extras.f90 to use for a custom hook
James Munday
james.munday98 at gmail.com
Fri Feb 4 14:18:23 UTC 2022
Hi all,
I'm struggling to obtain the information I want when setting a custom hook
(setting use_other_jdot_ml = .true. in the binary controls).
For what I want to set it to, I need the mass transfer rate (b%
mtransfer_rate or similar), the masses of the stars at every step and the
orbital angular momentum, Jorb, at every step. When accessing it, the value
of b% mtransfer_rate is of the order of ~10^17 for a transfer of 10^-9
solar masses in pgplot/terminal.
Trying b% m1 and b% m2 just gives what the masses were initialised to be in
solar masses in inlist_project, and their units and magnitude are not
consistent with this mtransfer_rate value - I would like the current m1 m2.
To get Jorb, it is printed in the terminal and log, but I'm not sure how to
access that live either. I can get b% jdot_gr or b% jdot_ml fine, which are
identical values to those output in the terminal.
So the options are:
- Obtain all values in units that are consistent with b% mtransfer_rate
and compute jdot_ml
- Obtain all values in the format of those output in terminal and compute
Would someone please give me a point in the right direction for how to do
either of these options? My subroutine is attached below with comments for
the desired steps.
Ultimately, I'm trying to get
jdot_ml_term = Jorb * SQRT(rh*(1.0+mass1/mass2)) * mdot/mass1 ; with rh a
function of mass1 and mass2 only.
Many thanks in advance for any help,
James
subroutine jdot_extra_jdot_routine(binary_id, ierr)
integer, intent(in) :: binary_id
integer, intent(out) :: ierr
double precision :: mass1, mass2, jdot_ml_term, rh, mdot
type (binary_info), pointer :: b
ierr = 0
call binary_ptr(binary_id, b, ierr)
if (ierr /= 0) then
write(*,*) 'failed in binary_ptr'
return
end if
mass1 = b% m1 !* m1 here is the donor
mass2 = b% m2
!masses above only get the initial mass (in solar masses) set in
inlist_project, not the current mass from star. think I want to access
something in s%
rh = 0.0883 + 0.04858*LOG10(mass2 / mass1) + 0.11489*LOG10(mass2 /
mass1)*LOG10(mass2 / mass1) - 0.020475*LOG10(mass2 / mass1)*LOG10(mass2 /
mass1)*LOG10(mass2 / mass1)
mdot = b% mtransfer_rate
jdot_ml_term = SQRT(rh*(1.0+mass1/mass2)) * mdot/mass1 ! * Jorb <-
this is needed
! WANT Jdot_ml_term = Jorb * SQRT((1+mass1/mass2) * rh ) * mdot
/ mass1
! to do this, want the value of M1 and M2 at each step
! and the current Jorb
Overall for a run, values have (from reading terminal, mass
transferring):
binary_step M1+M2 separ Porb e M2/M1
pm_i donor_i dot_Mmt eff Jorb dot_J dot_Jmb
lg_dt M1 R1 P1 dot_e vorb1
RL1 Rl_gap1 dot_M1 dot_Medd spin1 dot_Jgr dot_Jls
age_yr M2 R2 P2 Eorb vorb2
RL2 Rl_gap2 dot_M2 L_acc spin2 dot_Jml rlo_iters
__________________________________________________________________________________________________________________________________________________
bin 540 0.891000 0.093317 0.003498 0.000E+00 3.665089
2 1 -1.667E-09 0.942808 2.614E+50 -1.082E+37 0.000E+00
2.125646 0.190993 0.025569 0.000000 0.000E+001060.298005
0.025568 3.888E-05 -1.667E-09 2.702E-08 0.000E+00 -1.082E+37 0.000E+00
1.0624E+07 0.700007 0.000000 0.000000 -2.717E+48 289.296627
0.046074 -1.000E+00 1.572E-09 5.399E+36 0.000E+00 -2.419E+32 5
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.mesastar.org/pipermail/mesa-users/attachments/20220204/578a2de0/attachment.htm>
More information about the Mesa-users
mailing list