by jasper » 25 July 2021, 10:14
Normally the route to an entire property package is that you have to create a (COM, or COBIA) based object that implements ICapeThermoMaterialContext, ICapeThermoPhases, ICapeThermoMaterialCompounds, ICapeThermoMaterialPropertyRoutine, ICapeThermoEquilibriumRoutine and ICapeThermoUniversalConstants; the property package then supplies all compound definitions, phase definitions, all property calculations, phase equilibrium calculations, etc.
The only shortcut that I can think of is to provide a property calculation routine. This still requires creating a (COM, or COBIA) based object that implements at least ICapeThermoMaterialContext and ICapeThermoMaterialPropertyRoutine - if you not provide ICapeThermoPhases or ICapeThermoMaterialCompounds it uses the phases and compound provided by the MO passed to ICapeThermoMaterialContext. Also no need to implement phase equilibria. Not many applications support such property routines, but TEA does. You can add one by clicking on the Add button in the External Routines tab of a TEA configuration. Once added, it can be selected for the properties it supports (those that are listed by ICapeThermoMaterialPropertyRoutine::GetSinglePhasePropList). This should include LogFugacityCoefficient (and implement CalcAndGetLnPhi) with derivatives if you want TEA to use that for your phase equilibrium calculations.
It is not straight forward - but what you want to do here perhaps is not straight forward.