Skip to content

Commit

Permalink
WIP add flag to binding models to switch between pH and proton concen…
Browse files Browse the repository at this point in the history
…tration

Add the ###_USE_PROTON_CONCENTRATION flag, which if True sets component 1 to proton concentration and if False sets component 1 to pH (= -log10(proton concentration)).

For the colloidal binding, which can be used with or without pH effects entirely:
Rename the COL_USE_PH flag to COL_INCLUDE_PH, which if True treats component 1 as either pH or proton concentration and if False treats component 1 as a regular component.
  • Loading branch information
ronald-jaepel committed Jul 9, 2024
1 parent b2d9d63 commit 17b3179
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
9 changes: 6 additions & 3 deletions src/libcadet/model/binding/ColloidalBinding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@
"constantParameters":
[
{ "type": "ScalarParameter", "varName": "linThreshold", "confName": "COL_LINEAR_THRESHOLD"},
{ "type": "ScalarBoolParameter", "varName": "usePh", "confName": "COL_USE_PH"}
{ "type": "ScalarBoolParameter", "varName": "includePh", "confName": "COL_INCLUDE_PH"},
{ "type": "ScalarBoolParameter", "varName": "useProtonConcentration", "confName": "COL_USE_PROTON_CONCENTRATION"}
]
}
</codegen>*/
Expand All @@ -63,6 +64,8 @@
qMax = Capacity
*/

// TODO: Actually use useProtonConcentration parameter

namespace cadet
{

Expand Down Expand Up @@ -180,10 +183,10 @@ class ColloidalBindingBase : public ParamHandlerBindingModelBase<ParamHandler_t>
if (_nBoundStates[0] != 0)
throw InvalidParameterException("Salt component (index 0) must be non-binding (NBOUND = 0)");

if (_paramHandler.usePh().get() && (_nComp <= 2))
if (_paramHandler.includePh().get() && (_nComp <= 2))
throw InvalidParameterException("No protein component present (existing two components are salt and PH)");

if (_paramHandler.usePh().get())
if (_paramHandler.includePh().get())
{
_startIdx = 2;
if (_nBoundStates[1] != 0)
Expand Down
5 changes: 4 additions & 1 deletion src/libcadet/model/binding/GeneralizedIonExchangeBinding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@
"constantParameters":
[
{ "type": "ReferenceConcentrationParameter", "varName": ["refC0", "refQ"], "objName": "refConcentration", "confPrefix": "GIEX_"},
{ "type": "ReferenceConcentrationParameter", "varName": ["refPhC0", "refPhQ"], "objName": "refConcentrationPh", "confPrefix": "GIEX_PH", "skipConfig": true}
{ "type": "ReferenceConcentrationParameter", "varName": ["refPhC0", "refPhQ"], "objName": "refConcentrationPh", "confPrefix": "GIEX_PH", "skipConfig": true},
{ "type": "ScalarBoolParameter", "varName": "useProtonConcentration", "confName": "GIEX_USE_PROTON_CONCENTRATION"}
]
}
</codegen>*/
Expand All @@ -66,6 +67,8 @@
refPhC0,refPhQ = Reference concentrations for pH dependent powers
*/

// TODO: Actually use useProtonConcentration parameter

namespace cadet
{

Expand Down

0 comments on commit 17b3179

Please sign in to comment.