This page doccuments a "first order" interface between stellar evolution and stellar dynamics codes. A simple C programme is provided that implements the stellar evolution part of the interface.
The interface consists of a set of function calls. These functions should be provided by the stellar evolution package or some suitable wrapper therein and constitute the method by which information is passed between the two codes.
The simplest implementation of the interface requires only the four function calls listed below. Useful calls to add would be a DELETE function to delete a star and a DUMP call to print out stellar data.
|SETUP()||Initial set up|
|INIT(N, M, ΔtSE, R)||initialise stellar model|
|LOOKUP(N, t, M, R, ΔtSE, L, k*)||look up stellar data|
|CMBODY(N1, N2, M, ΔtSE, R)||merge two stars|
The symbols are as follows:
|N||Integer||Name of star (identifying number)|
|M||Double||Mass of star|
|ΔtSE||Double||Stellar evolution timescale|
|k*||Integer||Type of star|
The quantities above should all be passed as pointers of the relevent type to:
Hence the function call CREATE might be implemented in C as:
void create (int *N, double *M, double *deltat, double *R);Or in FORTRAN 77 as:
SUBROUTINE CREATE(N, M, DELTAT, R) IMPLICIT NONE REAL*8 M, DELTAT, R INTEGER N
Stellar types are as defined by Hurley, Tout and Pols (2000), viz:
|0||Low mass main sequence|
|4||Core helium burning (blue loop)|
|7||Helium main sequence|
|10||Helium white dwarf|
The following implementation was developed in a free afternoon during the MODEST-6a meeting in Lund.
This toy code was mostly developed in order to see whether I could write a very basic stellar evolution code in an afternoon. Hence it does not implement realistic physics. The code uses interpolation formulae based on those in Eggleton, Fitchet and Tout (1989).
Simon P.-Z. has pointed out that the original version of toy_SE produces some stars with negative ZAMS radii -- this has now been fixed.
The code can be found here. Please excuse the horrible coding style...