Internal parameters¶
This section provides an overview of all the internal
FastChem
parameters that can be adjusted via the aforementionedvoid FastChem.setParameter(std::string param_name,
param_type param_value)
method of the C++ object class or with its Python equivalent
pyfastchem.setParameter(str param_name,
param_type param_value)
More detailed explanations of what these parameters do can be found in Stock et al. (2018), Stock, Kitzmann & Patzer (2022), and Kitzmann, Stock & Patzer (2024)
When using the setParameter method in Python, the C++double types listed below should be replaced by Python float values, while unsigned int should be passed as int. Python bool values (True/False) are correctly dispatched to the bool overload without requiring explicit conversion.
Standard parameters¶
accuracyChemRelative accuracy requirement for chemistry iteration and internal solvers (except Newton’s method).
Type:
doubleDefault value: 1e-5
accuracyElementConservationRelative accuracy for checking the element conservation.
Type:
doubleDefault value: 1e-4
accuracyNewtonRelative accuracy requirement for Newton’s method.
Type:
doubleDefault value: 1e-5
accuracyCondRelative accuracy requirement for condensation calculations.
Type:
doubleDefault value: 1e-5
nbIterationsChemCondMaximum number of combined gas phase chemistry and condensate calculations.
Type:
unsigned intDefault value: 3000
nbIterationsChemMaximum number of chemistry iterations.
Type:
unsigned intDefault value: 3000
nbIterationsCondMaximum number of condensate calculation iterations.
Type:
unsigned intDefault value: 3000
nbSwitchToNewtonNumber of iterations above which the gas phase calculations switch to a multi-dimensional Newton’s method.
Type:
unsigned intDefault value: 400
nbIterationsNewtonMaximum number of iterations for Newton’s method.
Type:
unsigned intDefault value: 3000
nbIterationsBisectionMaximum number of iterations for the bisection method.
Type:
unsigned intDefault value: 3000
nbIterationsNelderMeadMaximum number of iterations for the Nelder-Mead method.
Type:
unsigned intDefault value: 3000
Advanced parameters¶
The following parameters can be considered potentially dangerous and
should only be adjusted by users who know exactly what these
parameters actually do and which side effects they may have.
minDensityExponentElementExponent for the minimum number density of elements.
Type:
doubleDefault value: -155
minDensityExponentMoleculesExponent for the minimum number density of molecules and ions.
Type:
doubleDefault value: -155
condTauBaseline \(\tau\) value for condensates.
Type:
doubleDefault value: 1e-15
condIterChangeLimitMaximum change of condensate densities per iteration step in log10 space.
Type:
doubleDefault value: 5
condReduceSystemSizeReduce the size of the condensate system of equations by removing unstable condensates.
Type:
boolDefault value:
truecondUseSVDSolve the condensate system of equations using a singular value decomposition (SVD) when the Jacobian is singular.
Type:
boolDefault value:
falseuseCondDataValidityLimitUse data temperature limits from the condensate input file and avoid extrapolation outside the validity range of the fitted data. Outside the validity range, the activity of condensates is automatically set to a very small value.
Type:
boolDefault value:
truecondUseLMUse a Levenberg–Marquardt regularisation for the condensate Newton solver. When the Jacobian is singular or near-singular (e.g. fully depleted trace elements after rainout), the solver switches from a plain LU decomposition to the LM normal equations to obtain a well-defined step.
Type:
boolDefault value:
truenbSwitchToJointMaximum number of combined gas phase / condensate outer-loop iterations before the solver switches to a joint gas+condensate Newton step. The joint step is also activated adaptively when stagnation or divergence is detected. Setting this to a large value effectively disables the fixed trigger.
Type:
unsigned intDefault value: 3000
condTraceDensityThresholdThreshold for the maximum possible number density of a condensate (in cm-3). Condensates whose maximum possible number density (computed from element abundances and stoichiometry) falls below this value are excluded from the condensate Newton solver and their number density is set to zero. This avoids Jacobian ill-conditioning caused by trace elements that have been nearly completely rained out.
Type:
doubleDefault value: 1e-100