Questions about "switches"

Hi Cadet community,

I would like to use CADET to simulate a chromatography process where there are two “switches” in the flow path. I would like to set unit_000 to loading, and when unit_000 is loading, switch_000 is on and switch_001 is off (flow rate is 0), and set unit_001 to gradient elution, and when unit_001 is gradient eluting, switch_001 is on and switch_000 is off (flow rate is 0). The code is as follows:

    model.root.input.solver.sections.nsec = 4
    model.root.input.solver.sections.section_times = [0, 30, 750, 7950, 9000] 
    model.root.input.solver.sections.section_continuity = [0]
    model.root.input.model.unit_001.sec_000.const_coeff = [0, 0] 
    model.root.input.model.unit_001.sec_001.const_coeff = [2000, 0.0] 
    model.root.input.model.unit_001.sec_002.const_coeff = [2000, 0.0]
    model.root.input.model.unit_001.sec_002.lin_coeff = [-(1980)/7200, 0.0]
    model.root.input.model.unit_001.sec_003.const_coeff = [20, 0.0]

    model.root.input.model.unit_000.sec_000.const_coeff = [2000, 0.13] 
    model.root.input.model.unit_000.sec_001.const_coeff = [0, 0]
    model.root.input.model.unit_000.sec_002.const_coeff = [0, 0]
    model.root.input.model.unit_000.sec_003.const_coeff = [0, 0]

    model.root.input.model.connections.nswitches = 2
    model.root.input.model.connections.switch_000.section = 0
    model.root.input.model.connections.switch_000.connections = [
        0, 3, -1, -1, 1.94e-8, 
        3, 4, -1, -1, 1.94e-8,
        4, 5, -1, -1, 1.94e-8,
        5, 6, -1, -1, 1.94e-8,
        6, 7, -1, -1, 1.94e-8]  

    model.root.input.model.connections.switch_001.section = 1
    model.root.input.model.connections.switch_001.connections = [
        1, 2, -1, -1, 1.94e-8,
        2, 3, -1, -1, 1.94e-8,
        3, 4, -1, -1, 1.94e-8,
        4, 5, -1, -1, 1.94e-8,
        5, 6, -1, -1, 1.94e-8,
        6, 7, -1, -1, 1.94e-8]

My question is how to do such a setup? If anyone could give me some advice, I would greatly appreciate it!

Hi Yang,

I would highly recommend using the modern CADET-Process interface. It has examples that illustrate the use of Events to change flow-rates and unit connectivities.

If further questions come up, please let me know.

Thanks for the suggestion, I will try CADET-Process!

1 Like