vvpisarev / CubicEoS.jl

Functions to work with substances and mixtures described by cubic equations of state (Redlich-Kwong, Peng-Robinson, etc.)
MIT License
7 stars 1 forks source link

[VT-flash] Refactor closure generation #28

Closed stepanzh closed 2 years ago

stepanzh commented 2 years ago

Function __vt_flash_optim_closures in variable-related code seems duplicative for gradient's and helmholtz energy's closures.

We may generate them for an AbstractVTFlashState from user-provided gradient! and nmolvol. So there won't be need to define __vt_flash_optim_closures.

See, the code below is general

https://github.com/vvpisarev/CubicEoS.jl/blob/dd2b6a14fe0a73d235c499527639d6269407a18e/src/vt_flash/state_ratio.jl#L141-L161

Only constrain step closure seems to be user-provided.

stepanzh commented 2 years ago

Closed by #48.