Example Walkthrough: Simple Polytrope
As the first example of build_poly in action, let’s build a simple (i.e., single-region) \(n=3\) polytrope, that for instance describes the structure of a radiation-pressure dominated, fully convective star.
Assembling a Namelist File
First, let’s assemble a namelist file containing the various
parameters which control a build_poly run. Using a text
editor, create the file
build_poly.simple.in with the
following content cut-and-pasted in:
&poly n_poly = 3.0 ! Polytropic index of single region / &num dz = 1E-2 ! Radial spacing of points toler = 1E-10 ! Tolerance of integrator / &out file = 'poly.simple.h5' ! Name of output file /
Detailed information on the namelist groups expected in build_poly input files can be found in the Input Files section. Here, let’s briefly narrate the parameters appearing in the file above:
&polynamelist group, the
n_polyparameter sets the polytropic index.
&numnamelist group, the
dzparameter sets the radial spacing of points, and the
tolerparameter sets the tolerance of the numerical integrator.
&outputnamelist group, the
fileparameter sets the name of the output file.
To run build_poly, use the command
There is no screen output produced during the run, but at the end the
poly.simple.h5 will be written to disk. This file, which is in
POLY format, can be used as the input stellar
model in a GYRE calculation; but it can also be explored in Python
(see Fig. 12) using the
read_model function from