You're reading the documentation for a development version. For the latest stable documentation, please have a look at v5.1.X.
Binding models#
A binding model describes the exchange between the mobile and the stationary phase in a particle or bulk volume.
Every binding model implements cadet::model::IBindingModel; most derive from cadet::model::BindingModelBase, which handles the common configuration.
Interface#
-
class IBindingModel#
[source] Defines an internal BindingModel interface.
The binding model calculates the fluxes \( v\left( c_p, q \right) \) of the binding reactions between liquid and solid phase. There can be multiple bound states in the solid phase, if the binding model supports it. Some binding models require a dedicated salt component, which is always given by component 0.
Each binding reaction can be quasi-stationary, that is, it is always in equilibrium. A dynamic reaction generates the terms
\[\begin{split}\begin{align} \frac{\mathrm{d}c_{p,i}}{\mathrm{d}t} + \dots - \frac{1-\varepsilon_p}{\varepsilon_p} v_{i,j}\left( c_p, q \right) &= 0\\ \frac{\mathrm{d}q_{i,j}}{\mathrm{d}t} + \dots + v_{i,j}\left( c_p, q \right) &= 0 \end{align}\end{split}\]where \( v_{i,j} \) is the flux of the reaction between \( c_{p,i} \) and \( q_{i,j} \). Here, \( q_{i,j} \) denotes bound state \( j \) of component \( i \).A quasi-stationary reaction, on the other hand, results in
\[\begin{split}\begin{align} \frac{\mathrm{d}c_{p,i}}{\mathrm{d}t} + \frac{1-\varepsilon_p}{\varepsilon_p} \frac{\mathrm{d}q_{i,j}}{\mathrm{d}t} + \dots &= 0 \\ v_{i,j}\left( c_p, q \right) &= 0. \end{align}\end{split}\]The ordering inside the solid phase is component-major, that means, all bound phases for each component are listed one after the other. For a model having 4 components with 1, 0, 3, 2 bound states, respectively, the ordering is comp0bnd0, comp2bnd0, comp2bnd1, comp2bnd2, comp3bnd0, comp3bnd1. Note that the second component is not present in the solid phase at all since it has no bound state. The bound states of the other components are ordered consecutively.
Subclassed by cadet::model::LinearBindingBase< LinearParamHandler >, cadet::model::LinearBindingBase< ExtLinearParamHandler >, cadet::model::BindingModelBase, cadet::model::DummyBinding, cadet::model::LinearBindingBase< ParamHandler_t >
Public Functions
-
virtual const char *name() const noexcept = 0#
[source] Returns the name of the binding model.
This name is also used to identify and create the binding model in the factory.
- Returns:
Name of the binding model
-
virtual bool requiresConfiguration() const noexcept = 0#
[source] Returns whether the binding model requires additional parameters supplied by configure().
After construction of an IBindingModel object, configureModelDiscretization() is called. The binding model may require to read additional parameters from the adsorption group of the parameter provider. This opportunity is given by a call to configure(). However, a binding model may not require this. This function communicates to the outside whether a call to configure() is necessary.
- Returns:
trueif configure() has to be called, otherwisefalse
-
virtual bool usesParamProviderInDiscretizationConfig() const noexcept = 0#
[source] Returns whether the dynamic reaction model uses the IParameterProvider in configureModelDiscretization().
If the IParameterProvider is used in configureModelDiscretization(), it has to be in the correct scope.
- Returns:
trueif the IParameterProvider is used in configureModelDiscretization(), otherwisefalse
-
virtual bool configureModelDiscretization(IParameterProvider ¶mProvider, unsigned int nComp, unsigned int const *nBound, unsigned int const *boundOffset) = 0#
[source] Sets fixed parameters of the binding model (e.g., the number of components and bound states).
This function is called prior to configure() by the underlying model. It can only be called once. Whereas non-structural model parameters (e.g., rate constants) are configured by configure(), this function sets structural parameters (e.g., number of components and bound states). In particular, it determines whether each binding reaction is quasi-stationary.
Before this function is called, usesParamProviderInDiscretizationConfig() is queried to determine whether the
paramProvideris used by this function. If it is used, theparamProvideris put in the corresponding parameter scope. On exit, theparamProviderhas to point to the same scope.- Parameters:
paramProvider – [in] Parameter provider
nComp – [in] Number of components
nBound – [in] Array of size
nCompwhich contains the number of bound states for each componentboundOffset – [in] Array of size
nCompwith offsets to the first bound state of each component beginning from the solid phase
-
virtual bool configure(IParameterProvider ¶mProvider, UnitOpIdx unitOpIdx, ParticleTypeIdx parTypeIdx) = 0#
[source] Configures the model by extracting all non-structural parameters (e.g., model parameters) from the given
paramProvider.The scope of the cadet::IParameterProvider is left unchanged on return.
The structure of the model is left unchanged, that is, the number of degrees of freedom stays the same (e.g., number of bound states is left unchanged). Only true (non-structural) model parameters are read and changed. This function may only be called if configureModelDiscretization() has been called in the past. Contrary to configureModelDiscretization(), it can be called multiple times.
- Parameters:
paramProvider – [in] Parameter provider
unitOpIdx – [in] Index of the unit operation this binding model belongs to
parTypeIdx – [in] Index of the particle type this binding model belongs to
- Returns:
trueif the configuration was successful, otherwisefalse
-
virtual void fillBoundPhaseInitialParameters(ParameterId *params, UnitOpIdx unitOpIdx, ParticleTypeIdx parTypeIdx) const noexcept = 0#
[source] Returns the ParameterId of all bound phase initial conditions (equations).
The array has to be filled in the order of the equations.
- Parameters:
params – [out] Array with ParameterId objects to fill
unitOpIdx – [in] Index of the unit operation this binding model belongs to
parTypeIdx – [in] Index of the particle type this binding model belongs to
-
virtual void setExternalFunctions(IExternalFunction **extFuns, unsigned int size) = 0#
[source] Sets external functions for this binding model.
The external functions are not owned by this IBindingModel.
- Parameters:
extFuns – [in] Pointer to array of IExternalFunction objects of size
sizesize – [in] Number of elements in the IExternalFunction array
extFuns
-
virtual bool hasParameter(const ParameterId &pId) const = 0#
[source] Checks whether a given parameter exists.
- Parameters:
pId – [in] ParameterId that identifies the parameter uniquely
- Returns:
trueif the parameter exists, otherwisefalse
-
virtual std::unordered_map<ParameterId, double> getAllParameterValues() const = 0#
[source] Returns all parameters with their current values that can be made sensitive.
- Returns:
Map with all parameters that can be made sensitive along with their current value
-
virtual bool setParameter(const ParameterId &pId, int value) = 0#
[source] Sets a parameter value.
The parameter identified by its unique parameter is set to the given value.
- Parameters:
pId – [in] ParameterId that identifies the parameter uniquely
value – [in] Value of the parameter
- Returns:
trueif the parameter has been successfully set to the given value, otherwisefalse(e.g., if the parameter is not available in this model)
-
virtual active *getParameter(const ParameterId &pId) = 0#
[source] Returns a pointer to the parameter identified by the given id.
- Parameters:
pId – [in] Parameter Id of the sensitive parameter
- Returns:
a pointer to the parameter if the binding model contains the parameter, otherwise
nullptr
-
virtual bool hasSalt() const noexcept = 0#
[source] Returns whether this binding model has a salt component.
The salt component is given by component 0, if present.
- Returns:
trueif salt is required, otherwisefalse
-
virtual bool supportsMultistate() const noexcept = 0#
[source] Returns whether this binding model supports multi-state binding.
- Returns:
trueif multi-state binding is supported, otherwisefalse
-
virtual bool supportsNonBinding() const noexcept = 0#
[source] Returns whether this binding model supports non-binding components.
Non-binding components do not have an entry in the solid phase.
- Returns:
trueif non-binding components are supported, otherwisefalse
-
virtual bool hasQuasiStationaryReactions() const noexcept = 0#
[source] Returns whether this binding model has quasi-stationary reaction fluxes.
- Returns:
trueif quasi-stationary fluxes are present, otherwisefalse
-
virtual bool hasDynamicReactions() const noexcept = 0#
[source] Returns whether this binding model has dynamic reaction fluxes.
- Returns:
trueif dynamic fluxes are present, otherwisefalse
-
virtual bool dependsOnTime() const noexcept = 0#
[source] Returns whether this binding model depends on time.
Binding models may depend on time if external functions are used.
- Returns:
trueif the model is time-dependent, otherwisefalse
-
virtual bool requiresWorkspace() const noexcept = 0#
[source] Returns whether this binding model requires workspace.
The workspace may be required for consistent initialization and / or evaluation of residual and Jacobian. A workspace is a memory buffer whose size is given by workspaceSize().
- Returns:
trueif the model requires a workspace, otherwisefalse
-
virtual unsigned int workspaceSize(unsigned int nComp, unsigned int totalNumBoundStates, unsigned int const *nBoundStates) const noexcept = 0#
[source] Returns the size of the required workspace in bytes.
The memory is required for externally dependent binding models.
- Parameters:
nComp – [in] Number of components
totalNumBoundStates – [in] Total number of bound states
nBoundStates – [in] Array with bound states for each component
- Returns:
Size of the workspace in bytes
-
virtual unsigned int requiredADdirs() const noexcept = 0#
[source] Returns the amount of required AD seed vectors / directions.
Only internally required AD directions count (e.g., for Jacobian computation). Directions used for parameter sensitivities should not be included here.
- Returns:
The number of required AD seed vectors / directions
-
virtual int flux(double t, unsigned int secIdx, const ColumnPosition &colPos, active const *y, active const *yCp, active *res, LinearBufferAllocator workSpace, WithParamSensitivity) const = 0#
[source] Evaluates the fluxes.
The binding model is responsible for calculating the flux from the mobile to the solid phase.
This function is called simultaneously from multiple threads. It needs to overwrite all values of @p res as the result array @p res is not zeroed on entry.
- Parameters:
t – [in] Current time point
secIdx – [in] Index of the current section
colPos – [in] Position in normalized coordinates (column inlet = 0, column outlet = 1; outer shell = 1, inner center = 0)
y – [in] Pointer to first bound state of the first component in the current particle shell
yCp – [in] Pointer to first component of the mobile phase in the current particle shell
res – [out] Pointer to result array that is filled with the fluxes
workSpace – [inout] Memory work space
- Returns:
0on success,-1on non-recoverable error, and+1on recoverable error
-
virtual int flux(double t, unsigned int secIdx, const ColumnPosition &colPos, active const *y, active const *yCp, active *res, LinearBufferAllocator workSpace, WithoutParamSensitivity) const = 0#
[source]
-
virtual int flux(double t, unsigned int secIdx, const ColumnPosition &colPos, double const *y, double const *yCp, active *res, LinearBufferAllocator workSpace) const = 0#
[source]
-
virtual int flux(double t, unsigned int secIdx, const ColumnPosition &colPos, double const *y, double const *yCp, double *res, LinearBufferAllocator workSpace) const = 0#
[source]
-
virtual void analyticJacobian(double t, unsigned int secIdx, const ColumnPosition &colPos, double const *y, int offsetCp, linalg::BandMatrix::RowIterator jac, LinearBufferAllocator workSpace) const = 0#
[source] Evaluates the Jacobian of the fluxes analytically.
This function is called simultaneously from multiple threads. It can be left out (empty implementation) if AD is used to evaluate the Jacobian.
The Jacobian matrix is assumed to be zeroed out by the caller.
- Parameters:
t – [in] Current time point
secIdx – [in] Index of the current section
colPos – [in] Position in normalized coordinates (column inlet = 0, column outlet = 1; outer shell = 1, inner center = 0)
y – [in] Pointer to first bound state of the first component in the current particle shell
offsetCp – [in] Offset from the first component of the mobile phase in the current particle shell to
yjac – [inout] Row iterator pointing to the first bound states row of the underlying matrix in which the Jacobian is stored
workSpace – [inout] Memory work space
-
virtual void analyticJacobian(double t, unsigned int secIdx, const ColumnPosition &colPos, double const *y, int offsetCp, linalg::DenseBandedRowIterator jac, LinearBufferAllocator workSpace) const = 0#
[source]
-
virtual void analyticJacobian(double t, unsigned int secIdx, const ColumnPosition &colPos, double const *y, int offsetCp, linalg::BandedEigenSparseRowIterator jac, LinearBufferAllocator workSpace) const = 0#
[source]
-
virtual void timeDerivativeQuasiStationaryFluxes(double t, unsigned int secIdx, const ColumnPosition &colPos, double const *yCp, double const *y, double *dResDt, LinearBufferAllocator workSpace) const = 0#
[source] Calculates the time derivative of the quasi-stationary bound state equations.
Calculates \( \frac{\partial \text{flux}_{\text{qs}}}{\partial t} \) for the quasi-stationary equations in the flux.
This function is called simultaneously from multiple threads. It can be left out (empty implementation) which leads to slightly incorrect initial conditions when using externally dependent binding models.
- Parameters:
t – [in] Current time point
secIdx – [in] Index of the current section
colPos – [in] Position in normalized coordinates (column inlet = 0, column outlet = 1; outer shell = 1, inner center = 0)
yCp – [in] Pointer to first component in the liquid phase of the current particle shell
y – [in] Pointer to first bound state of the first component in the current particle shell
dResDt – [out] Pointer to array that stores the time derivative
workSpace – [inout] Memory work space
-
virtual int const *reactionQuasiStationarity() const noexcept = 0#
[source] Returns an array that determines whether each binding reaction is quasi-stationary.
Each entry represents a truth value (converts to
bool) that determines whether the corresponding binding reaction is quasi-stationary (true) or not (false).- Returns:
Array that determines quasi-stationarity of binding reactions
-
virtual bool preConsistentInitialState(double t, unsigned int secIdx, const ColumnPosition &colPos, double *y, double const *yCp, LinearBufferAllocator workSpace) const = 0#
[source] Returns whether a nonlinear solver is required to perform consistent initialization.
This function is called before a nonlinear solver attempts to solve the algebraic equations. If consistent initialization can be performed using analytic / direct formulas (i.e., without running a nonlinear solver), this function would be the correct place to do it.
This function is called simultaneously from multiple threads.
- Parameters:
t – [in] Current time point
secIdx – [in] Index of the current section
colPos – [in] Position in normalized coordinates (column inlet = 0, column outlet = 1; outer shell = 1, inner center = 0)
y – [inout] Pointer to first bound state of the first component in the current particle shell
yCp – [in] Pointer to first component of the mobile phase in the current particle shell
workSpace – [inout] Memory work space
- Returns:
trueif a nonlinear solver is required for consistent initialization, otherwisefalse
-
virtual void postConsistentInitialState(double t, unsigned int secIdx, const ColumnPosition &colPos, double *y, double const *yCp, LinearBufferAllocator workSpace) const = 0#
[source] Called after a nonlinear solver has attempted consistent initialization.
In consistent initialization, first preConsistentInitialState() is called. Depending on the return value, a nonlinear solver is applied to the algebraic equations and, afterwards, this function is called to clean up or refine the solution.
This function is called simultaneously from multiple threads.
- Parameters:
t – [in] Current time point
secIdx – [in] Index of the current section
colPos – [in] Position in normalized coordinates (column inlet = 0, column outlet = 1; outer shell = 1, inner center = 0)
y – [inout] Pointer to first bound state of the first component in the current particle shell
yCp – [in] Pointer to first component of the mobile phase in the current particle shell
workSpace – [inout] Memory work space
-
virtual const char *name() const noexcept = 0#
Base class#
-
class BindingModelBase : public cadet::model::IBindingModel#
[source] Defines a BindingModel base class that can be used to implement other binding models.
This base class can be used as a starting point for new binding models. Some common parameter handling is provided using a hash map (std::unordered_map).
By default, this base class assumes that the binding model does not use salt and does not support multiple bound states. Non-binding components are assumed to be supported, though. Note that these default settings can be overwritten and do not influence the features provided by this base class.
Subclassed by cadet::model::ParamHandlerBindingModelBase< ParamHandler_t >, cadet::model::ParamHandlerBindingModelBase< handler_t >, cadet::model::SimplifiedMultiStateStericMassActionBinding
Public Functions
-
inline virtual bool requiresConfiguration() const noexcept#
[source] Returns whether the binding model requires additional parameters supplied by configure().
After construction of an IBindingModel object, configureModelDiscretization() is called. The binding model may require to read additional parameters from the adsorption group of the parameter provider. This opportunity is given by a call to configure(). However, a binding model may not require this. This function communicates to the outside whether a call to configure() is necessary.
- Returns:
trueif configure() has to be called, otherwisefalse
-
inline virtual bool usesParamProviderInDiscretizationConfig() const noexcept#
[source] Returns whether the dynamic reaction model uses the IParameterProvider in configureModelDiscretization().
If the IParameterProvider is used in configureModelDiscretization(), it has to be in the correct scope.
- Returns:
trueif the IParameterProvider is used in configureModelDiscretization(), otherwisefalse
-
virtual bool configure(IParameterProvider ¶mProvider, UnitOpIdx unitOpIdx, ParticleTypeIdx parTypeIdx)#
[source] Configures the model by extracting all non-structural parameters (e.g., model parameters) from the given
paramProvider.The scope of the cadet::IParameterProvider is left unchanged on return.
The structure of the model is left unchanged, that is, the number of degrees of freedom stays the same (e.g., number of bound states is left unchanged). Only true (non-structural) model parameters are read and changed. This function may only be called if configureModelDiscretization() has been called in the past. Contrary to configureModelDiscretization(), it can be called multiple times.
- Parameters:
paramProvider – [in] Parameter provider
unitOpIdx – [in] Index of the unit operation this binding model belongs to
parTypeIdx – [in] Index of the particle type this binding model belongs to
- Returns:
trueif the configuration was successful, otherwisefalse
-
virtual bool configureModelDiscretization(IParameterProvider ¶mProvider, unsigned int nComp, unsigned int const *nBound, unsigned int const *boundOffset)#
[source] Sets fixed parameters of the binding model (e.g., the number of components and bound states).
This function is called prior to configure() by the underlying model. It can only be called once. Whereas non-structural model parameters (e.g., rate constants) are configured by configure(), this function sets structural parameters (e.g., number of components and bound states). In particular, it determines whether each binding reaction is quasi-stationary.
Before this function is called, usesParamProviderInDiscretizationConfig() is queried to determine whether the
paramProvideris used by this function. If it is used, theparamProvideris put in the corresponding parameter scope. On exit, theparamProviderhas to point to the same scope.- Parameters:
paramProvider – [in] Parameter provider
nComp – [in] Number of components
nBound – [in] Array of size
nCompwhich contains the number of bound states for each componentboundOffset – [in] Array of size
nCompwith offsets to the first bound state of each component beginning from the solid phase
-
virtual void fillBoundPhaseInitialParameters(ParameterId *params, UnitOpIdx unitOpIdx, ParticleTypeIdx parTypeIdx) const noexcept#
[source] Returns the ParameterId of all bound phase initial conditions (equations).
The array has to be filled in the order of the equations.
- Parameters:
params – [out] Array with ParameterId objects to fill
unitOpIdx – [in] Index of the unit operation this binding model belongs to
parTypeIdx – [in] Index of the particle type this binding model belongs to
-
virtual std::unordered_map<ParameterId, double> getAllParameterValues() const#
[source] Returns all parameters with their current values that can be made sensitive.
- Returns:
Map with all parameters that can be made sensitive along with their current value
-
virtual bool hasParameter(const ParameterId &pId) const#
[source] Checks whether a given parameter exists.
- Parameters:
pId – [in] ParameterId that identifies the parameter uniquely
- Returns:
trueif the parameter exists, otherwisefalse
-
virtual bool setParameter(const ParameterId &pId, int value)#
[source] Sets a parameter value.
The parameter identified by its unique parameter is set to the given value.
- Parameters:
pId – [in] ParameterId that identifies the parameter uniquely
value – [in] Value of the parameter
- Returns:
trueif the parameter has been successfully set to the given value, otherwisefalse(e.g., if the parameter is not available in this model)
-
virtual active *getParameter(const ParameterId &pId)#
[source] Returns a pointer to the parameter identified by the given id.
- Parameters:
pId – [in] Parameter Id of the sensitive parameter
- Returns:
a pointer to the parameter if the binding model contains the parameter, otherwise
nullptr
-
inline virtual bool hasSalt() const noexcept#
[source] Returns whether this binding model has a salt component.
The salt component is given by component 0, if present.
- Returns:
trueif salt is required, otherwisefalse
-
inline virtual bool supportsMultistate() const noexcept#
[source] Returns whether this binding model supports multi-state binding.
- Returns:
trueif multi-state binding is supported, otherwisefalse
-
inline virtual bool supportsNonBinding() const noexcept#
[source] Returns whether this binding model supports non-binding components.
Non-binding components do not have an entry in the solid phase.
- Returns:
trueif non-binding components are supported, otherwisefalse
-
inline virtual bool requiresWorkspace() const noexcept#
[source] Returns whether this binding model requires workspace.
The workspace may be required for consistent initialization and / or evaluation of residual and Jacobian. A workspace is a memory buffer whose size is given by workspaceSize().
- Returns:
trueif the model requires a workspace, otherwisefalse
-
inline virtual unsigned int workspaceSize(unsigned int nComp, unsigned int totalNumBoundStates, unsigned int const *nBoundStates) const noexcept#
[source] Returns the size of the required workspace in bytes.
The memory is required for externally dependent binding models.
- Parameters:
nComp – [in] Number of components
totalNumBoundStates – [in] Total number of bound states
nBoundStates – [in] Array with bound states for each component
- Returns:
Size of the workspace in bytes
-
inline virtual void setExternalFunctions(IExternalFunction **extFuns, unsigned int size)#
[source] Sets external functions for this binding model.
The external functions are not owned by this IBindingModel.
- Parameters:
extFuns – [in] Pointer to array of IExternalFunction objects of size
sizesize – [in] Number of elements in the IExternalFunction array
extFuns
-
inline virtual void timeDerivativeQuasiStationaryFluxes(double t, unsigned int secIdx, const ColumnPosition &colPos, double const *yCp, double const *y, double *dResDt, LinearBufferAllocator workSpace) const#
[source] Calculates the time derivative of the quasi-stationary bound state equations.
Calculates \( \frac{\partial \text{flux}_{\text{qs}}}{\partial t} \) for the quasi-stationary equations in the flux.
This function is called simultaneously from multiple threads. It can be left out (empty implementation) which leads to slightly incorrect initial conditions when using externally dependent binding models.
- Parameters:
t – [in] Current time point
secIdx – [in] Index of the current section
colPos – [in] Position in normalized coordinates (column inlet = 0, column outlet = 1; outer shell = 1, inner center = 0)
yCp – [in] Pointer to first component in the liquid phase of the current particle shell
y – [in] Pointer to first bound state of the first component in the current particle shell
dResDt – [out] Pointer to array that stores the time derivative
workSpace – [inout] Memory work space
-
inline virtual int const *reactionQuasiStationarity() const noexcept#
[source] Returns an array that determines whether each binding reaction is quasi-stationary.
Each entry represents a truth value (converts to
bool) that determines whether the corresponding binding reaction is quasi-stationary (true) or not (false).- Returns:
Array that determines quasi-stationarity of binding reactions
-
inline virtual bool hasQuasiStationaryReactions() const noexcept#
[source] Returns whether this binding model has quasi-stationary reaction fluxes.
- Returns:
trueif quasi-stationary fluxes are present, otherwisefalse
-
inline virtual bool hasDynamicReactions() const noexcept#
[source] Returns whether this binding model has dynamic reaction fluxes.
- Returns:
trueif dynamic fluxes are present, otherwisefalse
-
inline virtual bool preConsistentInitialState(double t, unsigned int secIdx, const ColumnPosition &colPos, double *y, double const *yCp, LinearBufferAllocator workSpace) const#
[source] Returns whether a nonlinear solver is required to perform consistent initialization.
This function is called before a nonlinear solver attempts to solve the algebraic equations. If consistent initialization can be performed using analytic / direct formulas (i.e., without running a nonlinear solver), this function would be the correct place to do it.
This function is called simultaneously from multiple threads.
- Parameters:
t – [in] Current time point
secIdx – [in] Index of the current section
colPos – [in] Position in normalized coordinates (column inlet = 0, column outlet = 1; outer shell = 1, inner center = 0)
y – [inout] Pointer to first bound state of the first component in the current particle shell
yCp – [in] Pointer to first component of the mobile phase in the current particle shell
workSpace – [inout] Memory work space
- Returns:
trueif a nonlinear solver is required for consistent initialization, otherwisefalse
-
inline virtual void postConsistentInitialState(double t, unsigned int secIdx, const ColumnPosition &colPos, double *y, double const *yCp, LinearBufferAllocator workSpace) const#
[source] Called after a nonlinear solver has attempted consistent initialization.
In consistent initialization, first preConsistentInitialState() is called. Depending on the return value, a nonlinear solver is applied to the algebraic equations and, afterwards, this function is called to clean up or refine the solution.
This function is called simultaneously from multiple threads.
- Parameters:
t – [in] Current time point
secIdx – [in] Index of the current section
colPos – [in] Position in normalized coordinates (column inlet = 0, column outlet = 1; outer shell = 1, inner center = 0)
y – [inout] Pointer to first bound state of the first component in the current particle shell
yCp – [in] Pointer to first component of the mobile phase in the current particle shell
workSpace – [inout] Memory work space
-
inline virtual unsigned int requiredADdirs() const noexcept#
[source] Returns the amount of required AD seed vectors / directions.
Only internally required AD directions count (e.g., for Jacobian computation). Directions used for parameter sensitivities should not be included here.
- Returns:
The number of required AD seed vectors / directions
Protected Functions
-
virtual bool implementsAnalyticJacobian() const noexcept = 0#
[source] Returns whether the function analyticJacobian() is implemented.
The Jacobian can be calculated using automatic differentiation (AD) if analyticJacobian() is not implemented.
- Returns:
trueif analyticJacobian() is implemented, otherwisefalse
-
virtual bool configureImpl(IParameterProvider ¶mProvider, UnitOpIdx unitOpIdx, ParticleTypeIdx parTypeIdx) = 0#
[source] Configures the binding model.
This function implements the (re-)configuration of a binding model. It is called when the binding model is configured or reconfigured. On call the _parameters map will always be empty and _kineticBinding is already configured.
- Parameters:
paramProvider – [in] Parameter provider
unitOpIdx – [in] Unit operation index
parTypeIdx – [in] Particle type index
- Returns:
trueif the configuration was successful, otherwisefalse
-
inline virtual bool requiresConfiguration() const noexcept#