Cantera

This page documents the wrapper written around the C-API of Cantera. The status of development is documented here. Its goal is not to mimic the original API or provide an interface equivalent to the Python package, but something in line with the functioning of the parent toolbox.

Status of Cantera wrapper

This is an experimental interface to Cantera library based on its C-API version 3.0. This interface is at its early days and has developped for Julia >= 1.9.0 under Windows 10/11. When it is stable enough it will be published as a package and tested under other platforms.

API of ct.h

Documentation here.

StatusHeaderFunctionModule
Testedct.hct_appdeleteinlined
Structct.hsoln_newSolutionwrapped
ct.hsoln_newInterfacewaitlist
Testedct.hsoln_delinlined
Testedct.hsoln_nameinlined
Structct.hsoln_thermoinlined
Structct.hsoln_kineticsinlined
Structct.hsoln_transportinlined
Testedct.hsoln_setTransportModelwrapped
Testedct.hsoln_nAdjacentinlined
ct.hsoln_adjacentwaitlist
Testedct.hthermo_newFromFilewrapped
Testedct.hthermo_delinlined
Structct.hthermo_nElementsinlined
Structct.hthermo_nSpeciesinlined
Testedct.hthermo_temperatureinlined
Structct.hthermo_setTemperatureinlined
Testedct.hthermo_densityinlined
Testedct.hthermo_setDensityinlined
Testedct.hthermo_molarDensityinlined
Testedct.hthermo_setMolarDensityinlined
Testedct.hthermo_meanMolecularWeightinlined
Testedct.hthermo_moleFractioninlined
Testedct.hthermo_massFractioninlined
Structct.hthermo_getMoleFractionsinlined
Testedct.hthermo_getMassFractionsinlined
Structct.hthermo_setMoleFractionsinlined
Testedct.hthermo_setMassFractionsinlined
ct.hthermo_setMoleFractionsByName
ct.hthermo_setMassFractionsByName
ct.hthermo_getAtomicWeights
ct.hthermo_getMolecularWeights
ct.hthermo_getCharges
ct.hthermo_getElementName
ct.hthermo_getSpeciesName
ct.hthermo_getName
ct.hthermo_setName
ct.hthermo_elementIndex
ct.hthermo_speciesIndex
ct.hthermo_report
Testedct.hthermo_print
ct.hthermo_nAtoms
ct.hthermo_addElement
ct.hthermo_getEosType
To testct.hthermo_refPressureinlined
To testct.hthermo_minTempinlined
To testct.hthermo_maxTempinlined
To testct.hthermoenthalpymoleinlined
To testct.hthermointEnergymoleinlined
To testct.hthermoentropymoleinlined
To testct.hthermogibbsmoleinlined
To testct.hthermocpmoleinlined
To testct.hthermocvmoleinlined
To testct.hthermo_pressureinlined
Structct.hthermo_setPressureinlined
To testct.hthermoenthalpymassinlined
To testct.hthermointEnergymassinlined
To testct.hthermoentropymassinlined
To testct.hthermogibbsmassinlined
To testct.hthermocpmassinlined
To testct.hthermocvmassinlined
To testct.hthermo_electricPotentialinlined
To testct.hthermo_thermalExpansionCoeffinlined
To testct.hthermo_isothermalCompressibilityinlined
ct.hthermo_chemPotentials
ct.hthermogetEnthalpiesRT
ct.hthermogetEntropiesR
ct.hthermogetCpR
ct.hthermo_setElectricPotential
ct.hthermosetTP
ct.hthermosetTD
ct.hthermosetRP
ct.hthermosetDP
ct.hthermosetHP
ct.hthermosetUV
ct.hthermosetSV
ct.hthermosetSP
ct.hthermosetST
ct.hthermosetTV
ct.hthermosetPV
ct.hthermosetUP
ct.hthermosetVH
ct.hthermosetTH
ct.hthermosetSH
Testedct.hthermo_equilibrate
To testct.hthermo_critTemperatureinlined
To testct.hthermo_critPressureinlined
To testct.hthermo_critDensityinlined
To testct.hthermo_vaporFractioninlined
ct.hthermo_satTemperature
ct.hthermo_satPressure
ct.hthermosetStatePsat
ct.hthermosetStateTsat
ct.hkin_newFromFile
To testct.hkin_delinlined
To testct.hkin_nSpeciesinlined
To testct.hkin_nReactionsinlined
To testct.hkin_nPhasesinlined
ct.hkin_phaseIndex
To testct.hkin_reactionPhaseIndexinlined
ct.hkin_reactantStoichCoeff
ct.hkin_productStoichCoeff
ct.hkin_getReactionType
ct.hkin_getFwdRatesOfProgress
ct.hkin_getRevRatesOfProgress
ct.hkin_getNetRatesOfProgress
ct.hkin_getEquilibriumConstants
ct.hkin_getFwdRateConstants
ct.hkin_getRevRateConstants
ct.hkin_getDelta
ct.hkin_getCreationRates
ct.hkin_getDestructionRates
ct.hkin_getNetProductionRates
ct.hkin_getSourceTerms
To testct.hkin_multiplierinlined
ct.hkin_getReactionString
ct.hkin_setMultiplier
To testct.hkin_isReversibleinlined
ct.hkin_getType
To testct.hkin_startinlined
ct.hkin_speciesIndex
To testct.hkin_advanceCoveragesinlined
To testct.hkin_phaseinlined
To testct.htrans_newDefaultinlined
ct.htrans_new
To testct.htrans_delinlined
To testct.htrans_transportModelinlined
To testct.htrans_viscosityinlined
To testct.htrans_electricalConductivityinlined
ct.htrans_thermalConductivity
ct.htrans_getThermalDiffCoeffs
ct.htrans_getMixDiffCoeffs
ct.htrans_getBinDiffCoeffs
ct.htrans_getMultiDiffCoeffs
ct.htrans_setParameters
ct.htrans_getMolarFluxes
ct.htrans_getMassFluxes
ct.hct_getCanteraError
ct.hct_setLogWriter
ct.hct_setLogCallback
ct.hct_addCanteraDirectory
ct.hct_getDataDirectories
ct.hct_getCanteraVersion
ct.hct_getGitCommit
Testedct.hctsuppressthermo_warningsinlined
Testedct.hctuselegacyrateconstantsinlined
Testedct.hct_clearStorageinlined
Testedct.hct_resetStorageinlined

API of ctfunc.h

Documentation here.

StatusHeaderFunctionModule
ctfunc.hfunc_new
ctfunc.hfuncnewbasic
ctfunc.hfuncnewadvanced
ctfunc.hfuncnewcompound
ctfunc.hfuncnewmodified
To testctfunc.hfunc_delinlined
ctfunc.hfunc_type
To testctfunc.hfunc_valueinlined
To testctfunc.hfunc_derivativeinlined
To testctfunc.hfunc_duplicateinlined
ctfunc.hfunc_write
To testctfunc.hct_clearFuncinlined

API of ctmultiphase.h

Documentation here.

StatusHeaderFunctionModule
To testctmultiphase.hmix_newinlined
To testctmultiphase.hmix_delinlined
To testctmultiphase.hct_clearMixinlined
ctmultiphase.hmix_addPhase
To testctmultiphase.hmix_initinlined
To testctmultiphase.hmix_updatePhasesinlined
To testctmultiphase.hmix_nElementsinlined
ctmultiphase.hmix_elementIndex
ctmultiphase.hmix_speciesIndex
To testctmultiphase.hmix_nSpeciesinlined
To testctmultiphase.hmix_setTemperatureinlined
To testctmultiphase.hmix_temperatureinlined
To testctmultiphase.hmix_minTempinlined
To testctmultiphase.hmix_maxTempinlined
To testctmultiphase.hmix_chargeinlined
To testctmultiphase.hmix_phaseChargeinlined
To testctmultiphase.hmix_setPressureinlined
To testctmultiphase.hmix_pressureinlined
To testctmultiphase.hmix_nAtomsinlined
To testctmultiphase.hmix_nPhasesinlined
To testctmultiphase.hmix_phaseMolesinlined
ctmultiphase.hmix_setPhaseMoles
ctmultiphase.hmix_setMoles
ctmultiphase.hmix_setMolesByName
To testctmultiphase.hmix_speciesMolesinlined
To testctmultiphase.hmix_elementMolesinlined
ctmultiphase.hmix_equilibrate
ctmultiphase.hmix_getChemPotentials
To testctmultiphase.hmix_enthalpyinlined
To testctmultiphase.hmix_entropyinlined
To testctmultiphase.hmix_gibbsinlined
To testctmultiphase.hmix_cpinlined
To testctmultiphase.hmix_volumeinlined
To testctmultiphase.hmix_speciesPhaseIndexinlined
To testctmultiphase.hmix_moleFractioninlined

API of ctonedim.h

Documentation here.

StatusHeaderFunctionModule
To testctonedim.hct_clearOneDiminlined
ctonedim.hdomain_new
To testctonedim.hdomain_delinlined
To testctonedim.hdomain_typeinlined
ctonedim.hdomain_type3
To testctonedim.hdomain_indexinlined
To testctonedim.hdomain_nComponentsinlined
To testctonedim.hdomain_nPointsinlined
ctonedim.hdomain_componentName
ctonedim.hdomain_componentIndex
ctonedim.hdomain_setBounds
To testctonedim.hdomain_lowerBoundinlined
To testctonedim.hdomain_upperBoundinlined
ctonedim.hdomain_setSteadyTolerances
ctonedim.hdomain_setTransientTolerances
To testctonedim.hdomain_rtolinlined
To testctonedim.hdomain_atolinlined
ctonedim.hdomain_setupGrid
ctonedim.hdomain_setID
To testctonedim.hdomain_gridinlined
To testctonedim.hbdry_setMdotinlined
To testctonedim.hbdry_setTemperatureinlined
To testctonedim.hbdry_setSpreadRateinlined
ctonedim.hbdry_setMoleFractions
To testctonedim.hbdry_temperatureinlined
To testctonedim.hbdry_spreadRateinlined
To testctonedim.hbdry_massFractioninlined
To testctonedim.hbdry_mdotinlined
To testctonedim.hreactingsurf_setkineticsmgrinlined
To testctonedim.hreactingsurf_enableCoverageEqsinlined
To testctonedim.hinlet_newinlined
To testctonedim.houtlet_newinlined
To testctonedim.houtletres_newinlined
To testctonedim.hsymm_newinlined
To testctonedim.hsurf_newinlined
To testctonedim.hreactingsurf_newinlined
To testctonedim.hinlet_setSpreadRateinlined
ctonedim.hstflow_new
To testctonedim.hstflow_setTransportinlined
To testctonedim.hstflow_enableSoretinlined
To testctonedim.hstflow_setPressureinlined
To testctonedim.hstflow_pressureinlined
ctonedim.hstflow_setFixedTempProfile
To testctonedim.hstflow_solveEnergyEqninlined
ctonedim.hsim1D_new
To testctonedim.hsim1D_delinlined
ctonedim.hsim1D_setValue
ctonedim.hsim1D_setProfile
ctonedim.hsim1D_setFlatProfile
ctonedim.hsim1D_show
ctonedim.hsim1D_showSolution
ctonedim.hsim1D_setTimeStep
To testctonedim.hsim1D_getInitialSolninlined
ctonedim.hsim1D_solve
To testctonedim.hsim1D_refineinlined
ctonedim.hsim1D_setRefineCriteria
ctonedim.hsim1D_setGridMin
ctonedim.hsim1D_save
ctonedim.hsim1D_restore
To testctonedim.hsim1D_writeStatsinlined
ctonedim.hsim1D_domainIndex
ctonedim.hsim1D_value
ctonedim.hsim1D_workValue
To testctonedim.hsim1D_evalinlined
To testctonedim.hsim1D_setMaxJacAgeinlined
To testctonedim.hsim1D_setFixedTemperatureinlined

API of ctreactor.h

Documentation here.

StatusHeaderFunctionModule
ctreactor.hreactor_new
To testctreactor.hreactor_delinlined
To testctreactor.hreactor_setInitialVolumeinlined
To testctreactor.hreactor_setChemistryinlined
To testctreactor.hreactor_setEnergyinlined
To testctreactor.hreactor_setThermoMgrinlined
To testctreactor.hreactor_setKineticsMgrinlined
To testctreactor.hreactor_insertinlined
To testctreactor.hreactor_massinlined
To testctreactor.hreactor_volumeinlined
To testctreactor.hreactor_densityinlined
To testctreactor.hreactor_temperatureinlined
To testctreactor.hreactorenthalpymassinlined
To testctreactor.hreactorintEnergymassinlined
To testctreactor.hreactor_pressureinlined
To testctreactor.hreactor_massFractioninlined
To testctreactor.hreactor_nSensParamsinlined
To testctreactor.hreactor_addSensitivityReactioninlined
To testctreactor.hflowReactor_setMassFlowRateinlined
To testctreactor.hreactornet_newinlined
To testctreactor.hreactornet_delinlined
To testctreactor.hreactornet_setInitialTimeinlined
To testctreactor.hreactornet_setMaxTimeStepinlined
To testctreactor.hreactornet_setTolerancesinlined
To testctreactor.hreactornet_setSensitivityTolerancesinlined
To testctreactor.hreactornet_addreactorinlined
To testctreactor.hreactornet_advanceinlined
To testctreactor.hreactornet_stepinlined
To testctreactor.hreactornet_timeinlined
To testctreactor.hreactornet_rtolinlined
To testctreactor.hreactornet_atolinlined
ctreactor.hreactornet_sensitivity
ctreactor.hflowdev_new
To testctreactor.hflowdev_delinlined
To testctreactor.hflowdev_installinlined
To testctreactor.hflowdev_setMasterinlined
To testctreactor.hflowdev_setPrimaryinlined
To testctreactor.hflowdev_massFlowRateinlined
To testctreactor.hflowdev_setMassFlowCoeffinlined
To testctreactor.hflowdev_setValveCoeffinlined
To testctreactor.hflowdev_setPressureCoeffinlined
To testctreactor.hflowdev_setPressureFunctioninlined
To testctreactor.hflowdev_setTimeFunctioninlined
ctreactor.hwall_new
To testctreactor.hwall_delinlined
To testctreactor.hwall_installinlined
To testctreactor.hwall_vdotinlined
To testctreactor.hwall_expansionRateinlined
To testctreactor.hwall_Qinlined
To testctreactor.hwall_heatRateinlined
To testctreactor.hwall_areainlined
To testctreactor.hwall_setAreainlined
To testctreactor.hwall_setThermalResistanceinlined
To testctreactor.hwall_setHeatTransferCoeffinlined
To testctreactor.hwall_setHeatFluxinlined
To testctreactor.hwall_setExpansionRateCoeffinlined
To testctreactor.hwall_setVelocityinlined
To testctreactor.hwall_setEmissivityinlined
To testctreactor.hwall_readyinlined
To testctreactor.hreactorsurface_newinlined
To testctreactor.hreactorsurface_delinlined
To testctreactor.hreactorsurface_installinlined
To testctreactor.hreactorsurface_setkineticsinlined
To testctreactor.hreactorsurface_areainlined
To testctreactor.hreactorsurface_setAreainlined
To testctreactor.hreactorsurface_addSensitivityReactioninlined
To testctreactor.hct_clearReactorsinlined

API of ctrpath.h

Documentation here.

StatusHeaderFunctionModule
To testctrpath.hrdiag_newinlined
To testctrpath.hrdiag_delinlined
To testctrpath.hrdiag_detailedinlined
To testctrpath.hrdiag_briefinlined
To testctrpath.hrdiag_setThresholdinlined
ctrpath.hrdiag_setBoldColor
ctrpath.hrdiag_setNormalColor
ctrpath.hrdiag_setDashedColor
ctrpath.hrdiag_setDotOptions
To testctrpath.hrdiag_setBoldThresholdinlined
To testctrpath.hrdiag_setNormalThresholdinlined
To testctrpath.hrdiag_setLabelThresholdinlined
To testctrpath.hrdiag_setScaleinlined
To testctrpath.hrdiag_setFlowTypeinlined
To testctrpath.hrdiag_setArrowWidthinlined
ctrpath.hrdiag_setTitle
ctrpath.hrdiag_write
To testctrpath.hrdiag_addinlined
ctrpath.hrdiag_findMajor
ctrpath.hrdiag_setFont
To testctrpath.hrdiag_displayOnlyinlined
To testctrpath.hrbuild_newinlined
To testctrpath.hrbuild_delinlined
ctrpath.hrbuild_init
ctrpath.hrbuild_build
To testctrpath.hct_clearReactionPathinlined

API of ctsurf.h

Documentation here.

StatusHeaderFunctionModule
ctsurf.hsurf_setCoverages
ctsurf.hsurf_getCoverages
ctsurf.hsurf_setConcentrations
ctsurf.hsurf_getConcentrations
To testctsurf.hsurf_setSiteDensityinlined
To testctsurf.hsurf_siteDensityinlined
ctsurf.hsurf_setCoveragesByName

Cantera samples