Warning: This is no longer the latest available version of this module. Please see the releases page for the most recent version. The Webnucleo group strongly recommends the use of the latest version of any of its online modules.
This tutorial demonstrates how to use the example codes in the wn_simple_gce distribution src/examples directory.
Example 1: Create a simple GCE model and compute the total mass, the mass in stars, and the mass in gas.
wn_simple_gce routines demonstrated in example1.c are:
- Line 78: WnSimpleGce__new()
- Line 84: WnSimpleGce__updateInitialGasMass()
- Line 86: WnSimpleGce__updateInfallKValue()
- Line 88: WnSimpleGce__updateInfallDelta()
- Line 90: WnSimpleGce__updateOmega()
- Line 103: WnSimpleGce__computeInfallRate()
- Line 104: WnSimpleGce__computeTotalMass()
- Line 105: WnSimpleGce__computeStarMass()
- Line 106: WnSimpleGce__computeGasMass()
- Line 117: WnSimpleGce__free()
To run example1, type the following on the command line:
./example1 1.e10 1 0.1 0.299 > ex1_output.txt
The result is ex1_output.txt
Example 2: Compute the gas consumption rate omega from the gas fraction at a given time.
wn_simple_gce routines demonstrated in example2.c are:
- Line 74: WnSimpleGce__new()
- Line 76: WnSimpleGce__updateInfallKValue()
- Line 77: WnSimpleGce__updateInfallDelta()
- Line 84: WnSimpleGce__computeOmegaFromGasFraction()
- Line 96: WnSimpleGce__getInfallKValue()
- Line 97: WnSimpleGce__getInfallDelta()
- Line 104: WnSimpleGce__getOmega()
- Line 111: WnSimpleGce__free()
To run example2, type the following on the command line:
./example2 1 0.5 0.1 12. > ex2_output.txt
The result is ex2_output.txt
Example 3: Use a supplied infall function in place of the default.
wn_simple_gce routines demonstrated in example3.c are:
- Line 82: WnSimpleGce__new()
- Line 88: WnSimpleGce__updateInitialGasMass()
- Line 90: WnSimpleGce__updateInfallKValue()
- Line 92: WnSimpleGce__updateInfallDelta()
- Line 94: WnSimpleGce__updateOmega()
- Line 109: WnSimpleGce__setInfallRateFunction()
- Line 123: WnSimpleGce__computeTotalMass()
- Line 124: WnSimpleGce__computeGasMass()
- Line 125: WnSimpleGce__computeStarMass()
- Line 146: WnSimpleGce__free()
To run example3, type the following on the command line:
./example3 1.e10 1 0.1 0.299 0.15 > ex3_output.txt
The result is ex3_output.txt
Example 4: Compute the primary metallicity as a function of time in a simple GCE model.
wn_simple_gce routines demonstrated in example4.c are:
- Line 84: WnSimpleGce__new()
- Line 90: WnSimpleGce__updateInitialGasMass()
- Line 92: WnSimpleGce__updateInfallKValue()
- Line 94: WnSimpleGce__updateInfallDelta()
- Line 96: WnSimpleGce__updateOmega()
- Line 98: WnSimpleGce__updatePrimaryMetallicityYield()
- Line 133: WnSimpleGce__computePrimaryMetallicity()
- Line 135: WnSimpleGce__setInfallPrimaryMetallicityFunction()
- Line 145: WnSimpleGce__clearInfallPrimaryMetallicityFunction()
- Line 151: WnSimpleGce__computeGasMass()
- Line 166: WnSimpleGce__free()
To run example4, type the following on the command line:
./example4 1.e10 1 0.1 0.299 0.012 > ex4_output.txt
The result is ex4_output.txt
Example 5: Compute a species yield as a function of time.
wn_simple_gce routines demonstrated in example5.c are:
- Line 92: WnSimpleGce__new()
- Line 98: WnSimpleGce__updateInitialGasMass()
- Line 100: WnSimpleGce__updateInfallKValue()
- Line 102: WnSimpleGce__updateInfallDelta()
- Line 104: WnSimpleGce__updateOmega()
- Line 106: WnSimpleGce__updatePrimaryMetallicityYield()
- Line 112: WnSimpleGce__Species__new()
- Line 121: WnSimpleGce__Species__updateYieldCoefficient()
- Line 144: WnSimpleGce__computePrimaryMetallicity()
- Line 145: WnSimpleGce__computeSpeciesYield()
- Line 156: WnSimpleGce__Species__free()
- Line 157: WnSimpleGce__free()
To run example5, type the following on the command line:
./example5 1.e10 1 0.1 0.299 0.012 al27 1.7e-5 > ex5_output.txt
The result is ex5_output.txt
To run with a secondary component to the yield (the beta term), add that to the command line:
./example5 1.e10 1 0.1 0.299 0.012 al27 1.7e-5 2.1e-3 > ex5_output_beta.txt
The result is ex5_output_beta.txt
It is also possible to add higher order terms:
./example5 1.e10 1 0.1 0.299 0.012 al27 1.7e-5 2.1e-3 -1.e-2 > ex5_output_gamma.txt
The result is ex5_output_gamma.txt
Example 6: Compute the mass fraction of a species in the gas as a function of time.
wn_simple_gce routines demonstrated in example6.c are:
- Line 95: WnSimpleGce__new()
- Line 101: WnSimpleGce__updateInitialGasMass()
- Line 103: WnSimpleGce__updateInfallKValue()
- Line 105: WnSimpleGce__updateInfallDelta()
- Line 107: WnSimpleGce__updateOmega()
- Line 109: WnSimpleGce__updatePrimaryMetallicityYield()
- Line 115: WnSimpleGce__Species__new()
- Line 121: WnSimpleGce__Species__updateDecayRate()
- Line 130: WnSimpleGce__Species__updateYieldCoefficient()
- Line 153: WnSimpleGce__computeSpeciesMassFraction()
- Line 164: WnSimpleGce__Species__free()
- Line 165: WnSimpleGce__free()
To run example6, type the following on the command line:
./example6 1.e10 1 0.1 0.299 0.012 al27 0. 1.7e-5 > ex6_output.txt
The result is ex6_output.txt
To run with a secondary component to the yield (the beta term), add that to the command line:
./example6 1.e10 1 0.1 0.299 0.012 al27 0. 1.7e-5 2.1e-3 > ex6_output_beta.txt
The result is ex6_output_beta.txt
To run with a species that has is radioactive, add the non-zero decay rate to the command line:
./example6 1.e10 1 0.1 0.299 0.012 al26 967. 2.2e-7 6.5e-6 > ex6_output_rad.txt
The result is ex6_output_rad.txt
Example 7: Compute the ISM mass fraction ratio of a radioactive species relative to that of a reference (stable or radioactive) isotope as a function of time.
wn_simple_gce routines demonstrated in example7.c are:
- Line 115: WnSimpleGce__new()
- Line 121: WnSimpleGce__updateInitialGasMass()
- Line 123: WnSimpleGce__updateInfallKValue()
- Line 125: WnSimpleGce__updateInfallDelta()
- Line 127: WnSimpleGce__updateOmega()
- Line 129: WnSimpleGce__updatePrimaryMetallicityYield()
- Line 135: WnSimpleGce__Species__new()
- Line 137: WnSimpleGce__Species__updateDecayRate()
- Line 139: WnSimpleGce__Species__updateYieldCoefficient()
- Line 167: WnSimpleGce__computeSpeciesMassFraction()
- Line 179: WnSimpleGce__Species__free()
- Line 181: WnSimpleGce__free()
To run example7, type the following on the command line:
./example7 1.e10 1 0.1 0.299 0.012 al26 967. 2.2e-7 6.5e-6 al27 0. 1.7e-5 2.1e-3 > ex7_output.txt
The result is ex7_output.txt
Example 8: Compute the remainder of a radioactive species (mass fraction in the gas relative to that if the species were stable) as a function of time.
wn_simple_gce routines demonstrated in example8.c are:
- Line 96: WnSimpleGce__new()
- Line 102: WnSimpleGce__updateInfallKValue()
- Line 104: WnSimpleGce__updateInfallDelta()
- Line 106: WnSimpleGce__updateOmega()
- Line 108: WnSimpleGce__updatePrimaryMetallicityYield()
- Line 114: WnSimpleGce__Species__new()
- Line 116: WnSimpleGce__Species__updateYieldCoefficient()
- Line 138: WnSimpleGce__Species__updateDecayRate()
- Line 148: WnSimpleGce__computeSpeciesMassFraction()
- Line 172: WnSimpleGce__Species__free()
- Line 174: WnSimpleGce__free()
To run example8, type the following on the command line:
./example8 1 0.1 0.299 0.012 al26 967. 2.2e-7 6.5e-6 > ex8_output.txt
The result is ex8_output.txt