 OK, so let's start, this is lesson two, excuse me, on mineral dissociation precipitation. Now with example one, it's to set up as if you are doing a batch reactor experiment with some calcite grains in the solution. You're trying to, you essentially will be running numerical experiments imagining that your rate, calcite dissolution rates are in these given numbers. You have how much calcite grains in the system, et cetera. So here, let's see. For this unit, for this lesson, the difference between this one, previous one in lesson one is lesson one only have aqueous complexation. So it doesn't have any kinetics. It only have some dynamics. That one is zero space dimension and also no time dimension. Now here, by introducing the reaction kinetics, we are essentially also, we are essentially not looking at the time dimension. We still have a well-maked system, which is a zero-dimension system. We're not looking at things change in the function space. So you have uniform concentration in the batch reactor. So that's the major difference. Let's read this example question, and then I would explain a little bit, and then we can try to set it up in crunch flow. OK, so example one is about calcite dissolution. Calcite dissolution proceeds through parallel pathways as shown in reaction one, two, three. That's what we see in lesson two. In addition to these kinetic reactions, there are also a series of instantaneous aqueous reactions or aqueous complexation reactions at quite the same time. So three fast reactions should be the same as the ones in example two of lesson one. So that's for the faster reactions, the aqueous specialization reaction. So this essentially specifies what aqueous specialization reaction should include in this example. Now in a batch reactor, the initial solution is at a pH 5.0 with close to zero salinity, meaning it's not a concentrated solution. The initial total carbon concentration is 3.15 times 10 to the minus 4 more per kilogram water. Kinetic rate constant for three parallel reactions are 1.00 times 10 to the minus 2, 5.62 times 10 to the minus 6, and then the other number. This is for the corresponding three reactions in one, two, three. And then the volume fraction of the calcite grains in the batch reactor is 0.5%. So if you have 100 milliliter, then your 0.5 milliliter of calcite, you can convert that to how much mass it is. With a specific surface area of 0.25 meter square per gram, please set up the simulation and plot to the following quantities as a function of time. So now we're looking at the time dimension, starting from initial conditions. So initially, you have some total carbon concentration there, 3.15 times 10 to the minus 4 more per kilogram. But essentially, you don't have other species. Now the question is asking you, first of all, the total calcium concentration and total neorganic carbon. So you need to plot that as a function of time. Second, always the individual calcium containing species and carbonate species. And so here you want to see, essentially, asking which one the dominant species and everything. And then also the pH and IAP over KQ, which is a saturation index or explicit. OK, so let's do this. Let's go to that folder again. OK, again, so I have four files here waiting for you. Let's open the input file. Let's do the notepad. Like all these red line and everything underlying all my words. Let's open it with notepad. All right, so this is a template, essentially, and we need to fill in. OK, so this, let's say, title would be less than 2. Calcite just rushing in a batch reactor. See this runtime specification is still there. Database, make sure it's data.com.dbs and everything. OK, so here make sure you don't do speciate only. Because when you do speciate only, the time is not going to be stepped. And you cannot do this calculation, because this is for kinetic and you need time-stabbing. Output file, the output cube block, we need to specify what we want the system to output. So first of all, we need to specify what units are we using. Let's do a second. We know calcite just rushing very fast. Or maybe minutes, or two minutes. Let's call it time. We need to specify time-series calcite just rushing. And for batch reactor, we should only have one group block. So let's just specify this as a group block one. Time-series print. What time-series printer do is you specify what species you want to print. So you can put a specific freedom, casium. And this need to be the, let me just kind of make it explained, needs to be primary species. It cannot output time-series for secondary species. So you can specify the casium, or pH, or bicarbonate. But it's very important that maybe we do all. If you specify all, meaning all species, all primary species, will be printed. Just characterization. We should only have one species. So first, we need to specify the unit's distance units. Let's say it's meters. And then when you need to specify zones, x-zones, y-zones, so you have x-zones should be 1.1. So you only have one group block. Now for the other dimensions, it will make it, if you only specify one, so essentially you have one meter, one meter, one meter. If you don't specify other, it will assume it's meter, the same unit, and it's one, quantity is one. So essentially you have one meter cube. Maybe we'll make it centimeters to be more realistic. And you have 10.0. It shouldn't matter because we are specifying volume fraction, not a specific number. But to be, so if I'm specifying, maybe I would do 100. So because a typical batch or a flux or something, that you do batch roughly is about in hundreds of milliliters. So I'm specifying here, this is 200 centimeter cube, essentially. The other two dimensions, y direction z direction, by default, would be one centimeter, one centimeter. So it should be 200 centimeter cube, essentially 200 milliliter. That's a discretization. Now we actually also need, in output, we need to specify how long we want this to run, spatial profile. So maybe we'll do, let's say, one minute. And then minutes, it is all pretty fast. Let's say it's 5.0, 10.0, 0.0. So we run for 100 minutes. That's endpoint time. So submission will be run until 100 minutes. Now we don't have spatial discretization. We don't have, we only have one grid block. It's a well-made system, so we don't need to specify. We don't have something coming from the boundary. We should be fine. Let's specify, initial condition should be whatever condition we specify. So let's do it later. We don't have transport. We can almost safely delete that. We also don't have flow. We don't have process. We cannot delete all that. So the primary spatial you want to put in, we talked about before. You should have casium. First of all, you always need each process, actually. What else you need? Let's put a bit of sodium chloride there, just in case we need to make charge balance. So we can use sodium chloride. So usually you use species that are not reactive to make it, to do charge balance. Otherwise, you will be changing the condition of the important species. What else? We need bicarbonate species. It's still used bicarbonate. That should be it for primary species. Second species, again, OH-minus would be the top one. All the other carbonate species, AQ, CO3. Potentially with these, we could form COH-plus. That's another aqueous species. You can check by doing speciation only, by data sweeping or something, to see if which species will be dominating, if you would like. Potentially, calcium carbonate will also form aqueous-casual carbonate. And chloride, possibly, you would also have that. OK, I think that's good for our second species, I believe. OK, so for this one, we need initial condition, because the system cell, this is where t equal to 0. So let's call that condition initial. And you need to specify all the primary species. Copy the list of primary species here. So the question says initial pH is 5.0. So let's specify pH would be 5.0 first, instead of saying H-plus as to 5.0. So initial calcium condition should be almost 0. Now, usually, I try not to put Diracus 0 there, because sometimes computers have problem with 0. And I always put a very small number there, just in case. So for it's very small, essentially none, I'm putting very these 10 to minus 10 concentrations. But carbonate is a good, the question said initially 3.15 times 10 to minus 4. OK, this is what you put it there. That's a total concentration essentially, not specific. And the question says total carbonate concentration, that's consistent. Now, here we also have, in the solution, we should also have calcite, because calcite need to dissolve out. So we need to have the calcite mineral. This is important, because otherwise there would be no representation of calcite green there. So let's put calcite. And it says volume fraction 0.05%. So the first number should be the volume fraction. And then it also says specific surface. The keyword is specific. Surface area is 0.25. So let me just comment on that. The first number, volume fraction, is 0.05. SSA is 0.24 meter square per gram. So that's a unit. You can also specify total surface area, I believe. Let me just search the manual. Maybe you can do, it should be similar. Or you can specify bulk surface area or specific surface area. If it's bulk surface area, you will be putting absolute value. If it's specific surface area, it should be in the unit meter square per gram. So it's typical of the way you're putting is name of solid face, volume fraction, surface area option, and value, bulk surface area. So you can look through this if you would like to have more details. Go into page 6869 in the manual. All right. Now we cannot put in the green size, but the specific surface area is more or less refracting the green size. You have, when you have smaller grains, you tend to larger specific surface area. When you have larger grain, you have small specific surface area. But also, of course, for different minerals, they are also different. OK, so the initial condition. But one thing we need to keep in mind is that the solid face need to be recognized by the mineral keyword block. This is where you're putting the kinetic information. Without that, you can either use the kinetic information gray block or in the database, which I usually prefer to put in port five, because then you have everything in the same place. So here you will need to put in the rate constants in the log 10 units. This rate should be in log 10 rates in units of more meters squared per second. So the way you're putting is calcite. And then you have the label. If it's using default, then your rate is, OK, let me just check the three reaction pathways. We are saying for calcite, you have these three reactions. So you have k1, k2, and k3. They all have the same. So k1 depends on h plus. k2 depends on h2, c3. k3 is there's no dependence. So let's just also check the database. Save it, and let's look at the database. Make sure the default and everything. Make sure we know what are the format for each label. Search for calcite. So this is a TST rate law. Default is, OK, h plus one is one that depends on h. So that's k1. So let's say label. So you need to kind of look back and forth a bit. So let's do h plus first. And I said the rate constant is what? 1 times 10 to the minus 2 for the 3 or 4k1 for the h plus dependence one. So this one is in units of more per meter square per second. This one should be minus 2. And then you have the calcite second one with the, let's call it a CO2. So it's less confusing. Let's call it a CO2 dependence. And it's dependent on this with 1.0. So these dependence need to be specified in the database. But not the one, as I probably should say, h2, CO3. And then default is one without any dependence, OK? So if we specify the number here, OK, so that will be CO2. So the second rate constant is 5.62 minus 6 in log unit minus 6. So it's 5.25. And then the default one is without dependence is 7.24 times 10 to the minus 7. Minus 9, minus 8.14 for the three parallel reactions one. OK, so now, so these rate constants should be overwrite whatever that is in the database. You have condition, let's just check it. You have condition, you have mineral specified with kinetics. You have primary, second species. OK, you need to specify what are the initial conditions. So you should have, say, the initial condition initial. Yeah, we call that initial. So this condition will be in the first grid box. You will only have one grid box. This is specify the location. You can dig into manual, for example, search for this keyword block, and the manual explain in detail what you need to put, what you can put in. So here is this initial condition, it's interesting. OK, I'm using this initial condition for this grid box one. Let's see if they run. I think we should, unless we made a mistake somewhere. Lesson, rate label. Can anyone not find in database looking for calcite rate label CO2? Interesting, maybe I didn't save it. Let's do it again. I just save it. To lesson, example. Now it runs. There's something else coming up. So the other time I changed the need to CO2, but I didn't save it. So the code doesn't recognize the CO2 label. So I saved the database with the CO2. Then the code not recognize that label. And then now it's speciation. OK, so speciation is finished. No aqueous kinetic block found. Retardation probably not found. Both the number of cells and the grid box spacing should be. Oh, OK. Only one value provided. I think that's in the problem with discretization. So I need to provide. Let's go to just make sure we discretization key. X and Y zone, Z zone. Please, please, please. At discretization, you can specify the X zone, Z zone, Y zone. So the syntax is specify the X zone and it's how many number of cells and the spacing. OK, good. And number of cells should be integer. And spacing is a real number. So we are saying we have one grid box and the spacing is 200 centimeters. I think that should make it work. So I just look it up and do it again. All right, so it runs. Let's finish. That's good. And suddenly you discover there are a lot of output files. Each of these output files, for each of these, these are all out. So you have each of these. African, you have every 1, every 2, every 3, 4, 5. Each of these is corresponding to one of these times that you specified in the spatial profile. Remember in the spatial profile, I put one minute. So it's spit out the output at one minute, five minutes, 10 minutes, 15 minutes, and 100 minutes. So the one will be representing one minute. Two will be five in this. So each of these have five. I still have this, five. Can the chasing have five? Gas, mineral percentage because you have mineral. pH, porosity, a lot of information. These are like a standard output. Some of them are not useful for this example, but I kind of want to let's go through. So in order to answer the question I say, you want to plot everything in the functional time. All these other areas, like area 1 to 5, because we only have one grid block. So the spatial profile is not really useful for us. If we have 100 grid blocks, we want to see how this is very special, very special. Now you only have one grid block, so it's not really interesting. It's more interesting to look at that as a functional time. And we specified the breakthrough curve should be in calcite dissolution dot out. So let's look at that file. This will be what you should look for for the breakthrough. Calcite, just OK, just you would. So we said essentially output everything. So again, first it's time-stepping with very tiny time steps. And then later it becomes larger times, because it's kind of approaching to equilibrium. Now look, so you have pH, you have H plus, calcium, sodium chloride, all is a functional time. We said all, so it also spit out sodium chloride, but we actually don't really need that. But why? OK, we also should have, OK, interesting. Bicarbonate H plus, CO2, AQ, CO3, calcium. So it actually does spit out all the aqueous speciation as well. And these are in active values. These are actually in log units. For the primary species, it's in absolute values, not log. For the second species, they are in log. So this will be 10 to the minus 8.99, 10 to the minus 3.52, 10 to the minus 9.5, for example. So it should be increasing. So you actually can directly read, if you want, to prod in Excel. You can either do MATLAB, Excel, whichever way that is easier for you. Let me just show you how to open that in Excel. So if that's the easiest for you. I'm opening up Excel. And I will say, open. Oh, this is no good, sorry. This one, that's yeah. OK. So you will say, so the code I can actually fix the width, it will spit out for this. So you have all the different species, pH, H plus, pH. So you can prod whichever that I asked for. You can prod primary species. Pay attention to the same. OK, this also gives the calcium in the log units. So these are individual species. And these are the total for the primary species. So if you want to prod a primary species, like the individual species, you do want to use these columns starting from H plus here, when it has a log, after it's already been logged. So this is how you can do, for example, getting all the time series and prod out the files. So that's the example you can see, all the changes in the function time, high saturation change in the function time. So here, I'm giving you the solution already. But you want to be able to generate that by yourself. I want to be able to see that. And you shouldn't just, before you do anything, you shouldn't look at the solution yet. But I'm still telling you here, these solutions for the individual concentrations, OK, these are total calcium total bicom. So it should be from the first several columns on primary species. And you can see the carbon is always higher than the calcium. Because initially, there are some carbon species there. If you look carefully, the difference is actually exactly the initial concentration of carbonate. Because essentially, when calcium dissolves, it should be dissolving calcium and total carbon in one-to-one stoichiometric coefficient. When the calcium dissolves, pH increases over time. Until it reaches around 8, so it's concentration with certain value is stopped because there's rich equilibrium. IEP over KQ get to about 1, which is at equilibrium at about 120 or 130 minutes, which is similar to where concentration reached like a plateau. And looking at the individual concentrations, so this is a bit hard to see. Total calcium should be the highest. And blue is, so the free calcium is a dominant species. And then this light blue is CA bicarbonate. So calcium bicarbonate is the second one. Red one is CSO3. And then you have COH plus, which is reasonable because you have a lot of carbon in the species in the system. So that should give you a sense of how you do with mineral dissolution precipitation. And in the extension, as an extension of the example one, in the HOMOG assignment, I asked you to do the carbon dissolution, changing several key parameters, essentially. Example one did all this in one particular condition. But we all know in the lessons we discussed red constant is important, surface area is important, initial pH, salinity, all these things are important. So how do they change the dissolution process if we change these numbers? So in every question of these, I ask you to change these numbers and compare three different cases in terms of how things are different with different sets of parameters. And then the question one is about the false bar dissolution. So in example one, I give you everything about calcite. In question two, you are supposed to calculate to set a false bar dissolution using the figure 7 in Bloemt and Stirling with the rate dependence on H plus or H minus or the neutral one without any pH dependence. And you should be able to set it up to run these simulations. All right, I think I'm going to stop here. And I hope you have fun playing with quench flow in setting up mineral dissolution precipitation. Again, this is in batch reactor. So imagine that you are doing a numerical experiment of the batch reactor. And you're putting calcite greens different green size. So you have larger, smaller, specific surface area and all that. OK, I'm going to stop by and hope you have fun here. And we can discuss later if you have questions. OK.