Parallel Unit Operations

In CADET 4.0.1 i would like to split a stream after a CSTR (1) and combine the split streams again after some other unit operations (2,4 and 3). The cirquit diagram looks like this:

                         ------ 2 ----- 4 ----
            0 ---- 1 ---                      --- 5 
                         ------ 3 ------------

Do I have to specify ports on UO1 to specify that I connect different output Ports to (2) and (3)?

My first approach was using “-1” for all port specifcations (cf. Example below), but that resulted in some UO not influencing the output signal.

mSys.connections =    {[0, 1, -1, -1, -1, -1,  Q;...
	                1, 2, -1, -1, -1, -1,  Q*0.57;...
                        1, 3, -1, -1, -1, -1,  Q*0.43;...
                        2, 4, -1, -1, -1, -1,  Q*0.57;...
                        3, 5, -1, -1, -1, -1,  Q*0.43;...
                        4, 5, -1, -1, -1, -1,  Q*0.57]};

Next, I tried to specify ports for (1) and (5) :

mCSTR1 = StirredTankModel();
mCSTR2 = StirredTankModel();

mCSTR1.nInputPorts  = 1;
mCSTR1.nOutputPorts = 2;

mCSTR2.nInputPorts  = 2;
mCSTR2.nOutputPorts = 1;

and I tried

mCSTR1.nInputPorts  = [1,NaN];
mCSTR1.nOutputPorts = [1,2];

mCSTR2.nInputPorts  = [1,2];
mCSTR2.nOutputPorts = [1,NaN];

But this results in this type of error:

In class ‘StirredTankModel’, no set method is defined for Dependent property ‘nInletPorts’. A Dependent property needs a set method to assign its value.

My Question is:

Is the approach to split the stream I am using correct? If it is, how can I properly set up Input and Ouput ports?

Thanks in advance,

Johannes

Hi Johannes,

actually you don’t even need ports for this. The so called ports are mainly required for the 2D-General-Rate-Model where it is necessary that we can specify different inlet concentrations at different radial positions of the column.

In your case, you can ignore the ports and set the following connections:

[0, 1, -1, -1, Q,
 1, 2, -1, -1, 0.57*Q,
 2, 4, -1, -1, 0.57*Q,
 4, 5, -1, -1, 0.57*Q,
 1, 3, -1, -1, 0.43*Q,
 3, 5, -1, -1, 0.43*Q]

Best,

Johannes :wink:

While @j.schmoelder is technically correct, the Matlab interface you are using requires the specification of ports.

The nInletPorts and nOutletPorts properties are constant and used internally (don’t try to change them, it won’t work).

The mSys.connections you’ve posted looks good. You don’t need to set up ports at all.
In order to diagnose why some UOs do not influence the output, we need more information about your model.

You can check the input and output of each UO by setting

mSomeUnitOp.returnSolutionInlet = true;
mSomeUnitOp.returnSolutionOutlet = true; % Enabled by default

Then plot the input and output of each unit operation to figure out where the problem is.

Thank you both for your fast replies. I will check which UO creates the problem.

Checking the input and output Signal of each UO was very helpfull. I was able to resolve my problem that way.

Again, thank you very much for your help.

1 Like