Skip to content

Athena++ radiation MHD (CFD) code, augmented for treatment of binary stellar systems. Additions: rotating frame, binary gravity (tidal effects).

License

Notifications You must be signed in to change notification settings

ppjanka/Athena_BinarySystem

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

athena

License

Athena++ radiation MHD code

======

Additions: rotating_frame, binary gravity.


Comments regarding the rotation src terms:

The source terms are handled in src/pgen/globAccDisk-src-rotating_barycenter.hpp. There's a simple testing problem generator in src/pgen/globAccDisk-test-rotating_barycenter.cpp (it creates a sphere and rotates the frame to see if it behaves as expected) and an example input file for it in inputs/hydro/athinput.rotating_frame.

A test suite to ensure the rotating frame is working correctly is located in tst/regression/scripts/tests/rotating_frame/. See Athena++ main page wiki for info on how to run them. Before running, the location of hdf5 installation must be changed in the regression scripts. Also, since my h5py has trouble with the new vis/python/athena_read.py, I am using the old version (included in the repo).

The implementation assumes rotation around the barycenter of a binary system with G(M1+M2) = 1, where GM1 is set in pmb->ruser_meshblock_data[0](0) by the problem generator, and the frame is centered on the GM1 object. Note that G(M1+M2) = 1 results in the orbital angular frequency of 1. To avoid multiplication by 1 and SQR(1) in the code, the orbital frequency is hard-coded to 1 (i.e., omitted), to improve performance. I tried to comment it as I went (hence all the /omega_frame/), so it should be easy to put the frame rotation frequency back in.


Comments concerning binary gravity:

The gravity source terms for the primary (GM1) and the secondary (GM2) component of the binary are handled in src/pgen/globAccDisk-src-primary_grav.hpp and src/pgen/globAccDisk-src-secondary_grav.hpp, respectively. There is a simple testing problem generator in src/pgen/globAccDisk-test-binary_gravity.cpp with an input file in inputs/hydro/athinput.binary_gravity, and a testing suite tst/regression/scripts/tests/binary_gravity (see HDF5 caveat above).

Again, G(M1+M2) = 1, where GM1 is set in pmb->ruser_meshblock_data[0](0).


Note:

  • At the time I was working on this code, one could only enroll a single function with EnrollUserExplicitSourceFunction(). If there are multiple functions handling source terms (e.g., two for primary and secondary gravity, one for rotating frame), they may need to be called from a wrapper function, and then EnrollUserExplicitSourceFunction() should be given that wrapper function as argument.

About

Athena++ radiation MHD (CFD) code, augmented for treatment of binary stellar systems. Additions: rotating frame, binary gravity (tidal effects).

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 83.6%
  • Python 14.9%
  • C 1.3%
  • Other 0.2%