function FlowThrough1(varargin)
disp('Model a flow-through reactor')
% Configure and initialize the inlet fluid
cp_inlet = ChemPlugin('FlowThrough1.txt');
cmd = 'Ca++ = 1 mmol/kg; HCO3- = 1 mmol/kg;pH = 1; balance on Cl-';
Config(cp_inlet, cmd);
Initialize(cp_inlet);

% Configure and initialize the stirred reactor
cp = ChemPlugin('FlowThrough1.txt');
cmd1 = 'swap Calcite for Ca++; Calcite = 0.03 free m3; Cl- = 1 mmol/kg;';
cmd2 = 'swap CO2(g) for H+; fugacity CO2(g) = 1; balance on HCO3-;';
cmd3 = 'volume = 1 m3; fix f CO2(g); delxi = 0.01; pluses = banner;';
Config(cp, cmd1);
Config(cp, cmd2);
Config(cp, cmd3);
Initialize(cp, 1.0, 'day');

%Link reactor to inlet and free outlet; set rate of flow
link1 = Link(cp, cp_inlet);
link2 = Link(cp);
FlowRate(link1, 10.0, 'm3/day');
FlowRate(link2, -10.0, 'm3/day');

PlotHeader(cp, 'FlowThrough1.gtp', 'char');
PlotBlock(cp);
while 1
     time_step = ReportTimeStep(cp);
     if (AdvanceTimeStep(cp, time_step))
        break;
    end
    if (AdvanceTransport(cp))
        break;
    end
    if (AdvanceChemical(cp))
        break;
    end
    PlotBlock(cp);
end
end
