wneq package
A package of python routines to handle webnucleo equilibria.
wneq.base module
This module contains base elements for the equilibrium classes.
- class wneq.base.Base(nuc)[source]
Bases:
objectA class for handling data for the equilibrium codes.
- Args:
nuc: A wnnet nuclear data object.
- update_initial_guesses(guesses)[source]
Method to update initial guesses for chemical potentials divided by kT.
- Args:
guesses(dict, optional): A dictionary of the guesses. The allowed keys of the dictionary are “n” (for the neutrons), “p” (for the protons), or XPath expressions defining the valid clusters for the equilibrium. The value for each key should be a float giving the initial guess for the chemical potential divided by kT for the species or cluster.- Returns:
On successful return, the initial guesses for the species or clusters defined by the input keys are updated to the corresponding values. These guesses will then be applied in the next calculation of the equilibrium.
wneq.ng module
This module computes (n,g)-(g,n) equilibrium from webnucleo files.
- class wneq.ng.Ng(nuc)[source]
Bases:
BaseA class for handling (n,g)-(g,n) equilibria.
- compute(t9, rho, mun, y_z)[source]
Method to compute an (n,g)-(g,n) equilibrium.
- Args:
t9(float): The temperature (in 10 9 Kelvin) at which to compute the equilibrium.rho(float): The mass density in grams per cc at which to compute the equilibrium.mun(float): The neutron chemical potential (in MeV) at which to compute the equilibrium..y_z(dict): A dictionary with the elemental abundances for the calculation. The keys of the dictionary areintgiving the atomic number while the value is the abundance per nucleon for that atomic number. On successful return, the equilibrium abundances will have the same elemental abundances as those given in y_z.- Returns:
A wnutils zone data dictionary with the results of the calculation.
- compute_with_root(t9, rho, y_z)[source]
Method to compute an (n,g)-(g,n) equilibrium. The resulting equilibrium is that the system would relax to in the absence of charge-changing reactions and given sufficient time. The return result contains the neutron abundance and chemical potential for the appropriate equilibrium.
- Args:
t9(float): The temperature (in 10 9 Kelvin) at which to compute the equilibrium.rho(float): The mass density in grams per cc at which to compute the equilibrium.y_z(dict): A dictionary with the elemental abundances for the calculation. The keys of the dictionary areintgiving the atomic number while the value is the abundance per nucleon for that atomic number. On successful return, the equilibrium abundances will have the save elemental abundances as those given in y_z.- Returns:
A wnutils zone data dictionary with the results of the calculation.
- compute_with_root_from_zone(zone)[source]
Method to compute an (n,g)-(g,n) equilibrium. The resulting equilibrium is that the system would relax to in the absence of charge-changing reactions and given sufficient time. The return result contains the neutron abundance and chemical potential for the appropriate equilibrium.
wneq.equil module
This module computes general constrained equilibria from webnucleo files.
- class wneq.equil.Equil(nuc)[source]
Bases:
BaseA class for handling constrained equilibria.
- compute(t9, rho, ye=None, clusters=None)[source]
Method to compute a nuclear equilibrium.
- Args:
t9(float): The temperature (in 10 9 Kelvin) at which to compute the equilibrium.rho(float): The mass density in grams per cc at which to compute the equilibrium.ye(float, optional): The electron fraction at which to compute the equilibrium. If not supplied, the routine computes the equilibrium without a fixed total neutron-to-proton ratio.clusters(dict, optional): A dictionary with the key for each entry giving the XPath describing the cluster and the value giving the abundance constraint for the cluster.- Returns:
A wnutils zone data dictionary with the results of the calculation.
- compute_from_zone(zone, compute_ye=True, clusters=None)[source]
Method to compute an equilibrium from input zone data. The resulting equilibrium is that to which the system would relax given sufficient time.
- Args:
zone: A wnutils zone data dictionary with the physical conditions and abundances from which to compute the equilibrium.compute_ye(bool, optional): A boolean to determine whether to compute the electron fraction in the zone and use it for the equilibrium calculation.clusters(list, optional): A list of XPath strings describing the desired clusters for the equilibrium.- Returns:
A wnutils zone data dictionary with the results of the calculation.
- compute_low_temperature_nse(ye=None)[source]
Method to compute a nuclear statistical equilibrium at low temperature in a one- or two-species approximation.
- Args:
ye(float, optional): The electron fraction at which to compute the equilibrium. If not supplied, the routine computes the equilibrium without a fixed total neutron-to-proton ratio, in which case, the equilibrium is computed in a one-species approximation.- Returns:
A wnutils zone data dictionary with the results of the calculation.