Skip to content

Commit 17b3179

Browse files
committed
WIP add flag to binding models to switch between pH and proton concentration
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.
1 parent b2d9d63 commit 17b3179

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/libcadet/model/binding/ColloidalBinding.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@
5151
"constantParameters":
5252
[
5353
{ "type": "ScalarParameter", "varName": "linThreshold", "confName": "COL_LINEAR_THRESHOLD"},
54-
{ "type": "ScalarBoolParameter", "varName": "usePh", "confName": "COL_USE_PH"}
54+
{ "type": "ScalarBoolParameter", "varName": "includePh", "confName": "COL_INCLUDE_PH"},
55+
{ "type": "ScalarBoolParameter", "varName": "useProtonConcentration", "confName": "COL_USE_PROTON_CONCENTRATION"}
5556
]
5657
}
5758
</codegen>*/
@@ -63,6 +64,8 @@
6364
qMax = Capacity
6465
*/
6566

67+
// TODO: Actually use useProtonConcentration parameter
68+
6669
namespace cadet
6770
{
6871

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

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

186-
if (_paramHandler.usePh().get())
189+
if (_paramHandler.includePh().get())
187190
{
188191
_startIdx = 2;
189192
if (_nBoundStates[1] != 0)

src/libcadet/model/binding/GeneralizedIonExchangeBinding.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@
5050
"constantParameters":
5151
[
5252
{ "type": "ReferenceConcentrationParameter", "varName": ["refC0", "refQ"], "objName": "refConcentration", "confPrefix": "GIEX_"},
53-
{ "type": "ReferenceConcentrationParameter", "varName": ["refPhC0", "refPhQ"], "objName": "refConcentrationPh", "confPrefix": "GIEX_PH", "skipConfig": true}
53+
{ "type": "ReferenceConcentrationParameter", "varName": ["refPhC0", "refPhQ"], "objName": "refConcentrationPh", "confPrefix": "GIEX_PH", "skipConfig": true},
54+
{ "type": "ScalarBoolParameter", "varName": "useProtonConcentration", "confName": "GIEX_USE_PROTON_CONCENTRATION"}
5455
]
5556
}
5657
</codegen>*/
@@ -66,6 +67,8 @@
6667
refPhC0,refPhQ = Reference concentrations for pH dependent powers
6768
*/
6869

70+
// TODO: Actually use useProtonConcentration parameter
71+
6972
namespace cadet
7073
{
7174

0 commit comments

Comments
 (0)