Hi all,
Sorry for revivifying extinct species, but I’ve been using the MATLAB front-end .
I’m not sure how to record / obtain time-series solutions for c-bulk, c-solid at specific axial elements in the column, and c-pore, c-solid at specific radial elements in a given particle.
I see we specify solution times, but is there a way to specify solution elements of a particular column, etc.? I saw the equivalent python code online, in the tutorials, but it didn’t seem transferable.
Any help is appreciated! Thanks!
Extract of my MATLAB code:
% Step 3: Assemble system of unit operations
% ===================================================
mOut = OutletModel();
mOut.nComponents = 3;
% Construct ModelSystem and assign unit operations (order determines IDs)
mSys = ModelSystem();
mSys.models = [mIn, mGrm1, mCSTR, mGrm, mOut];
% Define valve configurations / unit operation connections
% Valve configuration active on entering section 0
mSys.connectionStartSection = [0 ];% no meaning yet
% Connect unit 0 with unit 1 (-1 = all components)
%% first 0 first unit inlet.. 1 .. 2 inlet GRM .. then all component
mSys.connections = {[0, 1, -1, -1, FlowSections/(60*1e6); ...
1, 2, -1, -1, FlowSections/(60*1e6); ...
2, 3, -1, -1, FlowSections/(60*1e6);
3, 4, -1, -1, FlowSections/(60*1e6)]};
% Step 4: Create simulator and configure it
% ===================================================
% Construct and configure simulator
sim = Simulator.create();
sim.nThreads = 12;
sim.solutionTimes = pH_time; % [s], time points at which solution is computed
sim.sectionTimes = inletProfile.breaks;
sim.sectionContinuity = inletProfile.continuity;
sim.model = mSys;
% Step 5: Run the model and plot the results
% ===================================================
sim.absTol=1.0000e-08; % 1.0000e-08;
sim.relTol=1.0000e-06; % 1.0000e-06;
sim.algTol= 1.0000e-08; % 1.0000e-08;
sim.relTolSens=1.000e-6; % 1.0000e-06;
sim.maxSteps=1000; % 1000
sim.initStepSize = 1e-12; % 1.0000e-06;
result = sim.run();
% Extract solution into a matrix with time being the first column
solution = [result.solution.time, result.solution.outlet{5}];