deeplink to this page
astro 465
teaching
Astro 465Computational assignment 0CA0aLet's see if we can get the code to run and produce ouput. The first excercise should be easy, it uses default settings. Let's create a directory for this class and assignment in our home directory first and cd into it:cd
mkdir -p astro465/ca0/a
cd astro465/ca0/a/
We need to copy the default input files here:
cp /opt/stars/default_run/init.* .
Since the default input files are for 1 Mo and we're using the default (solar) metallicity here, we are ready
to start the code (in the background with &) while specifying the output file names only and compute our first model:
ev star &
You can check whether the code is actually doing something and producing output with:
tail -f star.out1
(kill with Ctrl-C). This will show 7-line blocks of output, which are pretty incomprehensible at first sight.
The number in the upper-left of the block shows the model number (by default, output is shown for every fifth model),
below that are the mass of the star (Mo), the time step (yr) and the age of the star (yr) among others.
The first two numbers in column 7 (MH/Me) show the Helium and CO core mass (Mo), the first three numbers in the
next 10 columns (XH ... logT) show the central, Tmax and surface values of some abundances (Xxx) and the logs
of the pressure, density and temperature.
When the code is done with the model, it will report something like: Evolution done
[1]- Done ev star
You should verify that the code computed a couple of thousand iterations. If it's a few hundred or less, something went wrong.
The last bit of my star.out1 (after chopping a few columns) looks like (don't worry about the ERR message):
Accepting solution with ERR = -7.42
Model=6021, age=12.0Gyr, Mhe~Hco~0.7Mo. Congratulations! Your first stellar model! Aren't you excited?
6021 M/dty/ ...MH/Me/MC/ XH XHe XC XN XO XNe XMg psi logrho logT age/cm/Horb ... MH/Me convective/semiconvective boundaries k**2 logR logL 9.999993540D-01 ... 0.707 0.00000 0.00000 0.14758 0.00000 0.82835 0.02047 0.00048 52.1730 6.6931 7.89467 cntr 2.857268256D-03 ... 0.697 0.00000 0.48821 0.38710 0.00000 0.09985 0.02126 0.00047 -3.3422 3.4159 8.42114 Tmax 1.200089043D+10 ... 0.000 0.67149 0.30839 0.00285 0.00183 0.01003 0.00184 0.00046-20.2227 -9.1403 3.44084 srfc 2.251108407D+02 ... 0.197 0.000 0.698 -0.706 0.707 -0.707 0.708 -0.986 0.0000 2.6559 4.02834 8.180927998D+05 ... 0.096 0.000 0.698 -0.706 0.707 -0.707 0.708 0.077 6021 1 switch to * 2 CA0bAllright, new star, different mass and different metallicity. We want to change the mass from 1.0 to M and the metallicity from 0.02 to Z (as found in your assignment). You can choose to work in the same directory as before, but I personally like using different directories for different models, to keep some overview (and our init.* files):mkdir ../b
cp init.* ../b/
cd ../b/
Changing the mass is done in the file init.run, so open it with your editor. For reasons that we won't go into here (but see
the section init.run in the manual), the initial mass of the star is in there twice. First, find the parameter called ML1
(Ctrl-W in nano is for Where Is),
which contains the 10log of the mass. It's currently set to 0.00E+00 (we copied the file from our 1.0 Mo
model), so use your slide ruler to figure out what 10log M is and put it in. Make sure you keep the comma after the number!
The second instance of the initial mass, linear this time, is in the variable SM. Find it and change it from 1.0 to M.
Save the file and exit your editor.
The second difference from the previous model is the metallicity. As you can see in section 1.2 of the manual, this is done when starting the code. As we see we leave out the first "0." from the metallicity, so that a metallicity of Z=0.001 is invoked as 001, Z=0.0004 is invoked as 0004, etc. Hence, if the metallicity in your assignment were Z=0.02, you would start the code as: ev star 02 &
CA0cFor this model, create a new directory and change the mass (twice: log & lin) in init.run as before. However, this time we need some additional physics. Models of massive stars more massive than about 1.5-2.0 Mo compare to observations better when we use so-called convective overshooting of the convective stellar core on the Main Sequence. In the code, this is treated as an extra mixing coefficient, described by a parameter called COS, which can be found in the file init.dat. So open the file in your editor and change the variable COS from 0.000E+000 to 0.120E+000 (just like CPS just below it). Section 3.10 of the manual gives a bit more information about these variables. Save the file, and start the code (make sure you use the right metallicity!). |