-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change CSTR model to support variable porosity #245
Conversation
As discussed yesterday, for downward compatibility, I would suggest exposing both, where |
Maybe we want a breaking change since this is a completely new unit/model? It might actually make sense to force users to acknowledge that the model has changed. Anyways, we should probably first decide if we are going to keep the old CSTR, because if yes then the discussion is obsolete. If we want to expose porosity again, it would probably also make more sense to call it UPDATE: |
CMakeSettings.json
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes in this file should not be added to master and we should also not add them to a PR branch so that we dont mess it up later.
const double sVolume = paramProvider.exists("CONST_SOLID_VOLUME"); | ||
const double initVolume = paramProvider.getDouble("INIT_VOLUME"); | ||
|
||
if (sVolume != initVolume / eps - initVolume) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an exact floating point comparison. Due to round-off and / or representation errors (e.g., 0.3
cannot be represented exactly), it may not work. Allow some slack by introducing relative and / or absolute tolerance: https://codingnest.com/the-little-things-comparing-floating-point-numbers/
Ive rebased, deleted the old CSTR and added backwards compatibility with the old interface with warnings. I dont think we need the porosity as an output from CADET-Core since this is already given by the liquid volume .. that could be considered in a frontend like cadet-process or just leave it to the user. The code still needs some clean up (e.g. change the descriptive comments to the new model) and maybe some changes for the consistent initialization. |
a57704d
to
2b470fb
Compare
697064a
to
438ca75
Compare
In the previous implementation, the CSTR supported variable total volume with constant porosity. Now, only the liquid volume is variable but the solid volume is fixed. Thus, the porosity is also variable. * Changed CSTR implementation * Adapted tests to repsoduce previous test cases * Updated documentation Co-authored-by: Antonia Berger <[email protected]>
438ca75
to
4920f2f
Compare
Fixes #249 and #211
As per discussion in #211, we need to make porosity variable for the CSTR.
TODO
CSTRVarPor
based on theCSTR
unit operation. This is described in the dev guide; please also leave a comment or make changes to the guide.POROSITY
toCONST_SOLID_VOLUME
, which will be the constant solid volume of the tank. Porosity will be computed from that and not be exposed to the user anymore.