atmodeller package
Subpackages
- atmodeller.eos package
- Subpackages
- Submodules
- atmodeller.eos._aggregators module
CombinedRealGasCombinedRealGas.real_gasesCombinedRealGas.calibrationsCombinedRealGas.upper_pressure_boundsCombinedRealGas._volume_functionsCombinedRealGas._volume_integral_functionsCombinedRealGas.create()CombinedRealGas._append_lower_bound()CombinedRealGas._append_upper_bound()CombinedRealGas._get_upper_pressure_bounds()CombinedRealGas._get_index()CombinedRealGas.volume()CombinedRealGas.volume_integral()CombinedRealGas._abc_implCombinedRealGas.compressibility_factor()CombinedRealGas.dvdp()CombinedRealGas.dzdp()CombinedRealGas.fugacity()CombinedRealGas.fugacity_coefficient()CombinedRealGas.log_activity()CombinedRealGas.log_fugacity()CombinedRealGas.log_fugacity_coefficient()CombinedRealGas.pressure_from_fugacity()CombinedRealGas.volume_integral_J()
UpperBoundRealGasUpperBoundRealGas.real_gasUpperBoundRealGas.p_evalUpperBoundRealGas._z0()UpperBoundRealGas._dzdp0()UpperBoundRealGas.log_fugacity()UpperBoundRealGas.compressibility_factor()UpperBoundRealGas.volume()UpperBoundRealGas.volume_integral()UpperBoundRealGas._abc_implUpperBoundRealGas.dvdp()UpperBoundRealGas.dzdp()UpperBoundRealGas.fugacity()UpperBoundRealGas.fugacity_coefficient()UpperBoundRealGas.log_activity()UpperBoundRealGas.log_fugacity_coefficient()UpperBoundRealGas.pressure_from_fugacity()UpperBoundRealGas.volume_integral_J()
CombinedRealGasFugacityCombinedRealGasFugacity._abc_implCombinedRealGasFugacity.fugacity()CombinedRealGasFugacity.fugacity_coefficient()CombinedRealGasFugacity.log_activity()CombinedRealGasFugacity.log_fugacity_coefficient()CombinedRealGasFugacity.pressure_from_fugacity()CombinedRealGasFugacity.real_gasesCombinedRealGasFugacity.calibrationsCombinedRealGasFugacity.upper_pressure_boundsCombinedRealGasFugacity._log_fugacity_coefficient_functionsCombinedRealGasFugacity.min_log_fugacity_coefficientCombinedRealGasFugacity.max_log_fugacity_coefficientCombinedRealGasFugacity._get_upper_pressure_bounds()CombinedRealGasFugacity._get_index()CombinedRealGasFugacity.log_fugacity()
- atmodeller.eos._chabrier module
ChabrierChabrier.CHABRIER_DIRECTORYChabrier.log10_density_funcChabrier.He_fractionChabrier.H2_molar_mass_g_molChabrier.He_molar_mass_g_molChabrier.integration_stepsChabrier.create()Chabrier._get_interpolator()Chabrier._convert_to_molar_density()Chabrier.get_He_fraction_map()Chabrier.log_fugacity()Chabrier.volume()Chabrier.volume_integral()Chabrier._abc_implChabrier.compressibility_factor()Chabrier.dvdp()Chabrier.dzdp()Chabrier.fugacity()Chabrier.fugacity_coefficient()Chabrier.log_activity()Chabrier.log_fugacity_coefficient()Chabrier.pressure_from_fugacity()Chabrier.volume_integral_J()
ChabrierFunction_H2_3000K_chabrier21H2_3000K_chabrier21_H2_4000K_chabrier21H2_4000K_chabrier21calibration_chabrier21H2_chabrier21H2_chabrier21_boundedHe_chabrier21He_chabrier21_boundedH2_He_Y0275_chabrier21H2_He_Y0275_chabrier21_boundedH2_He_Y0292_chabrier21H2_He_Y0292_chabrier21_boundedH2_He_Y0297_chabrier21H2_He_Y0297_chabrier21_boundedget_chabrier_eos_models()
- atmodeller.eos._holland_powell module
CorrespondingStatesUnitConverterFullUnitConverterMRKCorrespondingStatesHP91MRKCorrespondingStatesHP91.critical_dataMRKCorrespondingStatesHP91._a_coefficientsMRKCorrespondingStatesHP91._bMRKCorrespondingStatesHP91.critical_pressureMRKCorrespondingStatesHP91.critical_temperatureMRKCorrespondingStatesHP91.create()MRKCorrespondingStatesHP91.a()MRKCorrespondingStatesHP91.b()MRKCorrespondingStatesHP91._abc_implMRKCorrespondingStatesHP91.compressibility_factor()MRKCorrespondingStatesHP91.dvdp()MRKCorrespondingStatesHP91.dzdp()MRKCorrespondingStatesHP91.fugacity()MRKCorrespondingStatesHP91.fugacity_coefficient()MRKCorrespondingStatesHP91.log_activity()MRKCorrespondingStatesHP91.log_fugacity()MRKCorrespondingStatesHP91.log_fugacity_coefficient()MRKCorrespondingStatesHP91.pressure_from_fugacity()MRKCorrespondingStatesHP91.volume()MRKCorrespondingStatesHP91.volume_integral()MRKCorrespondingStatesHP91.volume_integral_J()
MRKImplicitHP91ABCMixinMRKImplicitGasHP91MRKImplicitGasHP91.delta_temperature_for_a()MRKImplicitGasHP91.A_factor()MRKImplicitGasHP91.B_factor()MRKImplicitGasHP91._abc_implMRKImplicitGasHP91._objective_function()MRKImplicitGasHP91.a()MRKImplicitGasHP91.b()MRKImplicitGasHP91.compressibility_factor()MRKImplicitGasHP91.dvdp()MRKImplicitGasHP91.dzdp()MRKImplicitGasHP91.fugacity()MRKImplicitGasHP91.fugacity_coefficient()MRKImplicitGasHP91.initial_volume()MRKImplicitGasHP91.log_activity()MRKImplicitGasHP91.log_fugacity()MRKImplicitGasHP91.log_fugacity_coefficient()MRKImplicitGasHP91.pressure_from_fugacity()MRKImplicitGasHP91.volume()MRKImplicitGasHP91.volume_integral()MRKImplicitGasHP91.volume_integral_J()MRKImplicitGasHP91._a_coefficientsMRKImplicitGasHP91._bMRKImplicitGasHP91._TaMRKImplicitGasHP91._Tc
Tc_H2OTa_H2Ob0_H2OH2OMrkGasHolland91MRKImplicitLiquidHP91MRKImplicitLiquidHP91.delta_temperature_for_a()MRKImplicitLiquidHP91.A_factor()MRKImplicitLiquidHP91.B_factor()MRKImplicitLiquidHP91._abc_implMRKImplicitLiquidHP91._objective_function()MRKImplicitLiquidHP91.a()MRKImplicitLiquidHP91.b()MRKImplicitLiquidHP91.compressibility_factor()MRKImplicitLiquidHP91.dvdp()MRKImplicitLiquidHP91.dzdp()MRKImplicitLiquidHP91.fugacity()MRKImplicitLiquidHP91.fugacity_coefficient()MRKImplicitLiquidHP91.initial_volume()MRKImplicitLiquidHP91.log_activity()MRKImplicitLiquidHP91.log_fugacity()MRKImplicitLiquidHP91.log_fugacity_coefficient()MRKImplicitLiquidHP91.pressure_from_fugacity()MRKImplicitLiquidHP91.volume()MRKImplicitLiquidHP91.volume_integral()MRKImplicitLiquidHP91.volume_integral_J()MRKImplicitLiquidHP91._a_coefficientsMRKImplicitLiquidHP91._bMRKImplicitLiquidHP91._TaMRKImplicitLiquidHP91._Tc
H2OMrkLiquidHolland91MRKImplicitFluidHP91MRKImplicitFluidHP91.delta_temperature_for_a()MRKImplicitFluidHP91.initial_volume()MRKImplicitFluidHP91.A_factor()MRKImplicitFluidHP91.B_factor()MRKImplicitFluidHP91._abc_implMRKImplicitFluidHP91._objective_function()MRKImplicitFluidHP91.a()MRKImplicitFluidHP91.b()MRKImplicitFluidHP91.compressibility_factor()MRKImplicitFluidHP91.dvdp()MRKImplicitFluidHP91.dzdp()MRKImplicitFluidHP91.fugacity()MRKImplicitFluidHP91.fugacity_coefficient()MRKImplicitFluidHP91.log_activity()MRKImplicitFluidHP91.log_fugacity()MRKImplicitFluidHP91.log_fugacity_coefficient()MRKImplicitFluidHP91.pressure_from_fugacity()MRKImplicitFluidHP91.volume()MRKImplicitFluidHP91.volume_integral()MRKImplicitFluidHP91.volume_integral_J()MRKImplicitFluidHP91._a_coefficientsMRKImplicitFluidHP91._bMRKImplicitFluidHP91._TaMRKImplicitFluidHP91._Tc
H2OMrkFluidHolland91CO2_critical_dataCO2MrkHolland91H2OMrkGasFluid91H2OMrkGasFluid91.mrk_fluidH2OMrkGasFluid91.mrk_gasH2OMrkGasFluid91.TaH2OMrkGasFluid91.TcH2OMrkGasFluid91._select_condition()H2OMrkGasFluid91.volume_integral()H2OMrkGasFluid91.log_fugacity()H2OMrkGasFluid91.volume()H2OMrkGasFluid91._abc_implH2OMrkGasFluid91.compressibility_factor()H2OMrkGasFluid91.dvdp()H2OMrkGasFluid91.dzdp()H2OMrkGasFluid91.fugacity()H2OMrkGasFluid91.fugacity_coefficient()H2OMrkGasFluid91.log_activity()H2OMrkGasFluid91.log_fugacity_coefficient()H2OMrkGasFluid91.pressure_from_fugacity()H2OMrkGasFluid91.volume_integral_J()
H2OMrkHP91H2OMrkHP91.mrk_fluidH2OMrkHP91.mrk_gasH2OMrkHP91.mrk_liquidH2OMrkHP91.TaH2OMrkHP91.TcH2OMrkHP91.Psat()H2OMrkHP91._select_condition()H2OMrkHP91.volume_integral()H2OMrkHP91.log_fugacity()H2OMrkHP91.volume()H2OMrkHP91._abc_implH2OMrkHP91.compressibility_factor()H2OMrkHP91.dvdp()H2OMrkHP91.dzdp()H2OMrkHP91.fugacity()H2OMrkHP91.fugacity_coefficient()H2OMrkHP91.log_activity()H2OMrkHP91.log_fugacity_coefficient()H2OMrkHP91.pressure_from_fugacity()H2OMrkHP91.volume_integral_J()
H2OMrkHolland91CO2_mrk_cs_holland91CH4_mrk_cs_holland91H2_mrk_cs_holland91CO_mrk_cs_holland91N2_mrk_cs_holland91S2_mrk_cs_holland11H2S_mrk_cs_holland11H2O_mrk_fluid_holland91H2O_mrk_gas_holland91H2O_mrk_liquid_holland91H2O_mrk_gas_fluid_holland91virial_compensation_corresponding_statesexperimental_calibration_holland91experimental_calibration_holland98CH4_cork_cs_holland91CH4_cork_cs_holland91_boundedCO_cork_cs_holland91CO_cork_cs_holland91_boundedCO2_cork_cs_holland91CO2_cork_cs_holland91_boundedH2_cork_cs_holland91H2_cork_cs_holland91_boundedH2S_cork_cs_holland11H2S_cork_cs_holland11_boundedN2_cork_cs_holland91N2_cork_cs_holland91_boundedS2_cork_cs_holland11S2_cork_cs_holland11_boundeddummy_critical_dataCO2_virial_compensation_holland91CO2_cork_holland91CO2_cork_holland91_boundedH2O_virial_compensation_holland91H2O_cork_holland91H2O_cork_holland91_boundedH2O_cork_gas_fluid_holland91H2O_cork_gas_fluid_holland91_boundedCO2_virial_compensation_holland98CO2_cork_holland98CO2_cork_holland98_boundedH2O_virial_compensation_holland98H2O_cork_holland98H2O_cork_holland98_boundedH2O_cork_gas_fluid_holland98H2O_cork_gas_fluid_holland98_boundedget_holland_eos_models()
- atmodeller.eos._holley module
volume_conversion()A0_conversion()atm2bar()BeattieBridgemanBeattieBridgeman.A0BeattieBridgeman.aBeattieBridgeman.B0BeattieBridgeman.bBeattieBridgeman.cBeattieBridgeman._objective_function()BeattieBridgeman.log_fugacity()BeattieBridgeman.volume()BeattieBridgeman.volume_integral()BeattieBridgeman._abc_implBeattieBridgeman.compressibility_factor()BeattieBridgeman.dvdp()BeattieBridgeman.dzdp()BeattieBridgeman.fugacity()BeattieBridgeman.fugacity_coefficient()BeattieBridgeman.log_activity()BeattieBridgeman.log_fugacity_coefficient()BeattieBridgeman.pressure_from_fugacity()BeattieBridgeman.volume_integral_J()
pressure_minH2_beattie_holley58H2_beattie_holley58_boundedN2_beattie_holley58N2_beattie_holley58_boundedO2_beattie_holley58O2_beattie_holley58_boundedCO2_beattie_holley58CO2_beattie_holley58_boundedNH3_beattie_holley58NH3_beattie_holley58_boundedCH4_beattie_holley58CH4_beattie_holley58_boundedHe_beattie_holley58He_beattie_holley58_boundedget_holley_eos_models()
- atmodeller.eos._reid_connolly module
RedlichKwong49RedlichKwong49.critical_dataRedlichKwong49._aRedlichKwong49._bRedlichKwong49.critical_pressureRedlichKwong49.critical_temperatureRedlichKwong49.create()RedlichKwong49.a()RedlichKwong49.b()RedlichKwong49._abc_implRedlichKwong49.compressibility_factor()RedlichKwong49.dvdp()RedlichKwong49.dzdp()RedlichKwong49.fugacity()RedlichKwong49.fugacity_coefficient()RedlichKwong49.log_activity()RedlichKwong49.log_fugacity()RedlichKwong49.log_fugacity_coefficient()RedlichKwong49.pressure_from_fugacity()RedlichKwong49.volume()RedlichKwong49.volume_integral()RedlichKwong49.volume_integral_J()
experimental_calibration_connolly16experimental_calibration_reid87OSi_rk49_connolly16H4Si_rk49_reid87CHN_rk49_reid87H3N_rk49_reid87OSi_rk49_connolly16_boundedget_reid_connolly_eos_models()
- atmodeller.eos._saxena module
SaxenaABCSaxenaABC.a_coefficientsSaxenaABC.b_coefficientsSaxenaABC.c_coefficientsSaxenaABC.d_coefficientsSaxenaABC.critical_dataSaxenaABC._get_compressibility_coefficient()SaxenaABC.critical_pressureSaxenaABC.critical_temperatureSaxenaABC.a()SaxenaABC.b()SaxenaABC.c()SaxenaABC.d()SaxenaABC.scaled_pressure()SaxenaABC.scaled_temperature()SaxenaABC.compressibility_factor()SaxenaABC.log_fugacity()SaxenaABC.volume()SaxenaABC.volume_integral()SaxenaABC._abc_implSaxenaABC.dvdp()SaxenaABC.dzdp()SaxenaABC.fugacity()SaxenaABC.fugacity_coefficient()SaxenaABC.log_activity()SaxenaABC.log_fugacity_coefficient()SaxenaABC.pressure_from_fugacity()SaxenaABC.volume_integral_J()
SaxenaFiveCoefficientsSaxenaFiveCoefficients._get_compressibility_coefficient()SaxenaFiveCoefficients._abc_implSaxenaFiveCoefficients.a()SaxenaFiveCoefficients.b()SaxenaFiveCoefficients.c()SaxenaFiveCoefficients.compressibility_factor()SaxenaFiveCoefficients.critical_dataSaxenaFiveCoefficients.critical_pressureSaxenaFiveCoefficients.critical_temperatureSaxenaFiveCoefficients.d()SaxenaFiveCoefficients.dvdp()SaxenaFiveCoefficients.dzdp()SaxenaFiveCoefficients.fugacity()SaxenaFiveCoefficients.fugacity_coefficient()SaxenaFiveCoefficients.log_activity()SaxenaFiveCoefficients.log_fugacity()SaxenaFiveCoefficients.log_fugacity_coefficient()SaxenaFiveCoefficients.pressure_from_fugacity()SaxenaFiveCoefficients.scaled_pressure()SaxenaFiveCoefficients.scaled_temperature()SaxenaFiveCoefficients.volume()SaxenaFiveCoefficients.volume_integral()SaxenaFiveCoefficients.volume_integral_J()SaxenaFiveCoefficients.a_coefficientsSaxenaFiveCoefficients.b_coefficientsSaxenaFiveCoefficients.c_coefficientsSaxenaFiveCoefficients.d_coefficients
SaxenaEightCoefficientsSaxenaEightCoefficients._get_compressibility_coefficient()SaxenaEightCoefficients._abc_implSaxenaEightCoefficients.a()SaxenaEightCoefficients.b()SaxenaEightCoefficients.c()SaxenaEightCoefficients.compressibility_factor()SaxenaEightCoefficients.critical_dataSaxenaEightCoefficients.critical_pressureSaxenaEightCoefficients.critical_temperatureSaxenaEightCoefficients.d()SaxenaEightCoefficients.dvdp()SaxenaEightCoefficients.dzdp()SaxenaEightCoefficients.fugacity()SaxenaEightCoefficients.fugacity_coefficient()SaxenaEightCoefficients.log_activity()SaxenaEightCoefficients.log_fugacity()SaxenaEightCoefficients.log_fugacity_coefficient()SaxenaEightCoefficients.pressure_from_fugacity()SaxenaEightCoefficients.scaled_pressure()SaxenaEightCoefficients.scaled_temperature()SaxenaEightCoefficients.volume()SaxenaEightCoefficients.volume_integral()SaxenaEightCoefficients.volume_integral_J()SaxenaEightCoefficients.a_coefficientsSaxenaEightCoefficients.b_coefficientsSaxenaEightCoefficients.c_coefficientsSaxenaEightCoefficients.d_coefficients
_H2_low_pressure_SS92_H2_high_pressure_SS92_H2_high_pressure_SS92_refitH2_SS92_H2_high_pressure_SF88SO2_SS92SO2_SS92_bounded_H2S_low_pressure_SS92_H2S_high_pressure_SS92H2S_SS92get_corresponding_states_SS92()CH4_SS92CO_SS92CO2_SS92COS_SS92O2_SS92S2_SS92Ar_SF87H2_SF87N2_SF87get_saxena_eos_models()
- atmodeller.eos._vanderwaals module
VanderWaalsVanderWaals.aVanderWaals.bVanderWaals._objective_function()VanderWaals.volume()VanderWaals.volume_integral()VanderWaals._abc_implVanderWaals.compressibility_factor()VanderWaals.dvdp()VanderWaals.dzdp()VanderWaals.fugacity()VanderWaals.fugacity_coefficient()VanderWaals.log_activity()VanderWaals.log_fugacity()VanderWaals.log_fugacity_coefficient()VanderWaals.pressure_from_fugacity()VanderWaals.volume_integral_J()
H2_lideH2_lide_boundedHe_lideHe_lide_boundedN2_lideN2_lide_boundedH4Si_lideH4Si_lide_boundedH2O_lideH2O_lide_boundedCH4_lideCH4_lide_boundedH3N_lideH3N_lide_boundedCHN_lideCHN_lide_boundedH4Si_ishamH4Si_isham_boundedOSi_ishamOSi_isham_boundedget_vanderwaals_eos_models()
- atmodeller.eos._wang module
VirialQuadraticVirialQuadratic.a_coefficientsVirialQuadratic.b_coefficientsVirialQuadratic.c_coefficientsVirialQuadratic._get_compressibility_coefficient()VirialQuadratic.a()VirialQuadratic.b()VirialQuadratic.c()VirialQuadratic.compressibility_factor()VirialQuadratic.log_fugacity()VirialQuadratic.volume()VirialQuadratic.volume_integral()VirialQuadratic._abc_implVirialQuadratic.dvdp()VirialQuadratic.dzdp()VirialQuadratic.fugacity()VirialQuadratic.fugacity_coefficient()VirialQuadratic.log_activity()VirialQuadratic.log_fugacity_coefficient()VirialQuadratic.pressure_from_fugacity()VirialQuadratic.volume_integral_J()
experimental_calibration_wang18H4Si_wang18_boundedget_wang_eos_models()
- atmodeller.eos._zhang_duan module
ZhangDuanZhangDuan.coefficientsZhangDuan.epsilonZhangDuan.sigmaZhangDuan._Pm()ZhangDuan._Tm()ZhangDuan._Vm()ZhangDuan._get_parameter()ZhangDuan._S1()ZhangDuan._objective_function()ZhangDuan.initial_volume()ZhangDuan.volume()ZhangDuan.log_fugacity()ZhangDuan.volume_integral()ZhangDuan._abc_implZhangDuan.compressibility_factor()ZhangDuan.dvdp()ZhangDuan.dzdp()ZhangDuan.fugacity()ZhangDuan.fugacity_coefficient()ZhangDuan.log_activity()ZhangDuan.log_fugacity_coefficient()ZhangDuan.pressure_from_fugacity()ZhangDuan.volume_integral_J()
CH4_zhang09CH4_experimental_calibrationCH4_zhang09_boundedH2O_zhang09H2O_experimental_calibrationH2O_zhang09_boundedCO2_zhang09CO2_experimental_calibrationH2_zhang09H2_experimental_calibrationH2_zhang09_boundedCO_zhang09CO_experimental_calibrationCO_zhang09_boundedO2_zhang09O2_experimental_calibrationO2_zhang09_boundedC2H6_zhang09C2H6_experimental_calibrationC2H6_zhang09_boundedget_zhang_eos_models()
- atmodeller.eos.core module
RealGasBaseRealGasRealGas.volume()RealGas.volume_integral()RealGas.log_fugacity()RealGas.volume_integral_J()RealGas.dzdp()RealGas.dvdp()RealGas.compressibility_factor()RealGas._abc_implRealGas.fugacity()RealGas.fugacity_coefficient()RealGas.log_activity()RealGas.log_fugacity_coefficient()RealGas.pressure_from_fugacity()
IdealGasIdealGas.volume()IdealGas.volume_integral()IdealGas._abc_implIdealGas.compressibility_factor()IdealGas.dvdp()IdealGas.dzdp()IdealGas.fugacity()IdealGas.fugacity_coefficient()IdealGas.log_activity()IdealGas.log_fugacity()IdealGas.log_fugacity_coefficient()IdealGas.pressure_from_fugacity()IdealGas.volume_integral_J()
RedlichKwongABCRedlichKwongABC.a()RedlichKwongABC.b()RedlichKwongABC.volume_integral()RedlichKwongABC.volume()RedlichKwongABC._abc_implRedlichKwongABC.compressibility_factor()RedlichKwongABC.dvdp()RedlichKwongABC.dzdp()RedlichKwongABC.fugacity()RedlichKwongABC.fugacity_coefficient()RedlichKwongABC.log_activity()RedlichKwongABC.log_fugacity()RedlichKwongABC.log_fugacity_coefficient()RedlichKwongABC.pressure_from_fugacity()RedlichKwongABC.volume_integral_J()
RedlichKwongImplicitABCRedlichKwongImplicitABC.initial_volume()RedlichKwongImplicitABC.A_factor()RedlichKwongImplicitABC.B_factor()RedlichKwongImplicitABC.volume_integral()RedlichKwongImplicitABC.log_fugacity()RedlichKwongImplicitABC._objective_function()RedlichKwongImplicitABC.volume()RedlichKwongImplicitABC._abc_implRedlichKwongImplicitABC.a()RedlichKwongImplicitABC.b()RedlichKwongImplicitABC.compressibility_factor()RedlichKwongImplicitABC.dvdp()RedlichKwongImplicitABC.dzdp()RedlichKwongImplicitABC.fugacity()RedlichKwongImplicitABC.fugacity_coefficient()RedlichKwongImplicitABC.log_activity()RedlichKwongImplicitABC.log_fugacity_coefficient()RedlichKwongImplicitABC.pressure_from_fugacity()RedlichKwongImplicitABC.volume_integral_J()
RedlichKwongImplicitDenseFluidABCRedlichKwongImplicitDenseFluidABC.initial_volume()RedlichKwongImplicitDenseFluidABC.A_factor()RedlichKwongImplicitDenseFluidABC.B_factor()RedlichKwongImplicitDenseFluidABC._abc_implRedlichKwongImplicitDenseFluidABC._objective_function()RedlichKwongImplicitDenseFluidABC.a()RedlichKwongImplicitDenseFluidABC.b()RedlichKwongImplicitDenseFluidABC.compressibility_factor()RedlichKwongImplicitDenseFluidABC.dvdp()RedlichKwongImplicitDenseFluidABC.dzdp()RedlichKwongImplicitDenseFluidABC.fugacity()RedlichKwongImplicitDenseFluidABC.fugacity_coefficient()RedlichKwongImplicitDenseFluidABC.log_activity()RedlichKwongImplicitDenseFluidABC.log_fugacity()RedlichKwongImplicitDenseFluidABC.log_fugacity_coefficient()RedlichKwongImplicitDenseFluidABC.pressure_from_fugacity()RedlichKwongImplicitDenseFluidABC.volume()RedlichKwongImplicitDenseFluidABC.volume_integral()RedlichKwongImplicitDenseFluidABC.volume_integral_J()
RedlichKwongImplicitGasABCRedlichKwongImplicitGasABC.initial_volume()RedlichKwongImplicitGasABC.A_factor()RedlichKwongImplicitGasABC.B_factor()RedlichKwongImplicitGasABC._abc_implRedlichKwongImplicitGasABC._objective_function()RedlichKwongImplicitGasABC.a()RedlichKwongImplicitGasABC.b()RedlichKwongImplicitGasABC.compressibility_factor()RedlichKwongImplicitGasABC.dvdp()RedlichKwongImplicitGasABC.dzdp()RedlichKwongImplicitGasABC.fugacity()RedlichKwongImplicitGasABC.fugacity_coefficient()RedlichKwongImplicitGasABC.log_activity()RedlichKwongImplicitGasABC.log_fugacity()RedlichKwongImplicitGasABC.log_fugacity_coefficient()RedlichKwongImplicitGasABC.pressure_from_fugacity()RedlichKwongImplicitGasABC.volume()RedlichKwongImplicitGasABC.volume_integral()RedlichKwongImplicitGasABC.volume_integral_J()
VirialCompensationVirialCompensation.a_coefficientsVirialCompensation.b_coefficientsVirialCompensation.c_coefficientsVirialCompensation.P0VirialCompensation._a()VirialCompensation._b()VirialCompensation._c()VirialCompensation._delta_pressure()VirialCompensation.volume()VirialCompensation.volume_integral()VirialCompensation._abc_impl
CORKCORK._abc_implCORK.compressibility_factor()CORK.dvdp()CORK.dzdp()CORK.fugacity()CORK.fugacity_coefficient()CORK.log_activity()CORK.log_fugacity()CORK.log_fugacity_coefficient()CORK.pressure_from_fugacity()CORK.volume_integral_J()CORK.mrkCORK.virialCORK.critical_dataCORK.volume()CORK.volume_integral()
- atmodeller.eos.library module
- Module contents
- atmodeller.solubility package
- Submodules
- atmodeller.solubility._carbon_species module
- atmodeller.solubility._hydrogen_species module
- atmodeller.solubility._other_species module
- atmodeller.solubility._sulfur_species module
_S2_sulfate_andesite_boulliung23S2_sulfate_andesite_boulliung23_S2_sulfide_andesite_boulliung23S2_sulfide_andesite_boulliung23_S2_andesite_boulliung23S2_andesite_boulliung23_S2_sulfate_basalt_boulliung23S2_sulfate_basalt_boulliung23_S2_sulfide_basalt_boulliung23S2_sulfide_basalt_boulliung23_S2_basalt_boulliung23S2_basalt_boulliung23_S2_sulfate_trachybasalt_boulliung23S2_sulfate_trachybasalt_boulliung23_S2_sulfide_trachybasalt_boulliung23S2_sulfide_trachybasalt_boulliung23_S2_trachybasalt_boulliung23S2_trachybasalt_boulliung23
- atmodeller.solubility.core module
- atmodeller.solubility.library module
- Module contents
- atmodeller.thermodata package
- Submodules
- atmodeller.thermodata._redox_buffers module
RedoxBufferIronWustiteBufferHirschmann08IronWustiteBufferHirschmann08.calibrationIronWustiteBufferHirschmann08.convert_pressure_units()IronWustiteBufferHirschmann08.log10_fugacity_buffer()IronWustiteBufferHirschmann08._abc_implIronWustiteBufferHirschmann08.active()IronWustiteBufferHirschmann08.get_scaled_pressure()IronWustiteBufferHirschmann08.log10_fugacity()IronWustiteBufferHirschmann08.log_fugacity()IronWustiteBufferHirschmann08.log10_shiftIronWustiteBufferHirschmann08.evaluation_pressure
IronWustiteBufferHirschmann21IronWustiteBufferHirschmann21._abc_implIronWustiteBufferHirschmann21.active()IronWustiteBufferHirschmann21.get_scaled_pressure()IronWustiteBufferHirschmann21.log10_fugacity()IronWustiteBufferHirschmann21.log_fugacity()IronWustiteBufferHirschmann21.calibrationIronWustiteBufferHirschmann21.log10_shiftIronWustiteBufferHirschmann21.evaluation_pressureIronWustiteBufferHirschmann21.aIronWustiteBufferHirschmann21.bIronWustiteBufferHirschmann21.cIronWustiteBufferHirschmann21.dIronWustiteBufferHirschmann21.eIronWustiteBufferHirschmann21.fIronWustiteBufferHirschmann21.gIronWustiteBufferHirschmann21.hIronWustiteBufferHirschmann21.xIronWustiteBufferHirschmann21.convert_pressure_units()IronWustiteBufferHirschmann21._evaluate_m()IronWustiteBufferHirschmann21._evaluate_fO2()IronWustiteBufferHirschmann21._fcc_bcc_iron()IronWustiteBufferHirschmann21._hcp_iron()IronWustiteBufferHirschmann21._use_hcp()IronWustiteBufferHirschmann21.log10_fugacity_buffer()
IronWustiteBufferHirschmannIronWustiteBufferHirschmann._abc_implIronWustiteBufferHirschmann.active()IronWustiteBufferHirschmann.get_scaled_pressure()IronWustiteBufferHirschmann.log10_fugacity()IronWustiteBufferHirschmann.log_fugacity()IronWustiteBufferHirschmann.log10_shiftIronWustiteBufferHirschmann.evaluation_pressureIronWustiteBufferHirschmann.calibrationIronWustiteBufferHirschmann.low_temperature_bufferIronWustiteBufferHirschmann.high_temperature_bufferIronWustiteBufferHirschmann.convert_pressure_units()IronWustiteBufferHirschmann._use_low_temperature()IronWustiteBufferHirschmann.log10_fugacity_buffer()
IronWustiteBuffer
- atmodeller.thermodata.core module
DATA_DIRECTORYTHERMODYNAMIC_DATA_SOURCECRITICAL_DATA_SOURCECondensateActivityThermodynamicCoefficientsThermodynamicCoefficients.b1ThermodynamicCoefficients.b2ThermodynamicCoefficients.cp_coeffsThermodynamicCoefficients.T_minThermodynamicCoefficients.T_maxThermodynamicCoefficients._get_index()ThermodynamicCoefficients._cp_over_R()ThermodynamicCoefficients._S_over_R()ThermodynamicCoefficients._H_over_RT()ThermodynamicCoefficients._G_over_RT()ThermodynamicCoefficients.get_gibbs_over_RT()ThermodynamicCoefficients.cp()ThermodynamicCoefficients.enthalpy()ThermodynamicCoefficients.reference_enthalpy()ThermodynamicCoefficients.enthalpy_function()ThermodynamicCoefficients.entropy()ThermodynamicCoefficients.gibbs_function()ThermodynamicCoefficients._abc_impl
ThermodynamicDataSourceCriticalDataCriticalDataSourcethermodynamic_data_sourcethermodynamic_coefficients_dictionarycritical_data_sourcecritical_data_dictionaryChemicalSpeciesDataChemicalSpeciesData._abc_implChemicalSpeciesData.formulaChemicalSpeciesData.stateChemicalSpeciesData.compositionChemicalSpeciesData.hill_formulaChemicalSpeciesData.molar_massChemicalSpeciesData.thermoChemicalSpeciesData.elementsChemicalSpeciesData.nameChemicalSpeciesData.get_gibbs_over_RT()
- Module contents
Submodules
atmodeller.classes module
Classes
- class atmodeller.classes.EquilibriumModel(species_network: SpeciesNetwork)
Bases:
objectAn equilibrium model
This is the main class that the user interacts with to build equilibrium models, solve them, and retrieve the results.
- Parameters:
species_network – Species network
- _output: Output | None = None
- _selected_solver: Literal['basic', 'robust'] = 'basic'
- property output: Output
- calculate_disequilibrium(*, state: ThermodynamicStateProtocol, log_number_moles: Array | ndarray | bool | number | bool | int | float | complex | TypedNdArray) None
Computes the Gibbs free energy disequilibrium.
This method calculates the Gibbs free energy difference (ΔG) for each considered reaction relative to equilibrium, based on the current state of the system. A value of zero indicates a reaction at equilibrium, while positive or negative values indicate departures from equilibrium in terms of energetic favourability.
- Parameters:
state – Thermodynamic state
log_number_moles – Log number of moles
- solve(*, initial_log_number_moles: Array | ndarray | bool | number | bool | int | float | complex | TypedNdArray | None = None, initial_log_stability: Array | ndarray | bool | number | bool | int | float | complex | TypedNdArray | None = None, state: ThermodynamicStateProtocol | None = None, fugacity_constraints: Mapping[str, FugacityConstraintProtocol] | None = None, mass_constraints: Mapping[str, Array | ndarray | bool | number | bool | int | float | complex | TypedNdArray] | None = None, solver_parameters: SolverParameters | None = None, solver: Literal['basic', 'robust'] = 'robust', solver_recompile: bool = False) None
Runs the nonlinear solver and initialises the output state.
This method executes the compiled equilibrium solver produced by
set_solver()and stores the resulting solution for downstream processing. It optionally accepts updated planetary/environmental constraints and initial guesses for the nonlinear system. After successful convergence, an internalOutputinstance is created to expose number densities, activities, stabilities, and post-processed diagnostic quantities.If
set_solver()has not been called, a suitable solver will be constructed and JIT-compiled automatically. Repeated calls tosolve()with compatible shapes will be fast and will reuse cached compilation artifacts.- Parameters:
initial_log_number_moles – Initial log number of moles. Defaults to
None.initial_log_stability – Initial log stability. Defaults to
None.state – Thermodynamic state. Defaults to
None.fugacity_constraints – Fugacity constraints. Defaults to
None.mass_constraints – Mass constraints. Defaults to
None.solver_parameters – Solver parameters. Defaults to
None.solver – Build a
basic(faster compile time) or arobust(slower compile time) solver. Defaults torobust.solver_recompile – Force recompilation of the solver. Defaults to
False.
- atmodeller.classes._broadcast_component(component: Array | ndarray | bool | number | bool | int | float | complex | TypedNdArray | None, default_value: float, dim: int, batch_size: int, name: str) ndarray[tuple[Any, ...], dtype[float64]]
Broadcasts a scalar, 1D, or 2D input array to shape
(batch_size, dim).- This function standardizes inputs that may be:
None(in which casedefault_valueis used),a scalar (promoted to a 1D array of length
dim),a 1D array of shape
(dim,)(broadcast across the batch),or a 2D array of shape
(batch_size, dim)`` (used as-is).
- Parameters:
component – The input data (or
None), representing either a scalar, 1D array, or 2D arraydefault_value – The default scalar value to use if
componentisNonedim – The number of features or dimensions per batch item
batch_size – The number of batch items
name – Name of the component (used for error messages)
- Returns:
A numpy array of shape
(batch_size, dim), with values broadcast as needed- Raises:
ValueError – If the input array has an unexpected shape or inconsistent dimensions
- atmodeller.classes.broadcast_initial_solution(initial_log_number_moles: Array | ndarray | bool | number | bool | int | float | complex | TypedNdArray | None, initial_log_stability: Array | ndarray | bool | number | bool | int | float | complex | TypedNdArray | None, number_of_species: int, batch_size: int) Float[Array, 'batch_size solution']
Creates and broadcasts the initial solution to shape
(batch_size, solution)D = number_of_species + number_of_stability, i.e. the total number of solution quantities- Parameters:
initial_log_number_moles – Initial log number moles or
Noneinitial_log_stability – Initial log stability or
Nonenumber_of_species – Number of species
batch_size – Batch size
- Returns:
Initial solution with shape
(batch_size, solution)
atmodeller.constants module
Physical and numerical constants
This module defines reference thermodynamic conditions and numerical limits.
- atmodeller.constants.TEMPERATURE_REFERENCE: float = 298.15
Enthalpy reference temperature in K (\(T_r\) in the JANAF tables) [Chase, 1998, McBride et al., 2002]
- atmodeller.constants.STANDARD_PRESSURE: float = 1.0
Standard state pressure in bar
- atmodeller.constants.STANDARD_FUGACITY: float = 1.0
Standard fugacity for gases in bar
- atmodeller.constants.GAS_STATE: str = 'g'
Suffix to identify gases as per JANAF convention for the state of aggregation
- atmodeller.constants.CONDENSED_STATE: str = 'cd'
Suffix to identify condensed phases as per JANAF convention for the state of aggregation
- atmodeller.constants.INITIAL_LOG_NUMBER_MOLES: float = 50.0
Initial log number of moles
Empiricially determined. This value is mid-range for Earth-like planets.
- atmodeller.constants.INITIAL_LOG_STABILITY: float = -30.0
Initial log stability
Empirically determined
- atmodeller.constants.LOG_NUMBER_MOLES_LOWER: float = -200.0
Lower log number of moles for a species
- atmodeller.constants.LOG_NUMBER_MOLES_UPPER: float = 80.0
Upper log number of moles for a species
- atmodeller.constants.LOG_STABILITY_LOWER: float = -700.0
Lower stability for a species
Derived to ensure that the exponential function exp(x) does not underflow to zero
- atmodeller.constants.LOG_STABILITY_UPPER: float = 35.0
Upper stability for a species
Empirically determined.
- atmodeller.constants.TAU_MAX: float = 0.001
Maximum tau scaling factor for species stability when using the tau cascade solver
- atmodeller.constants.TAU: float = 1e-25
Desired (i.e. final/minimium) tau scaling factor for species stability [Leal et al., 2016].
Tau effectively controls the minimum non-zero number of moles of unstable species. Formally, it defines the number of moles of an unstable pure condensate with an activity of
1/e, which corresponds to a log stability of zero.
- atmodeller.constants.TAU_NUM: int = 2
Number of tau values to solve between
TAU_MAXandTAU(inclusive) for the tau cascade solverEmpirically determined. Basically, once a solution has been found for
TAU_MAXthe solver can immediately proceed toTAU. This usually solves within a few steps on the first attempt.
atmodeller.containers module
Containers
- class atmodeller.containers.ChemicalSpecies(data: ChemicalSpeciesData, activity: ActivityProtocol, solubility: SolubilityProtocol, solve_for_stability: bool, number_solution: int)
Bases:
ModuleChemical species
- Parameters:
data – Chemical species data
activity – Activity
solubility – Solubility
solve_for_stability – Solve for stability
number_solution – Number of solution quantities
- data: ChemicalSpeciesData
- activity: ActivityProtocol
- solubility: SolubilityProtocol
- solve_for_stability: bool
- number_solution: int
- property name: str
Unique name by combining Hill notation and state
- classmethod create_condensed(formula: str, *, state: str = 'cd', activity: ActivityProtocol = CondensateActivity(activity=f64[]), solve_for_stability: bool = True) ChemicalSpecies
Creates a condensate
- Parameters:
formula – Formula
state – State of aggregation as defined by JANAF. Defaults to
CONDENSED_STATEactivity – Activity. Defaults to unity activity.
True. (solve_for_stability. Solve for stability. Defaults to)
- Returns:
A condensed species
- classmethod create_gas(formula: str, *, state: str = 'g', activity: ActivityProtocol = IdealGas(), solubility: SolubilityProtocol = NoSolubility(), solve_for_stability: bool = False) ChemicalSpecies
Creates a gas species
- Parameters:
formula – Formula
state – State of aggregation as defined by JANAF. Defaults to
GAS_STATEactivity – Activity. Defaults to an ideal gas.
solubility – Solubility. Defaults to no solubility.
False. (solve_for_stability. Solve for stability. Defaults to)
- Returns:
A gas species
- _abc_impl = <_abc._abc_data object>
- class atmodeller.containers.SpeciesNetwork(data: Iterable[ChemicalSpecies])
Bases:
ModuleA network of species
- Parameters:
species – An iterable of chemical species
- data: tuple[ChemicalSpecies, ...]
Chemical species data
- number_solution: int
Number of solution quantities that cannot depend on traced quantities
- species_names: tuple[str, ...]
Unique names of all species
- gas_species_names: tuple[str, ...]
Gas species names
- condensed_species_names: tuple[str, ...]
Condensed species names
- unique_elements: tuple[str, ...]
Unique elements in species in alphabetical order
- element_molar_masses: ndarray[tuple[Any, ...], dtype[float64]]
Molar masses of the ordered elements
- diatomic_oxygen_index: ndarray[tuple[Any, ...], dtype[float64]]
Index of diatomic oxygen or np.nan if not present
- number_reactions: int
Number of reactions
- classmethod create(species_names: Iterable[str]) SpeciesNetwork
Creates an instance
- Parameters:
species_names – A list or tuple of species names
- Returns
An instance
- classmethod available_species() tuple[str, ...]
- property gas_only: bool
Checks if a gas-only network
- property number_species: int
Number of species
- get_diatomic_oxygen_index() ndarray[tuple[Any, ...], dtype[float64]]
Gets the species index corresponding to diatomic oxygen.
Note
This returns a float array for type consistency.
- Returns:
Index of diatomic oxygen, or np.nan if diatomic oxygen is not in the species
- get_formula_matrix() ndarray[tuple[Any, ...], dtype[int64]]
Gets the formula matrix.
Elements are given in rows and species in columns following the convention in Leal et al. [2017].
- Returns:
Formula matrix
- get_reaction_dictionary() dict[int, str]
Gets reactions as a dictionary.
- Returns:
Reactions as a dictionary
- get_reaction_matrix() ndarray[tuple[Any, ...], dtype[float64]]
Gets the reaction matrix.
- Returns:
A matrix of linearly independent reactions or an empty array if no reactions
- get_temperature_range() tuple[float, float]
Gets the temperature range of the thermodynamic data for the species
- Returns:
Minimum and maximum temperature that is valid for the species
- _abc_impl = <_abc._abc_data object>
- class atmodeller.containers.ThermodynamicState(temperature: Array | ndarray | bool | number | bool | int | float | complex | TypedNdArray, pressure: Array | ndarray | bool | number | bool | int | float | complex | TypedNdArray, mass: Array | ndarray | bool | number | bool | int | float | complex | TypedNdArray = 1, melt_fraction: Array | ndarray | bool | number | bool | int | float | complex | TypedNdArray = 1)
Bases:
ModuleA generic thermodynamic state
This must adhere to ThermodynamicStateProtocol.
Note
All parameters are stored as JAX arrays (
jnp.ndarray) rather than Python floats. This ensures that JAX sees a consistent type during transformations (e.g.,jit,grad,vmap), preventing unnecessary recompilation when values change. In JAX, switching between a Python float and an array for the same argument will trigger retracing or recompilation, so keeping everything as arrays avoids this overhead.- Parameters:
temperature – Temperature in K
pressure – Pressure in bar
mass – Mass in kg. Defaults to
1kg.melt_fraction – Melt fraction by weight in kg/kg. Defaults to
1kg/kg.
- get_pressure(gas_mass: Array) Array
Gets the pressure.
- Parameters:
gas_mass – Gas mass in kg. Unused but required by the interface.
- Returns:
Pressure in bar
- asdict() dict[str, ndarray[tuple[Any, ...], dtype[_ScalarT]]]
Gets a dictionary of the values as NumPy arrays.
- Returns:
A dictionary of the values
- _abc_impl = <_abc._abc_data object>
- class atmodeller.containers.ThinAtmospherePlanet(planet_mass: Array | ndarray | bool | number | bool | int | float | complex | TypedNdArray = 5.972e+24, core_mass_fraction: Array | ndarray | bool | number | bool | int | float | complex | TypedNdArray = 0.295334691460966, mantle_melt_fraction: Array | ndarray | bool | number | bool | int | float | complex | TypedNdArray = 1.0, surface_radius: Array | ndarray | bool | number | bool | int | float | complex | TypedNdArray = 6371000, temperature: Array | ndarray | bool | number | bool | int | float | complex | TypedNdArray = 2000, pressure: Array | ndarray | bool | number | bool | int | float | complex | TypedNdArray = nan)
Bases:
ModuleA planet with a thin atmosphere.
This must adhere to ThermodynamicStateProtocol.
Default values are for a fully molten Earth.
Note
All parameters are stored as JAX arrays (
jnp.ndarray) rather than Python floats. This ensures that JAX sees a consistent type during transformations (e.g.,jit,grad,vmap), preventing unnecessary recompilation when values change. In JAX, switching between a Python float and an array for the same argument will trigger retracing or recompilation, so keeping everything as arrays avoids this overhead.- Parameters:
planet_mass – Mass of the planet in kg. Defaults to
5.972e24kg (Earth).core_mass_fraction – Mass fraction of the iron core relative to the planetary mass. Defaults to
0.3kg/kg (Earth).mantle_melt_fraction – Mass fraction of the mantle that is molten. Defaults to
1.0kg/kg.surface_radius – Radius of the planetary surface in m. Defaults to
6371000m (Earth).temperature – Temperature in K. Defaults to
2000K.pressure – Pressure in bar. Defaults to
np.nanto solve for the mechanical pressure balance at the surface.
- _abc_impl = <_abc._abc_data object>
- get_pressure(gas_mass: Array) Array
Gets the pressure.
A pressure is used if specified, otherwise the default behaviour is to compute the pressure from the mechanical pressure balance at the planetary surface assuming the thin atmosphere approximation. That is, the surface gravity is computed from the mass of the planet alone and is assumed to act on all the mass of the atmosphere.
- Parameters:
gas_mass – Gas mass in kg
- Returns:
Pressure in bar
- atmodeller.containers.Planet
alias of
ThinAtmospherePlanet
- class atmodeller.containers.FixedFugacityConstraint(fugacity: Array | ndarray | bool | number | bool | int | float | complex | TypedNdArray | tuple = nan)
Bases:
ModuleA fixed fugacity constraint
This must adhere to FugacityConstraintProtocol
- Parameters:
fugacity – Fugacity in bar. Defaults to
np.nan.
- _abc_impl = <_abc._abc_data object>
- active() Bool[Array, '...']
Active fugacity constraint
- Returns:
Trueif the fugacity constraint is active, otherwiseFalse
- class atmodeller.containers.FugacityConstraintSet(constraints: tuple[FugacityConstraintProtocol, ...], species_network: SpeciesNetwork)
Bases:
ModuleA set of fugacity constraints
These are applied as constraints on the gas activity.
- Parameters:
constraints – Fugacity constraints
species – Species network
- _abc_impl = <_abc._abc_data object>
- constraints: tuple[FugacityConstraintProtocol, ...]
Fugacity constraints
- species_network: SpeciesNetwork
Species network
- classmethod create(species_network: SpeciesNetwork, fugacity_constraints: Mapping[str, FugacityConstraintProtocol] | None = None) FugacityConstraintSet
Creates an instance
- Parameters:
species_network – Species network
fugacity_constraints – Mapping of a species name and a fugacity constraint. Defaults to
None.
- Returns:
An instance
- active() Bool[Array, '...']
Active fugacity constraints
- Returns:
Mask indicating whether fugacity constraints are active or not
- asdict(temperature: Array | ndarray | bool | number | bool | int | float | complex | TypedNdArray, pressure: Array | ndarray | bool | number | bool | int | float | complex | TypedNdArray) dict[str, ndarray[tuple[Any, ...], dtype[_ScalarT]]]
Gets a dictionary of the evaluated fugacity constraints as NumPy Arrays
- Parameters:
temperature – Temperature in K
pressure – Pressure in bar
- Returns:
A dictionary of the evaluated fugacity constraints
- log_fugacity(temperature: Array | ndarray | bool | number | bool | int | float | complex | TypedNdArray, pressure: Array | ndarray | bool | number | bool | int | float | complex | TypedNdArray) Array
Log fugacity
- Parameters:
temperature – Temperature in K
pressure – Pressure in bar
- Returns:
Log fugacity in bar
- class atmodeller.containers.MassConstraintSet(abundance: Array | ndarray | bool | number | bool | int | float | complex | TypedNdArray | tuple, species_network: SpeciesNetwork, units: Literal['mass', 'moles'] = 'mass', oxygen_column_index: int | None = None)
Bases:
ModuleA set of mass constraints
Note
abundancemust be stored as a 2-D array so that the vmapping operation only batches over the leading dimension if it has a size greater than unity. Then, the methods that processabundanceconsistently return 1-D arrays, shape (elements,), to avoid triggering JAX recompilation.- Parameters:
abundance – Abundance
species – Species
units – Units of the abundance. Defaults to
mass.
- _abc_impl = <_abc._abc_data object>
- abundance: Float[Array, '...']
Abundance
- species_network: SpeciesNetwork
Species network
- units: Literal['mass', 'moles'] = 'mass'
Units of the abundance
- oxygen_column_index: int | None = None
Column index of oxygen in
abundance. Defaults toNone.
- classmethod create(species_network: SpeciesNetwork, mass_constraints: Mapping[str, Array | ndarray | bool | number | bool | int | float | complex | TypedNdArray] | None = None, units: Literal['mass', 'moles'] = 'mass') MassConstraintSet
Creates an instance
- Parameters:
species_network – Species network
mass_constraints – Mapping of element name and mass constraint in
units. Defaults toNone.units – Units of the abundance. Defaults to
mass.
- Returns:
An instance
- abundance_mol() Float[Array, '...']
Abundance by moles for all elements
- Returns:
Abundance by moles for all elements
- abundance_mass() Float[Array, '...']
Abundance by mass for all elements
- Returns:
Abundance by mass for all elements
- log_abundance() Float[Array, '...']
Element abundances in log-space
abundanceis stored as a 2-D array with shape (batch, elements) so thatvmaponly maps over the leading dimension when batching is active. When called inside avmap, each mapped instance receives a single row of the abundance matrix, i.e. an array of shape (elements,). When called outsidevmap,abundancehas shape (1, elements) and must be reduced to a consistent 1-D vector.If the batch dimension is greater than one and the method is called outside a vmapped workflow, the full 2-D log-abundance array is returned unchanged. This preserves the natural behaviour for genuinely batched data while still collapsing the leading singleton dimension in unbatched use.
- Returns:
Log abundance by moles for all elements
- asdict() dict[str, ndarray[tuple[Any, ...], dtype[_ScalarT]]]
Gets a dictionary of the values as NumPy arrays
- Returns:
A dictionary of the values
- active() Bool[Array, '...']
Active mass constraints
- Returns:
Mask indicating whether elemental mass constraints are active or not
- class atmodeller.containers.SolverParameters(solver: type[AbstractRootFinder | AbstractLeastSquaresSolver | AbstractMinimiser] = <class 'optimistix._solver.newton_chord.Newton'>, atol: float = 1e-06, rtol: float = 1e-06, linear_solver: AbstractLinearSolver = AutoLinearSolver(well_posed=None), norm: Callable = <function max_norm>, throw: bool = False, max_steps: int = 256, jac: Literal['fwd', 'bwd']='fwd', multistart: int = 10, multistart_perturbation: float = 30.0, tau: Array | ndarray | bool | number | bool | int | float | complex | TypedNdArray | tuple = 1e-25)
Bases:
RootFindParametersSolver parameters
- Parameters:
solver – Solver. Defaults to
optimistix.Newton.atol – Absolute tolerance. Defaults to
1.0e-6.rtol – Relative tolerance. Defaults to
1.0e-6.linear_solver – Linear solver. Defaults to
AutoLinearSolver(well_posed=False).norm – Norm. Defaults to
optimistix.max_norm().throw – How to report any failures. Defaults to
False.max_steps – The maximum number of steps the solver can take. Defaults to
256.jac – Whether to use forward- or reverse-mode autodifferentiation to compute the Jacobian. Can be either
fwdorbwd. Defaults tofwd.multistart – Number of multistarts. Defaults to
10.multistart_perturbation – Perturbation for multistart. Defaults to
30.tau – Tau factor for species stability. Defaults to
TAU.
- _abc_impl = <_abc._abc_data object>
- atol: float = 1e-06
Absolute tolerance
- get_solver_instance() AbstractRootFinder | AbstractLeastSquaresSolver | AbstractMinimiser
Instantiates the solver
- jac: Literal['fwd', 'bwd'] = 'fwd'
Whether to use forward- or reverse-mode autodifferentiation to compute the Jacobian
- linear_solver: AbstractLinearSolver = AutoLinearSolver(well_posed=None)
//docs.kidger.site/lineax/api/solvers/)
- Type:
Linear solver (see https
- max_steps: int = 256
Maximum number of steps the solver can take
- norm() Shaped[Array, '']
Compute the L-infinity norm of a PyTree of arrays.
This is the largest absolute elementwise value. Considering the input x as a flat vector (x_1, …, x_n), then this computes max_i |x_i|.
- rtol: float = 1e-06
Relative tolerance
- solver
alias of
Newton
- throw: bool = False
How to report any failures
- multistart: int = 10
Number of multistarts
- multistart_perturbation: float = 30.0
Perturbation for multistart
- get_options(number_species: int) dict[str, Any]
Gets the solver options.
- Parameters:
number_species – Number of species
- Returns:
Solver options
- _get_lower_bound(number_species: int) Float[Array, 'dim']
Gets the lower bound for truncating the solution during the solve.
- Parameters:
number_species – Number of species
- Returns:
Lower bound for truncating the solution during the solve
- _get_upper_bound(number_species: int) Float[Array, 'dim']
Gets the upper bound for truncating the solution during the solve.
- Parameters:
number_species – Number of species
- Returns:
Upper bound for truncating the solution during the solve
- _get_hypercube_bound(number_species: int, log_number_moles_bound: float, stability_bound: float) Float[Array, 'dim']
Gets the bound on the hypercube.
- Parameters:
number_species – Number of species
log_number_moles_bound – Bound on the log number of moles
stability_bound – Bound on the stability
- Returns:
Bound on the hypercube that contains the root
- class atmodeller.containers.Parameters
Bases:
Module- Parameters:
species – Species network
state – Thermodynamic state
fugacity_constraints – Fugacity constraints
mass_constraints – Mass constraints
solver_parameters – Solver parameters
batch_size – Batch size. Defaults to
1.
- _abc_impl = <_abc._abc_data object>
- species_network: SpeciesNetwork
Species
- state: ThermodynamicStateProtocol
Thermodynamic state
- fugacity_constraints: FugacityConstraintSet
Fugacity constraints
- mass_constraints: MassConstraintSet
Mass constraints
- solver_parameters: SolverParameters
Solver parameters
- batch_size: int = 1
Batch size
- classmethod create(species_network: SpeciesNetwork, state: ThermodynamicStateProtocol | None = None, fugacity_constraints: Mapping[str, FugacityConstraintProtocol] | None = None, mass_constraints: Mapping[str, Array | ndarray | bool | number | bool | int | float | complex | TypedNdArray] | None = None, solver_parameters: SolverParameters | None = None)
Creates an instance
- Parameters:
species_network – Species network
state – Thermodynamic state. Defaults to a new instance of
Planet.fugacity_constraints – Mapping of a species name and a fugacity constraint. Defaults to a new instance of
FugacityConstraints.mass_constraints – Mapping of element name and mass constraint in kg. Defaults to a new instance of
MassConstraints.solver_parameters – Solver parameters. Defaults to a new instance of
SolverParameters.
- Returns:
An instance
atmodeller.engine module
JAX-based model functions for atmospheric and chemical equilibrium calculations.
This module defines the core set of single-instance model functions (e.g., thermodynamic property calculations, equation-of-state relations, reaction masks) that operate on a single set of inputs, without any implicit batching.
These functions form the building blocks for solving the coupled system of equations governing the model (e.g., mass balance, fugacity constraints, phase stability), and are intended to be:
Pure: No side effects, deterministic outputs for given inputs.
JAX-compatible: Written with
jax.numpyand compatible with transformations such asjit,grad, andvmap.Shape-consistent: Accept and return arrays with predictable shapes, enabling easy vectorisation.
In practice, these functions are rarely called directly in production code. Instead, they are
wrapped with equinox.filter_vmap() to enable efficient batched evaluation over multiple
scenarios or parameter sets.
- atmodeller.engine.get_active_mask(parameters: Parameters) Bool[Array, 'dim']
Gets the mask of active residual quantities.
- Parameters:
parameters – Parameters
- Returns:
Active mask
- atmodeller.engine.get_atmosphere_log_molar_mass(parameters: Parameters, log_number_moles: Float[Array, 'species']) Float[Array, '']
Gets the log molar mass of the atmosphere.
- Parameters:
parameters – Parameters
log_number_moles – Log number of moles
- Returns:
Log molar mass of the atmosphere
- atmodeller.engine.get_element_moles(parameters: Parameters, log_number_moles: Float[Array, 'species']) Float[Array, 'elements']
Gets the number of moles of elements in the gas or condensed phase.
Input values are sanitised only for output routines, where partitioning between condensed and gas species is required. For the solver itself, this distinction is unnecessary.
- Parameters:
parameters – Parameters
log_number_moles – Log number of moles
- Returns:
Number of moles of elements in the gas or condensed phase
- atmodeller.engine.get_element_moles_in_melt(parameters: Parameters, log_number_moles: Float[Array, 'species']) Float[Array, 'species']
Gets the number of moles of elements dissolved in melt.
- Parameters:
parameters – Parameters
log_number_moles – Log number of moles
- Returns:
Number of moles of elements dissolved in melt
- atmodeller.engine.get_gas_species_data(parameters: Parameters, some_array: Array | ndarray | bool | number | bool | int | float | complex | TypedNdArray) Shaped[Array, 'species']
Masks the gas species data from an array.
- Parameters:
parameters – Parameters
some_array – Some array to mask the gas species data from
- Returns:
An array with gas species data from some_array and condensate entries zeroed
- atmodeller.engine.get_log_mole_fraction_in_gas(parameters: Parameters, log_number_moles: Float[Array, 'species']) Float[Array, 'species']
Gets the log mole fraction of the species in the gas phase
- Parameters:
parameters – Parameters
log_number_moles – Log number of moles
- Returns:
Log mole fraction in the gas
- atmodeller.engine.get_log_activity(parameters: Parameters, log_number_moles: Float[Array, 'species']) Float[Array, 'species']
Gets the log activity.
- Parameters:
parameters – Parameters
log_number_moles – Log number of moles
- Returns:
Log activity
- atmodeller.engine.get_log_activity_pure_species(parameters: Parameters, log_number_moles: Float[Array, 'species']) Float[Array, 'species']
Gets the log activity of pure species.
- Parameters:
parameters – Parameters
log_number_moles – Log number of moles
- Returns:
Log activity of pure species
- atmodeller.engine.get_log_Kp(parameters: Parameters) Float[Array, 'reactions']
Gets log of the equilibrium constant of each reaction in terms of partial pressures.
- Parameters:
parameters – Parameters
- Returns:
Log of the equilibrium constant of each reaction in terms of partial pressures
- atmodeller.engine.get_min_log_elemental_abundance_per_species(parameters: Parameters) Float[Array, 'species']
For each species, find the elemental mass constraint with the lowest abundance.
- Parameters:
parameters – Parameters
- Returns:
A vector of the minimum log elemental abundance for each species
- atmodeller.engine.get_reactions_only_mask(parameters: Parameters) Bool[Array, 'dim']
Returns a mask with True only for active reactions positions, False elsewhere.
- Parameters:
parameters – Parameters
- Returns:
Reactions only mask for the residual array
- atmodeller.engine.get_species_moles_in_melt(parameters: Parameters, log_number_moles: Float[Array, 'species']) Float[Array, 'species']
Gets the number of moles of species dissolved in melt due to species solubility.
- Parameters:
parameters – Parameters
log_number_moles – Log number of moles
- Returns:
Number of moles of species dissolved in melt
- atmodeller.engine.get_species_ppmw_in_melt(parameters: Parameters, log_number_moles: Float[Array, 'species']) Float[Array, 'species']
Gets the ppmw of species dissolved in melt.
- Parameters:
parameters – Parameters
log_number_moles – Log number of moles
- Returns:
ppmw of species dissolved in melt
- atmodeller.engine.get_gas_mass(parameters: Parameters, log_number_moles: Float[Array, 'species']) Float[Array, '']
Gets the gas mass.
- Parameters:
parameters – Parameters
log_number_moles – Log number of moles
- Returns:
Gas mass
- atmodeller.engine.get_total_pressure(parameters: Parameters, log_number_moles: Float[Array, 'species']) Float[Array, '']
Gets the total pressure.
- Parameters:
parameters – Parameters
log_number_moles – Log number of moles
- Returns:
Total pressure in bar
- atmodeller.engine.objective_function(solution: Float[Array, 'solution'], parameters: Parameters) Float[Array, 'residual']
Objective function
The order of the residual does make a difference to the solution process. More investigations are necessary, but justification for the current ordering is as follows:
Fugacity constraints - fixed target, well conditioned
Reaction constraints - log-linear, physics-based coupling
Mass balance constraints - stiffer, depends on solubility
Stability constraints - stiffer still
- Parameters:
solution – Solution array for all species i.e. log number of moles and log stability
parameters – Parameters
- Returns:
Residual
atmodeller.engine_vmap module
Vmapped wrappers for core engine functions.
This module provides a high-level container (VmappedFunctions) that precompiles
vectorised versions of key thermodynamic and mass-balance functions. By wrapping each function with
equinox.filter_vmap(), the module ensures efficient batched evaluation of model properties.
Currently, these wrappers are used primarily as a convenience for generating and inspecting
outputs. They are not responsible for performing the actual equilibrium solution, which is instead
handled by the solvers module.
- class atmodeller.engine_vmap.VmappedFunctions(parameters: Parameters)
Bases:
objectContainer for precompiled
vmap-ped model functions.This class wraps a set of model functions (e.g., thermodynamic property calculations, reaction masks, etc.) with
equinox.filter_vmap()so they can be evaluated efficiently over batched inputs.The primary assumption is that
log_number_molesinputs are already batched along axis 0. Thein_axesspecifications for allvmapcalls are precomputed at initialisation from the providedparametersobject, ensuring consistent vectorisation behavior across all functions.Each wrapped function is stored as a bound method and internally calls a preconstructed
vmapobject. This minimizes tracing overhead and avoids recomputingin_axesspecs for each call.- Parameters:
parameters – Parameters
- parameters: Parameters
atmodeller.interfaces module
Interfaces for thermodynamic models and constraints.
This module defines formal protocol classes (via typing.Protocol) that specify the
expected interfaces for different thermodynamic components.
- class atmodeller.interfaces.ActivityProtocol(*args, **kwargs)
Bases:
Protocol- log_activity(temperature: Array | ndarray | bool | number | bool | int | float | complex | TypedNdArray, pressure: Array | ndarray | bool | number | bool | int | float | complex | TypedNdArray) Array | ndarray | bool | number | bool | int | float | complex | TypedNdArray
- log_fugacity(temperature: Array | ndarray | bool | number | bool | int | float | complex | TypedNdArray, pressure: Array | ndarray | bool | number | bool | int | float | complex | TypedNdArray) Array | ndarray | bool | number | bool | int | float | complex | TypedNdArray
- _abc_impl = <_abc._abc_data object>
- _is_protocol = True
- _is_runtime_protocol = True
- class atmodeller.interfaces.FugacityConstraintProtocol(*args, **kwargs)
Bases:
Protocol- active() Bool[Array, '...']
- log_fugacity(temperature: Array | ndarray | bool | number | bool | int | float | complex | TypedNdArray, pressure: Array | ndarray | bool | number | bool | int | float | complex | TypedNdArray) Array | ndarray | bool | number | bool | int | float | complex | TypedNdArray
- _abc_impl = <_abc._abc_data object>
- _is_protocol = True
- _is_runtime_protocol = True
- class atmodeller.interfaces.RedoxBufferProtocol(*args, **kwargs)
Bases:
FugacityConstraintProtocol,Protocol- evaluation_pressure: float | None
- log10_fugacity_buffer(temperature: Array | ndarray | bool | number | bool | int | float | complex | TypedNdArray, pressure: Array | ndarray | bool | number | bool | int | float | complex | TypedNdArray) Array
- log10_fugacity(temperature: Array | ndarray | bool | number | bool | int | float | complex | TypedNdArray, pressure: Array | ndarray | bool | number | bool | int | float | complex | TypedNdArray) Array
- _abc_impl = <_abc._abc_data object>
- _is_protocol = True
- _is_runtime_protocol = True
- active() Bool[Array, '...']
- class atmodeller.interfaces.SolubilityProtocol(*args, **kwargs)
Bases:
ProtocolSolubility protocol
jax_concentration()is defined in order to allow arguments to be passed by position to lax.switch.- concentration(fugacity: Array | ndarray | bool | number | bool | int | float | complex | TypedNdArray, *, temperature: Array | ndarray | bool | number | bool | int | float | complex | TypedNdArray | None = None, pressure: Array | ndarray | bool | number | bool | int | float | complex | TypedNdArray | None = None, fO2: Array | ndarray | bool | number | bool | int | float | complex | TypedNdArray | None = None) Array
- jax_concentration(fugacity: Array | ndarray | bool | number | bool | int | float | complex | TypedNdArray, temperature: Array | ndarray | bool | number | bool | int | float | complex | TypedNdArray, pressure: Array | ndarray | bool | number | bool | int | float | complex | TypedNdArray, fO2: Array | ndarray | bool | number | bool | int | float | complex | TypedNdArray) Array
- _abc_impl = <_abc._abc_data object>
- _is_protocol = True
- _is_runtime_protocol = True
atmodeller.output module
Output
- class atmodeller.output.OutputDisequilibrium(parameters: Parameters, solution: Float[Array, 'batch solution'])
Bases:
OutputOutput disequilibrium calculations
- Parameters:
parameters – Parameters
solution – Solution
- asdict() dict[str, dict[str, ndarray[tuple[Any, ...], dtype[_ScalarT]]]]
All outputs in a dictionary, with caching.
Additionally includes the disequilibrium group, compared to the base class.
- Returns:
Dictionary of all output
- disequilibrium_asdict() dict[str, ndarray[tuple[Any, ...], dtype[_ScalarT]]]
Gets the reaction disequilibrium as a dictionary.
- Returns:
Reaction disequilibrium as a dictionary
- _get_number_moles_output(number_moles: ndarray[tuple[Any, ...], dtype[_ScalarT]], molar_mass_expanded: ndarray[tuple[Any, ...], dtype[_ScalarT]], prefix: str = '') dict[str, ndarray[tuple[Any, ...], dtype[_ScalarT]]]
Gets the outputs associated with a given number of moles.
- Parameters:
number_moles – Number of moles. Shape must be 2-D.
molar_mass_expanded – Molar mass associated with the number of moles. Shape must be 2-D.
prefix – Key prefix for the output. Defaults to an empty string.
- Returns
Dictionary of output quantities
- activity() ndarray[tuple[Any, ...], dtype[float64]]
Gets the activity of all species.
- Returns:
Activity of all species
- activity_without_stability() ndarray[tuple[Any, ...], dtype[float64]]
Gets the activity without stability of all species.
- Returns:
Activity without stability of all species
- condensed_species_asdict(molar_mass: ndarray[tuple[Any, ...], dtype[_ScalarT]], number_moles: ndarray[tuple[Any, ...], dtype[_ScalarT]], activity: ndarray[tuple[Any, ...], dtype[_ScalarT]]) dict[str, dict[str, ndarray[tuple[Any, ...], dtype[_ScalarT]]]]
Gets the condensed species output as a dictionary.
- Parameters:
molar_mass – Molar mass of all species
number_moles – Number of moles of all species
activity – Activity of all species
- Returns:
Condensed species output as a dictionary
- element_molar_mass_expanded() ndarray[tuple[Any, ...], dtype[float64]]
Gets molar mass of elements.
- Returns:
Molar mass of elements
- element_moles_condensed() ndarray[tuple[Any, ...], dtype[float64]]
Gets the number of moles of elements in the condensed phase.
- Returns:
Number of moles of elements in the condensed phase
- element_moles_dissolved() ndarray[tuple[Any, ...], dtype[float64]]
Gets the number of moles of elements dissolved in melt due to species solubility.
- Returns:
Number of moles of elements dissolved in melt due to species solubility
- element_moles_gas() ndarray[tuple[Any, ...], dtype[float64]]
Gets the number of moles of elements in the gas phase.
- Returns:
Number of moles of elements in the gas phase
- elements_asdict() dict[str, dict[str, ndarray[tuple[Any, ...], dtype[_ScalarT]]]]
Gets the element properties as a dictionary.
- Returns:
Element outputs as a dictionary
- gas_asdict() dict[str, ndarray[tuple[Any, ...], dtype[_ScalarT]]]
Gets the gas properties.
- Returns:
Gas properties
- gas_log_molar_mass() ndarray[tuple[Any, ...], dtype[float64]]
Gets log molar mass of the gas.
- Returns:
Log molar mass of the gas
- gas_molar_mass() ndarray[tuple[Any, ...], dtype[_ScalarT]]
Gets the molar mass of the gas.
- Returns:
Molar mass of the gas
- gas_species_asdict(molar_mass: ndarray[tuple[Any, ...], dtype[_ScalarT]], number_moles: ndarray[tuple[Any, ...], dtype[_ScalarT]], activity: ndarray[tuple[Any, ...], dtype[_ScalarT]]) dict[str, dict[str, ndarray[tuple[Any, ...], dtype[_ScalarT]]]]
Gets the gas species output as a dictionary.
- Parameters:
molar_mass – Molar mass of all species
number_moles – Number of moles of all species
activity – Activity of all species
- Returns:
Gas species output as a dictionary
- ideal_gas_volume() ndarray[tuple[Any, ...], dtype[float64]]
Gets the volume of the gas assuming it is ideal.
- Returns:
Volume of the gas
- log_activity() ndarray[tuple[Any, ...], dtype[float64]]
Gets log activity of all species.
This is usually what the user wants when referring to activity because it includes a consideration of species stability
- Returns:
Log activity of all species
- log_activity_without_stability() ndarray[tuple[Any, ...], dtype[float64]]
Gets log activity without stability of all species.
- Returns:
Log activity without stability
- property number_solutions: int
Number of solutions
- pressure() ndarray[tuple[Any, ...], dtype[float64]]
Gets pressure of species in bar.
This will compute pressure of all species, including condensates, for simplicity.
- Returns:
Pressure of species in bar
- quick_look() dict[str, Array | ndarray | bool | number | bool | int | float | complex | TypedNdArray]
Quick look at the solution
Provides a quick first glance at the output with convenient units and to ease comparison with test or benchmark data.
- Returns:
Dictionary of the solution
- raw_solution_asdict() dict[str, ndarray[tuple[Any, ...], dtype[_ScalarT]]]
Gets the raw solution.
- Returns:
Dictionary of the raw solution
- reaction_mask() ndarray[tuple[Any, ...], dtype[bool]]
Gets the reaction mask of the residual array.
- Returns:
Reaction mask of the residual array
- residual_asdict() dict[int, ndarray[tuple[Any, ...], dtype[float64]]]
Gets the residual.
- Returns:
Dictionary of the residual
- property species: SpeciesNetwork
Species
- species_molar_mass_expanded() ndarray[tuple[Any, ...], dtype[float64]]
Gets molar mass of all species in an expanded array.
- Returns:
Molar mass of all species in an expanded array.
- species_number_moles_in_melt() ndarray[tuple[Any, ...], dtype[float64]]
Gets species number of moles in the melt.
- Returns:
Species number of moles in the melt
- species_ppmw_in_melt() ndarray[tuple[Any, ...], dtype[float64]]
Gets species ppmw in the melt.
- Returns:
Species ppmw in the melt
- stability() ndarray[tuple[Any, ...], dtype[float64]]
Gets stability of relevant species.
- Returns:
Stability of relevant species
- property state: ThermodynamicStateProtocol
Thermodynamic state
- to_dataframes() dict[str, DataFrame]
Gets the output in a dictionary of dataframes.
- Returns:
Output in a dictionary of dataframes
- to_excel(file_prefix: Path | str = 'atmodeller_out') None
Writes the output to an Excel file.
- Parameters:
file_prefix – Prefix of the output file. Defaults to atmodeller_out.
- to_pickle(file_prefix: Path | str = 'atmodeller_out') None
Writes the output to a pickle file.
- Parameters:
file_prefix – Prefix of the output file. Defaults to atmodeller_out.
- class atmodeller.output.OutputSolution(parameters: Parameters, solution: Float[Array, 'batch solution'], multi_attempt_solution: MultiAttemptSolution)
Bases:
OutputOutput equilibrium solution(s)
- Parameters:
parameters – Parameters
solution – Solution
multi_attempt_solution –
MultiAttemptSolutionobject
- asdict() dict[str, dict[str, ndarray[tuple[Any, ...], dtype[_ScalarT]]]]
All outputs in a dictionary, with caching.
- Returns:
Dictionary of all output
- to_dataframes(drop_unsuccessful: bool = False) dict[str, DataFrame]
Gets the output in a dictionary of dataframes.
- Parameters:
drop_unsuccessful – Drop models that did not solve. Defaults to
False.- Returns:
Output in a dictionary of dataframes
- to_excel(file_prefix: Path | str = 'atmodeller_out', drop_unsuccessful: bool = False) None
Writes the output to an Excel file.
Compared to the base class, this highlights rows where the solver failed to find a a solution if
drop_successful = False.- Parameters:
file_prefix – Prefix of the output file. Defaults to
atmodeller_out.drop_unsuccessful – Drop models that did not solve. Defaults to
False.
- to_pickle(file_prefix: Path | str = 'atmodeller_out', drop_unsuccessful: bool = False) None
Writes the output to a pickle file.
- Parameters:
file_prefix – Prefix of the output file. Defaults to
atmodeller_out.drop_unsuccessful – Drop models that did not solve. Defaults to
False.
- _drop_unsuccessful_solves(dataframes: dict[str, DataFrame]) dict[str, DataFrame]
Drops unsuccessful solves.
- Parameters:
dataframes – Dataframes from which to drop unsuccessful models
- Returns:
Dictionary of dataframes without unsuccessful models
- _get_number_moles_output(number_moles: ndarray[tuple[Any, ...], dtype[_ScalarT]], molar_mass_expanded: ndarray[tuple[Any, ...], dtype[_ScalarT]], prefix: str = '') dict[str, ndarray[tuple[Any, ...], dtype[_ScalarT]]]
Gets the outputs associated with a given number of moles.
- Parameters:
number_moles – Number of moles. Shape must be 2-D.
molar_mass_expanded – Molar mass associated with the number of moles. Shape must be 2-D.
prefix – Key prefix for the output. Defaults to an empty string.
- Returns
Dictionary of output quantities
- activity() ndarray[tuple[Any, ...], dtype[float64]]
Gets the activity of all species.
- Returns:
Activity of all species
- activity_without_stability() ndarray[tuple[Any, ...], dtype[float64]]
Gets the activity without stability of all species.
- Returns:
Activity without stability of all species
- condensed_species_asdict(molar_mass: ndarray[tuple[Any, ...], dtype[_ScalarT]], number_moles: ndarray[tuple[Any, ...], dtype[_ScalarT]], activity: ndarray[tuple[Any, ...], dtype[_ScalarT]]) dict[str, dict[str, ndarray[tuple[Any, ...], dtype[_ScalarT]]]]
Gets the condensed species output as a dictionary.
- Parameters:
molar_mass – Molar mass of all species
number_moles – Number of moles of all species
activity – Activity of all species
- Returns:
Condensed species output as a dictionary
- element_molar_mass_expanded() ndarray[tuple[Any, ...], dtype[float64]]
Gets molar mass of elements.
- Returns:
Molar mass of elements
- element_moles_condensed() ndarray[tuple[Any, ...], dtype[float64]]
Gets the number of moles of elements in the condensed phase.
- Returns:
Number of moles of elements in the condensed phase
- element_moles_dissolved() ndarray[tuple[Any, ...], dtype[float64]]
Gets the number of moles of elements dissolved in melt due to species solubility.
- Returns:
Number of moles of elements dissolved in melt due to species solubility
- element_moles_gas() ndarray[tuple[Any, ...], dtype[float64]]
Gets the number of moles of elements in the gas phase.
- Returns:
Number of moles of elements in the gas phase
- elements_asdict() dict[str, dict[str, ndarray[tuple[Any, ...], dtype[_ScalarT]]]]
Gets the element properties as a dictionary.
- Returns:
Element outputs as a dictionary
- gas_asdict() dict[str, ndarray[tuple[Any, ...], dtype[_ScalarT]]]
Gets the gas properties.
- Returns:
Gas properties
- gas_log_molar_mass() ndarray[tuple[Any, ...], dtype[float64]]
Gets log molar mass of the gas.
- Returns:
Log molar mass of the gas
- gas_molar_mass() ndarray[tuple[Any, ...], dtype[_ScalarT]]
Gets the molar mass of the gas.
- Returns:
Molar mass of the gas
- gas_species_asdict(molar_mass: ndarray[tuple[Any, ...], dtype[_ScalarT]], number_moles: ndarray[tuple[Any, ...], dtype[_ScalarT]], activity: ndarray[tuple[Any, ...], dtype[_ScalarT]]) dict[str, dict[str, ndarray[tuple[Any, ...], dtype[_ScalarT]]]]
Gets the gas species output as a dictionary.
- Parameters:
molar_mass – Molar mass of all species
number_moles – Number of moles of all species
activity – Activity of all species
- Returns:
Gas species output as a dictionary
- ideal_gas_volume() ndarray[tuple[Any, ...], dtype[float64]]
Gets the volume of the gas assuming it is ideal.
- Returns:
Volume of the gas
- log_activity() ndarray[tuple[Any, ...], dtype[float64]]
Gets log activity of all species.
This is usually what the user wants when referring to activity because it includes a consideration of species stability
- Returns:
Log activity of all species
- log_activity_without_stability() ndarray[tuple[Any, ...], dtype[float64]]
Gets log activity without stability of all species.
- Returns:
Log activity without stability
- property number_solutions: int
Number of solutions
- pressure() ndarray[tuple[Any, ...], dtype[float64]]
Gets pressure of species in bar.
This will compute pressure of all species, including condensates, for simplicity.
- Returns:
Pressure of species in bar
- quick_look() dict[str, Array | ndarray | bool | number | bool | int | float | complex | TypedNdArray]
Quick look at the solution
Provides a quick first glance at the output with convenient units and to ease comparison with test or benchmark data.
- Returns:
Dictionary of the solution
- raw_solution_asdict() dict[str, ndarray[tuple[Any, ...], dtype[_ScalarT]]]
Gets the raw solution.
- Returns:
Dictionary of the raw solution
- reaction_mask() ndarray[tuple[Any, ...], dtype[bool]]
Gets the reaction mask of the residual array.
- Returns:
Reaction mask of the residual array
- residual_asdict() dict[int, ndarray[tuple[Any, ...], dtype[float64]]]
Gets the residual.
- Returns:
Dictionary of the residual
- property species: SpeciesNetwork
Species
- species_molar_mass_expanded() ndarray[tuple[Any, ...], dtype[float64]]
Gets molar mass of all species in an expanded array.
- Returns:
Molar mass of all species in an expanded array.
- species_number_moles_in_melt() ndarray[tuple[Any, ...], dtype[float64]]
Gets species number of moles in the melt.
- Returns:
Species number of moles in the melt
- species_ppmw_in_melt() ndarray[tuple[Any, ...], dtype[float64]]
Gets species ppmw in the melt.
- Returns:
Species ppmw in the melt
- stability() ndarray[tuple[Any, ...], dtype[float64]]
Gets stability of relevant species.
- Returns:
Stability of relevant species
- property state: ThermodynamicStateProtocol
Thermodynamic state
atmodeller.solvers module
Non-linear solvers for chemical equilibrium and parameterised systems
This module provides JAX-compatible solver utilities for efficiently handling both single-system and batched systems of non-linear equations. The solvers are designed to integrate seamlessly with JAX transformations and support Equinox-based pytrees for flexible parameter handling.
- atmodeller.solvers.make_objective_function_vmapped(parameters: Parameters) Callable
Gets a vmapped, JIT-compiled objective function.
- Parameters:
parameters – Parameters
- Returns:
Callable
- atmodeller.solvers.solve_single_system(initial_guess: Float[Array, '...'], parameters: Parameters, objective_function: Callable) Solution
Solves a single system.
- Parameters:
initial_guess – Initial guess for the solution
parameters – Parameters
objective_function – Callable returning the residual
- Returns:
Solutionobject
- atmodeller.solvers.make_independent_solver(parameters: Parameters) Callable
Gets a vmapped, JIT-compiled solver for independent batch systems.
Wraps
solve_single_system()withequinox.filter_vmap()andequinox.filter_jit()so that it can solve multiple independent systems in a batch efficiently. Each batch element is solved separately, producing per-element convergence statistics.- Parameters:
parameters – Parameters
- Returns:
Callable that returns a
MultiAttemptSolutionobject
- atmodeller.solvers.make_batch_solver(parameters: Parameters) Callable
Gets a JIT-compiled solver for batched systems treated as a single problem.
- Parameters:
parameters – Parameters
- Returns:
Callable that returns a
MultiAttemptSolutionobject
- atmodeller.solvers.make_tau_sweep_solver(solver_function: Callable, objective_function: Callable) Callable
Makes a tau sweep solver.
solver_functionandobjective_functionmust support batch evaluations.- Parameters:
solver_function – Callable for the solver function
objective_function – Callable for the objective function
- Returns:
Callable
- atmodeller.solvers.make_solver(parameters: Parameters) Callable
Solver function with JIT compilation. Handles multistart stability and generic solvers.
- Parameters:
parameters – Parameters
- Returns:
Solver
atmodeller.type_aliases module
Common type aliases
This module centralizes type definitions for NumPy arrays, scalar values, and Optimistix solvers. Having a single place for these aliases improves readability and consistency across the codebase, whilst also simplifying type checking and documentation.
atmodeller.utilities module
General utilities
This module is designed to have minimal dependencies on the core Atmodeller package, as its functionality is broadly applicable across different parts of the codebase. Keeping this module lightweight also helps avoid circular imports.
- class atmodeller.utilities.ExperimentalCalibration(temperature_min: int | float | None = None, temperature_max: int | float | None = None, pressure_min: int | float | None = None, pressure_max: int | float | None = None, log10_fO2_min: int | float | None = None, log10_fO2_max: int | float | None = None)
Bases:
ModuleExperimental calibration
- Parameters:
temperature_min – Minimum calibrated temperature. Defaults to
None.temperature_max – Maximum calibrated temperature. Defaults to
None.pressure_min – Minimum calibrated pressure. Defaults to
None.pressure_max – Maximum calibrated pressure. Defaults to
None.log10_fO2_min – Minimum calibrated \(\log_{10} f\rm{O}_2\). Defaults to
None.log10_fO2_max – Maximum calibrated \(\log_{10} f\rm{O}_2\). Defaults to
None.
- _abc_impl = <_abc._abc_data object>
- temperature_min: float | None = None
Minimum calibrated temperature
- temperature_max: float | None = None
Maximum calibrated temperature
- pressure_min: float | None = None
Minimum calibrated pressure
- pressure_max: float | None = None
Maximum calibrated pressure
- log10_fO2_min: float | None = None
Minimum calibrated \(\log_{10} f\rm{O}_2\)
- log10_fO2_max: float | None = None
Maximum calibrated \(\log_{10} f\rm{O}_2\)
- atmodeller.utilities.bulk_silicate_earth_abundances() dict[str, dict[str, float]]
Bulk silicate Earth element masses in kg
Hydrogen, carbon, and nitrogen from Sakuraba et al. [2021], sulfur from Hirschmann [2016], and chlorine from Kendrick et al. [2017]
- Returns:
A dictionary of Earth BSE element masses in kg
- atmodeller.utilities.earth_oceans_to_hydrogen_mass(number_of_earth_oceans: Array | ndarray | bool | number | bool | int | float | complex | TypedNdArray = 1) Array | ndarray | bool | number | bool | int | float | complex | TypedNdArray
Converts Earth oceans to hydrogen mass.
- Parameters:
number_of_earth_oceans – Number of Earth oceans. Defaults to
1kg.- Returns:
Hydrogen mass in kg
Module contents
Package level variables and initialises the package logger
- atmodeller.complex_formatter() Formatter
Complex formatter
- atmodeller.simple_formatter() Formatter
Simple formatter for logging
- Returns:
Formatter for logging
- atmodeller.debug_logger() Logger
Sets up debug logging to the console.
- Returns:
A logger
- atmodeller.debug_file_logger() Logger
Sets up info logging to the console and debug logging to a file.
- Returns:
A logger