Lumped Rate Model with and without pores

I am using “Lumped rate model without pores” for simulating breakthrough data. I have created a MATLAB file for it by going through the tutorials and available examples for GRM but I am facing an error at line 27. The error says :

Unrecognized property ‘constant’ for class ‘LumpedRateModelWithoutPores’.
Error in LRM (line 27)
model.constant = zeros(model.nComponents, 1);

Can I get help in this regard? Also, like GRM can we get an example for both lumped rate models with and without pores.

Of course you can!

The problem is that you’re switching from a SingleGRM to a LumpedRateModelWithPores. The SingleGRM is actually a combination of a ModelSystem and a GeneralRateModel.
CADET only simulates systems. In order to make life a little easier if you just want to simulate a single model, the SingleGRM, SingleLRMP, SingleLRM, and SingleCSTR classes are offered. These provide the necessary ModelSystem without the need to fully set it up (i.e., provide InletModel, connect actual model and InletModel, etc.).

Long story short, here’s the relevant section of the loadWashElutionSMAsingle.m file for the LumpedRateModelWithPores:

	% Lumped rate model with pores unit operation
	mLrmp = SingleLRMP();

	% Discretization
	mLrmp.nComponents = 4;
	mLrmp.nCellsColumn = 16; % Attention: This is very low and only used for illustration (short runtime)
	mLrmp.nBoundStates = ones(mLrmp.nComponents, 1); % Number of bound states for each component

	% Initial conditions (equilibrated empty column)
	mLrmp.initialBulk = [50.0 0.0 0.0 0.0]; % [mol / m^3], also used for the particle mobile phase
	mLrmp.initialSolid = [1.2e3 0.0 0.0 0.0]; % [mol / m^3]
		
	% Transport
	mLrmp.dispersionColumn          = 5.75e-8; % [m^2 / s]
	mLrmp.filmDiffusion             = [6.9e-6 6.9e-6 6.9e-6 6.9e-6]; % [m/s]
	mLrmp.interstitialVelocity      = 5.75e-4; % [m/s]

	% Geometry
	mLrmp.columnLength        = 0.014; % [m]
	mLrmp.particleRadius      = 4.5e-5; % [m]
	mLrmp.porosityColumn      = 0.37; % [-]
	mLrmp.porosityParticle    = 0.75; % [-]
	
	% Adsorption
	mSma = StericMassActionBinding();
	mSma.kineticBinding = false; % Quasi-stationary binding
	mSma.lambda     = 1.2e3; % Ionic capacity [mol / m^3]
	mSma.kA         = [0.0 35.5 1.59 7.7]; % Adsorption rate [(m^3 / mol)^nu / s]
	mSma.kD         = [0.0 1000 1000 1000]; % Desorption rate [(m^3 / mol)^nu / s]
	mSma.nu         = [0.0 4.7 5.29 3.7]; % Characteristic charge [-]
	mSma.sigma      = [0.0 11.83 10.6 10.0]; % Steric factor [-]
	mLrmp.bindingModel = mSma;
	
	% Specify inlet profile

	% Reserve space: nSections x nComponents (a section can be thought of being a 
	% step in the process, see below)
	mLrmp.constant       = zeros(3, mLrmp.nComponents);
	mLrmp.linear         = zeros(3, mLrmp.nComponents);
	mLrmp.quadratic      = zeros(3, mLrmp.nComponents);
	mLrmp.cubic          = zeros(3, mLrmp.nComponents);

	% Section 1: Loading phase
	mLrmp.constant(1,1)  = 50.0;  % [mol / m^3] component 1
	mLrmp.constant(1,2)  = 1.0;   % [mol / m^3] component 2
	mLrmp.constant(1,3)  = 1.0;   % [mol / m^3] component 3
	mLrmp.constant(1,4)  = 1.0;   % [mol / m^3] component 4

	% Section 2: Washing phase (no protein feed)
	mLrmp.constant(2,1)  = 50.0;  % [mol / m^3] component 1

	% Section 3: Elution phase (linear salt gradient with step at the beginning)
	mLrmp.constant(3,1)  = 100;  % [mol / m^3] component 1
	mLrmp.linear(3,1)  = 0.2;  % [mol / (m^3 * s)] component 1

Accordingly, for the LumpedRateModelWithoutPores, we get

	% Lumped rate model without pores unit operation
	mLrm = SingleLRM();

	% Discretization
	mLrm.nComponents = 4;
	mLrm.nCellsColumn = 16; % Attention: This is very low and only used for illustration (short runtime)
	mLrm.nBoundStates = ones(mLrm.nComponents, 1); % Number of bound states for each component

	% Initial conditions (equilibrated empty column)
	mLrm.initialBulk = [50.0 0.0 0.0 0.0]; % [mol / m^3], also used for the particle mobile phase
	mLrm.initialSolid = [1.2e3 0.0 0.0 0.0]; % [mol / m^3]
		
	% Transport
	mLrm.dispersionColumn          = 5.75e-8; % [m^2 / s]
	mLrm.interstitialVelocity      = 3e-3; % [m/s]

	% Geometry
	mLrm.columnLength        = 0.014; % [m]
	mLrm.porosity            = 0.37 * (1.0 - 0.37) * 0.75; % [-]
	
	% Adsorption
	mSma = StericMassActionBinding();
	mSma.kineticBinding = false; % Quasi-stationary binding
	mSma.lambda     = 1.2e3; % Ionic capacity [mol / m^3]
	mSma.kA         = [0.0 35.5 1.59 7.7]; % Adsorption rate [(m^3 / mol)^nu / s]
	mSma.kD         = [0.0 1000 1000 1000]; % Desorption rate [(m^3 / mol)^nu / s]
	mSma.nu         = [0.0 4.7 5.29 3.7]; % Characteristic charge [-]
	mSma.sigma      = [0.0 11.83 10.6 10.0]; % Steric factor [-]
	mLrm.bindingModel = mSma;
	
	% Specify inlet profile

	% Reserve space: nSections x nComponents (a section can be thought of being a 
	% step in the process, see below)
	mLrm.constant       = zeros(3, mLrm.nComponents);
	mLrm.linear         = zeros(3, mLrm.nComponents);
	mLrm.quadratic      = zeros(3, mLrm.nComponents);
	mLrm.cubic          = zeros(3, mLrm.nComponents);

	% Section 1: Loading phase
	mLrm.constant(1,1)  = 50.0;  % [mol / m^3] component 1
	mLrm.constant(1,2)  = 1.0;   % [mol / m^3] component 2
	mLrm.constant(1,3)  = 1.0;   % [mol / m^3] component 3
	mLrm.constant(1,4)  = 1.0;   % [mol / m^3] component 4

	% Section 2: Washing phase (no protein feed)
	mLrm.constant(2,1)  = 50.0;  % [mol / m^3] component 1

	% Section 3: Elution phase (linear salt gradient with step at the beginning)
	mLrm.constant(3,1)  = 100;  % [mol / m^3] component 1
	mLrm.linear(3,1)  = 0.2;  % [mol / (m^3 * s)] component 1

The model (mLrm or mLrmp) is then passed to the simulator object:

	% Construct and configure simulator
	sim = Simulator.create();
	sim.solutionTimes = linspace(0, 1500, 1001); % [s], time points at which solution is computed

	% sectionTimes holds the sections and sectionContinuity indicates whether
	% the transition between two adjacent sections is continuous
	sim.sectionTimes = [0.0 10.0 90.0 1500.0]; % [s]
	sim.sectionContinuity = false(2,1);

	% Hand model over to simulator	
	sim.model = mLrmp; % or mLrm
1 Like

Thank you very much Samuel for the support. I made the corrections and it’s simulating now.

Regards
Lalita