[Mesa-users] Follow-up on Modifying Double_BH Test Suite in MESA: Switching Accretor and Donor
Levi
lileiixx at 163.com
Wed Jul 24 14:57:21 UTC 2024
Dear MESA-users group,
I am writing to provide further details on the modifications I made to the double_bh test suite in MESA version 24.03.1, specifically in the run_binary_extras.f90 file, as mentioned in my previous email. I have attached the complete code in a compressed file for your reference.
Here is the additional code I implemented in the extras_binary_finish_step(binary_id) subroutine:
if (b% rl_relative_gap(b% d_i) > -0.05 .and. b% rl_relative_gap(b% a_i) > -0.05) then
write(*,*) "rl_relative_gap(b% a_i)", b% rl_relative_gap(b% a_i)
write(*,*) "s_accretor% w_div_w_crit_avg_surf", b% s_accretor% w_div_w_crit_avg_surf
if (b% s_accretor% w_div_w_crit_avg_surf > 0.95 .and. b% s_donor% w_div_w_crit_avg_surf < 0.95) then
switch_donor = .true.
else if (b% s_donor% w_div_w_crit_avg_surf > 0.95 .and. b% s_accretor% w_div_w_crit_avg_surf > 0.95) then
extras_binary_finish_step = terminate
end if
end if
if (switch_donor) then
write(*,*) "switching donor"
if (b% d_i == 2) then
b% d_i = 1
b% a_i = 2
b% s_donor => b% s1
b% s_accretor => b% s2
else
b% d_i = 2
b% a_i = 1
b% s_donor => b% s2
b% s_accretor => b% s1
end if
end if
Upon running the simulation with these modifications, I encountered an error related to accretion species mass fractions not adding up to 1.0. I have included the terminal output in the attached file rn.out for your reference.
I would greatly appreciate any insights into what might be causing this error and how I could resolve it. Additionally, if there are any suggestions or best practices for modifying the MESA code to switch accretor and donor stars based on specific conditions, I would be very thankful to hear them.
Thank you very much for your time and assistance. I look forward to your response.
Best regards,
Levi
---- Replied Message ----
| From | Levi via Mesa-users<mesa-users at lists.mesastar.org> |
| Date | 7/17/2024 19:49 |
| To | mesa-users at lists.mesast…<mesa-users at lists.mesastar.org> |
| Subject | [Mesa-users] Issues with modifying double_bh test suite to switch accretor and donor |
Dear MESA-users group,
I am currently using MESA version 24.03.1 and have been attempting to modify the double_bh test suite to switch the accretor and donor stars based on certain conditions. To achieve this, I added the following code to the run_binary_extras.f90 file:
if (b% rl_relative_gap(b% d_i) > -0.05 .and. b% rl_relative_gap(b% a_i) > -0.05) then write(*,*) "rl_relative_gap(b% a_i)", b% rl_relative_gap(b% a_i) write(*,*) "s_accretor% w_div_w_crit_avg_surf", b% s_accretor% w_div_w_crit_avg_surf if (b% s_accretor% w_div_w_crit_avg_surf > 0.95 .and. b% s_donor% w_div_w_crit_avg_surf < 0.95) then switch_donor = .true. else if (b% s_donor% w_div_w_crit_avg_surf > 0.95 .and. b% s_accretor% w_div_w_crit_avg_surf > 0.95) then extras_binary_finish_step = terminate end if end if
However, upon running the simulation, I encountered the following error:
get_xa_for_accretion: accretion species mass fractions do not add to 1.0 sum(xa(1:species)) 0.0000000000000000D+00 h1 1 0.0000000000000000D+00 he3 2 0.0000000000000000D+00 he4 3 0.0000000000000000D+00 c12 4 0.0000000000000000D+00 n14 5 0.0000000000000000D+00 o16 6 0.0000000000000000D+00 ne20 7 0.0000000000000000D+00 mg24 8 0.0000000000000000D+00 retry: get_xa_for_accretion failed in adjust mass 176 retry: get_xa_for_accretion failed in adjust mass 176
I am unsure what might be causing this issue, and I have attached the terminal output in the file rn.out for your reference.
Could anyone please provide some insight into what might be causing this error and how I might resolve it?
Thank you very much for your time and assistance.
Best regards,
Levi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.mesastar.org/pipermail/mesa-users/attachments/20240724/6647a316/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: template.zip
Type: application/x-zip-compressed
Size: 4954728 bytes
Desc: not available
URL: <https://lists.mesastar.org/pipermail/mesa-users/attachments/20240724/6647a316/attachment-0001.bin>
More information about the Mesa-users
mailing list