For the python equation of state, users can define their own helmholtz_energy function that takes a StateHD object as input. In the function, properties of the state can be accessed, e.g. one can write state.moles.
To make this work, there has to be a non-generic state object for each (hyper) dual number.
Currently, missing dual numbers are simply defined in feos-core. Using these definitions, for each a non-generic StateHD version is built.
There are currently two issues:
- simply defining the dual numbers is not enough - we need arithmetic operations, etc. from
num-dual (which currently does not export all variants we need to Python)
- we do not call
impl_state_hd! (which implement the getters) for all states that are built. Hence, there will be errors in Python when one tries to call the getters.
To fix this, we
- have to properly export all dual numbers that are needed from
num-dual. (Check class names in macros!)
- properly build all state definitions
- build state definition and implementation for
HelmholtzEnergyDual in single macro?
For the
pythonequation of state, users can define their ownhelmholtz_energyfunction that takes aStateHDobject as input. In the function, properties of the state can be accessed, e.g. one can writestate.moles.To make this work, there has to be a non-generic state object for each (hyper) dual number.
Currently, missing dual numbers are simply defined in
feos-core. Using these definitions, for each a non-genericStateHDversion is built.There are currently two issues:
num-dual(which currently does not export all variants we need to Python)impl_state_hd!(which implement the getters) for all states that are built. Hence, there will be errors in Python when one tries to call the getters.To fix this, we
num-dual. (Check class names in macros!)HelmholtzEnergyDualin single macro?