optmat.gas.virial#
The refractivity virial coefficient of each gas, from the curated data.
The refractivity of a real gas departs from Lorentz-Lorenz through the pair term of the
virial expansion, (n^2 - 1)/(n^2 + 2) = A_R rho + B_R rho^2 + ...: a relative
correction B_R rho / A_R of order 1e-6 (helium) to 1e-4 (SF6) at 1 atm, and of order
1e-3 to 1e-2 at the tens of bar of gas-filled fibres. Which measured B_R each gas
uses is chosen in data/gas/refractivity_virial.toml, which points at curated
datasets; the values themselves come from those datasets.
Module Attributes
The per-gas choice of refractivity virial coefficient. |
Functions
|
Return a gas's pair term with its uncertainty, or its declared scale. |
Return the rules for the unlike pairs of a mixture (OEP 4, section 7.2). |
|
|
Return the bound on a gas's third refractivity virial term (OEP 4, 4.3). |
|
Return |
Return, per gas, the dataset keys of its |
Classes
|
A gas's own pair term, |
|
The bound on a gas's third refractivity virial term, for the optical domain. |
- class optmat.gas.virial.LikeTerm(gas, b, sigma, status, source, temperature, frequency, contribution)[source]#
Bases:
objectA gas’s own pair term,
B_R = b A_R, as a mixture takes it.- Attributes:
- gasstr
The species.
- bfloat
B_R / A_R, m^3/mol; 0 for an uncurated term.- sigmafloat
Its standard uncertainty, m^3/mol; for an uncurated term the declared scale.
- statusstr
curated,provisional(a published estimate, with its stated uncertainty: O2’s, egan_2026) orunknown.- sourcestr
The
B_Rdataset or formula, or empty.- temperaturefloat
The temperature it was measured at, K; NaN where there is none.
- frequencystr
static, or the vacuum wavelength in nm.- contributionstr
induced: an optical value, or a static one whose induced part is stated.
- class optmat.gas.virial.ThirdTerm(gas, ratio, status, source)[source]#
Bases:
objectThe bound on a gas’s third refractivity virial term, for the optical domain.
- Attributes:
- gasstr
The species.
- ratiofloat
|C_R| / A_R, m^6/mol^2; NaN for a gas with neitherB_RnorC_R, which has no third-term bound (OEP 4, section 4.3).- statusstr
measured(a curated C_R),bound(a measured bound),scale(the declaredthird_ratio B_R^2 / A_R) ornone.- sourcestr
The C_R dataset, or what gives the bound.
- optmat.gas.virial.VIRIAL_FILE: Final = PosixPath('/home/docs/checkouts/optmat/checkouts/7/src/optmat/data/gas/refractivity_virial.toml')#
The per-gas choice of refractivity virial coefficient.
- optmat.gas.virial.like_term(gas)[source]#
Return a gas’s pair term with its uncertainty, or its declared scale.
- Parameters:
- gasGas or str
The species.
- Returns:
- LikeTerm
The curated
bofvirial_ratio(), orunknownwithb = 0andpair_rules()’unknown_bas its scale.
- Raises:
- DataError
If a static
B_Rdoes not state that it is induced.
Examples
>>> like_term("D2").status 'unknown' >>> like_term("O2").status 'provisional' >>> f"{like_term('Ar').b * 1e6:.3f}" '0.419'
- optmat.gas.virial.pair_rules()[source]#
Return the rules for the unlike pairs of a mixture (OEP 4, section 7.2).
- Returns:
- Mapping
rule("mean"),reason,uncertainty,unknown_b(cm^3/mol),third_ratioanddensity_fraction.
- optmat.gas.virial.third_term(gas)[source]#
Return the bound on a gas’s third refractivity virial term (OEP 4, 4.3).
- Parameters:
- gasGas or str
The species.
- Returns:
- ThirdTerm
From its measured C_R, a measured bound, the declared scale on its B_R, or none.
Examples
>>> term = third_term("Ar") >>> term.status, f"{term.ratio * 1e12:.2f}" ('measured', '20.64')