| 3021 | kH2 = gas.species_index("H2") |
| 3022 | kO2 = gas.species_index("O2") |
| 3023 | class SurfReactor(ct.ExtensibleIdealGasReactor): |
| 3024 | def replace_eval_surfaces(self, LHS, RHS, sdot): |
| 3025 | site_density = self.surfaces[0].kinetics.site_density |
| 3026 | sdot[:] = 0.0 |
| 3027 | LHS[:] = 1.0 |
| 3028 | RHS[:] = 0.0 |
| 3029 | C = self.thermo.concentrations |
| 3030 | theta = self.surfaces[0].coverages |
| 3031 | |
| 3032 | # Replace actual reactions with simple absorption of H2 -> H(S) |
| 3033 | rop = 1e-4 * C[kH2] * theta[kPts] |
| 3034 | RHS[kHs] = 2 * rop / site_density |
| 3035 | RHS[kPts] = - 2 * rop / site_density |
| 3036 | sdot[kH2] = - rop * self.surfaces[0].area |
| 3037 | |
| 3038 | def replace_get_surface_initial_conditions(self, y): |
| 3039 | y[:] = 0 |
| 3040 | y[kPts] = 1 |
| 3041 | |
| 3042 | def replace_update_surface_state(self, y): |
| 3043 | # this is the same thing the original method does |
| 3044 | self.surfaces[0].coverages = y |
| 3045 | |
| 3046 | r1 = SurfReactor(gas) |
| 3047 | r1.volume = 1e-6 # 1 cm^3 |
no outgoing calls