Hi,
This is an interesting question. The way to add these additional bulk phases is to introduce new reactor objects for each phase, and add these reactors to the network. The one slightly tricky requirement is that you also need to define a new ReactorSurface connecting those reactors to the surface phase:
r = ct.IdealGasConstPressureReactor(gas, energy='off') rCaCO3 = ct.ConstPressureReactor(CaCO3_phase, energy='off') rCaO = ct.ConstPressureReactor(CaO_phase, energy='off') rCaCO3.volume = 0.0005 rCaO.volume = 0.0005 surf = ct.ReactorSurface(surf_phase, r=r, A=1) surf = ct.ReactorSurface(surf_phase, r=rCaCO3, A=1) surf = ct.ReactorSurface(surf_phase, r=rCaO, A=1) net = ct.ReactorNet([r, rCaCO3, rCaO])You can then modify the integration loop to track the mass of each phase:
masses = [] while t < t_end: t = net.step() states.append(r.thermo.state, t=t, surf_coverages=surf.coverages) masses.append((r.mass, rCaCO3.mass, rCaO.mass))And plot the result at the end:
masses = np.array(masses) fig, ax = plt.subplots() ax.plot(states.t * 1000, masses[:,0], label='gas') ax.plot(states.t * 1000, masses[:,1], label='CaCO3') ax.plot(states.t * 1000, masses[:,2], label='CaO') ax.set(xlim=(0.0, 0.2), xlabel='time [ms]', ylabel='mass [kg]') ax.legend()
I’ll note that at present, I think this only works correctly as long as you use distinct Solution objects for each Reactor in the ReactorNet, due to the issue discussed in Enhancement #201. Also, there’s nothing that stops the reactions involving the solid phase species if the mass of one of those phases goes to zero, so you can end up with negative mass in those reactors. I’ll try to write up another Enhancement proposal to track the improvements that could be made here.
Regards,
Ray



