 OK, let's go through this example on aqueous complexation reaction. How to set this up? With zero dimension, essentially closed while make system in crunch flow. This is for lesson one in the aqueous complexation lesson. So let's just go through the example. We have a closed carbon system, as an example one, where we already talk about primary species, secondary species, what's the general principle of using picking primary species and secondary species. These are very important concepts. So here we have an example with a total inorganic carbon contusion equals 10 to minus 3 mole per liter. OK, TIC, 10 to minus 3 mole per liter. So essentially, you would have the question is, first of all, at the pH of the system is 7.0, what are the contusion of all involved species? We already talked about this. It should be a carbonate system. We should have hydrogen, OH minus, and all the three carbonate species, right? You should have carbonic acid by carbonate and carbonate. So the total contusion 10 to minus 3 pitches 7.0, let's set this up. OK, so again, I'm opening this folder. Let's open that folder. That's one kind of, for example. So again, you see the four different files that are required to have in all the round-up simulation. You have the executable, you have the library file, input file, and the database. So what I have here is a template, OK? So I have all the different, there's some keyword blocks already there. Let's put this title on lesson one, Equest Compressation. And then you have all these database files. It's already specified. These shouldn't be changing much. And the output file, when you have time dimension, notice here that in lesson one, because we only talk about reaction seven dynamics, there's no kinetics involved, so there's no need of involving the time dimension as well. So it's zero space dimension and no time dimension. It's a simple system you can get. So everything is at equilibrium because there's only equal complexation reactions, and these reactions are really fast. So we don't need output. To put anything in output, this is for when you have time dimension. We don't need discretization because this is used when you have space dimension. We also don't need boundary condition, initial condition, because we don't have either space and time dimension. All you need, we don't have transport, we don't have flow, we don't have pass media, no velocity. So all you need is putting in primary species and secondary species. So what are the primary species? We talk about the primary species are the building block of the system. And we need to be, is this need to be in this system that you have carbonate, you have CO2, the three CO2 species, you have the pH and everything. So you should have, let's say, you at least should have H-press. We always use H-press as primary species because it's so important. And we can also put because we need to put at least one of the carbonate species because otherwise you wouldn't be able to build up other species as a secondary species. So then you also have corresponding to the H-press, you should have hydroxide, you should have CO2, AQ, you also should have carbonate, these three species. Now you have five different species. So this is like the example that you were talking about, we were talking about in this example one, closed carbonate system, right? You only have these three species, three vaccines. You have five species in total, so then you have two primary species and three secondary species. And everything, all the second species can be expressed in primary species. OK, good. So in this, so we have all these species. Now it's saying that the question one is pH is 7.0. And we know the total in organic carbonate species is 10 to minus 3 more per liter. So let's look at what should we put in these. So we should have conditions, right? The units is more per liter instead of more per kilogram. We always specify, let's call that condition pH 7 maybe. Because later on we'll be doing other pH conditions. I think it's useful to have named the pH, the conditioning name with our variables. So pH is specified. When we specify pH, we can already specify the pH condition, the hydrogen ion condition, right? And another condition we need to do is for the other primary species, which is bicarbonate. And here when we specify bicarbonate, this should be already specified in total conditions. There are several choices in countries that you can use to specify what are different conditions. Let's just search condition to make sure. That's how I do geochemical condition. Anyway, let's see. I think we're almost there. It's all for the runtime conditions. OK, let's just let me just pull that. So this part, page 48, is talking about input by entry of primary species. You can look through what you're putting for the primary species. It has to be coming from the primary species block of the database, as we talked about last time. And the second species have it coming from the second species block. But you actually can specify for one of the carbon species. You can specify one of them. The code uses the basis switch technique. It can. You can pick any one of the carbon species at primary species. The code kind of know. And can translate between the different which one you choose primary and which one you use secondary species. So it's fine to either pick carbonic acid or bicarbonate or carbonate, even when in the database, bicarbonate is in primary species, while the other two are not in primary species. The code uses basis switching technique to switch between the two. So it's OK, as long as you want them. And believe us, too, I haven't found it. OK, let's see. And these are all about database that we talked about last time. Equal species. This is a page you need, page 65. So type of constraint for concentrations. Equal species. You can put, OK, so this table is useful. If you want to put a constraint for total concentration, let's say you want to put sodium concentration 0.001. You just put the total concentration. So you have to use it for when you have more balance on total equates or total equates plus or less soft concentration. So by default, it's total concentration when you specify. If you want to specify individual species concentration, then you should have a species after the number. So here it's saying the total concentration of sodium is 0.001. So the sodium when it's in water, it can be NA plus free species and also NA chloride or NA OH. But they add up to be 0.001. Now in the second choice here, it's essentially saying you would have NA. Only the free sodium have the concentration 0.001. And then other species are category-based on this. And they are equivalent constants. And then there is a species activity. You should specify sodium plus 0.001 and specify that's activity. So this difference. So if you have active coefficient equal to 1, these two wouldn't make much difference. But if you are in a highly concentrated solution, these two will make a difference. You can specify pH, a specific number like what we just did. You can also specify concentration in terms of the equilibrium with a gas phase. For example, oxygen, if you want to specify aqueous oxygen as in equilibrium with gas oxygen at the partial pressure of 0.00 atmosphere, this is what you do. Or if you want to equilibrate your primary species with a mineral, you can oxygen aqueous with a power 8. Or if you want to specify charge balance, you can do sodium charge that would ensure charge balance is specified. OK, charge balance is honored. OK, so this is what we do. And then here, other things, other these later, the menu talk about how it does these calculations. So let's go back to the input file. OK, so here, essentially, this is in the same format as, for example, here. That means we are specifying total concentration, which is consistent with the condition we're giving here, 10 to minus 3, more per liter, right? OK, so that's good. OK, so if we do that, then we should be able to calculate, don't need another condition. We only need one condition. That's good. All right, so let's run this. We know all these species are in the aqueous phase, are in the database, so we don't need to check that. Let's run that. So we'll be putting in one lesson, example 1.input file. Constitution units not recognized. OK, looks like we have units more. Let's just check on that again. We have, in the condition, we have more per liter. And so I search units, and it jump to Constitution units. Right, so there's different Constitution units there. So it should be always more per liter, or million more per liter, or micro more per liter, or PPM. So more per liter is not there, right? So this is how you, if things are not working, let's go back to the manual again to see where it went. So we have to do more per kilogram of water. Now, in dilute solution, it doesn't really matter if it's more per liter or more per kilogram water. It's the same thing. But if it's very concentrated, then you might need to do some conversion based on the activity coefficient and all that. It based on the density, right? OK, here, so let's say we change it back to more per kilogram, which is almost a meter per liter. Note here, in dilute solution, which is what we have here, the more per kilogram approximates per liter. If it's a concentrated concentration, this liter water versus the kilogram water is different. So you need to use a density to convert between the two. All right, let's see. Let's run again. pH 7.1, initialization condition. Speciation of initial and boundary condition successful completed. No equis kinetic rock fund. And Z. OK, so that's what happened when you have no initial condition. OK, so let's specify. This means you will need to specify a discretization. Let's try that. OK, this is how you run. You have no guarantee that you always get the right answer until you have, for example, you are really familiar with the code. Sometimes you still make mistakes. So this is how you use it and learn. And I'm trying to show the process of this. So eventually, we'll get to it. How we can get that run. So discretization. Let's say you need to put one. For equilibrium solution, let's say we put units. We need to put this condition in the initial condition. Then it will be do the speciation. All the other way to do it is specify this is only going to be speciation only. Let's do that. Let's just make sure we are running the right thing. Interesting. They might change the code. Let's see. Different from previous version. Used to be a speciation only keyword. See, there's a speciate only. OK, that's what. So let's say this is going to page 4.2. You can go through in TableCon as a list of all the keywords. So this is another way of getting fast hold of the keyword you need. Because so example we have is only some dynamics, no time stepping. So you really don't need the initialization. So let's say we put a speciate only with true. So then it should be running just a speciation reaction without the necessary setting up initial condition and everything. Let's try that. OK, it's completed. I mean it's run. So always when you have input file, you have the same. So it will be another corresponding output file. This is I talked about before. It's kind of anchoring what has been done, leading in the system. And actually for just equal speciation reaction, this is essentially the initialization process, going through the initialization process. And for just equal complexity, because we don't need time stepping, this is all it does. It reads in the total condition, reads in, for example, the pH temperature, just decide which one the code will be, what condition, in temperature, pH condition. And then it's calculating the condition of all the individual species. Now if you look through this, OK, these are the discriminant and everything. It reads in number of components, which is the primary species. Number of second species are three. Number of gas, number of kinetic energy, we don't have all these. And it reads in the log k value of these equal speciation reactions. So for all each, with each process, log k is 13.99. So you want to make sure the log k value that it reads in is correct. If it's not correct, then you need to make sure they are the right number. So here, it has a condition, it reads in, it reads the primary species by carbon. And then it has the gas, it's the code needs initial gas to start the simulation. Total concentration constraint phase, right? So total concentration by carbon is it. So it reads in everything correctly. And then it does the speciation geochemic conditions. So speciation process is part of the initialization. Now it anchors all the geochemical conditions you have. Temperature, we didn't specify the process. So it defaulted to 1. Situations, 1, liquid densities. Is this solid density, no, ionic strains. Solution pH is 7. Total charge is this. So if you want to specify, here we didn't really specify a charge balance. We can specify a charge balance if you want. We can do it in another example. OK, then the code essentially calculate the individual species, right? Log activity, activity. H plus by carbon in OH minus. So it has a molarity of the different species. The activity, all these are pretty close to 1. Carbon is relatively small because it has two charges. So it's relatively small. Everything else is very close to 1. It has activity. So now you can answer the question seeing how much what is the concentration of individual species. That answers the question 1 in the example. OK, so second question is asking you to do contributing all individual at pH from 2, 6, 7, 8, 9. So essentially, it would be very similar to what you have in question 1, except that you are going to do different temperatures or different pH conditions. So one way you can do it is you copy the condition and specify 2.0, for example. Then here you should have 2.0 instead of 7.0, 4.0, 6.0, and here should be 4.6. OK, so we have all conditions. Essentially, you do this in one file, which is convenient. So everything else is the same. Only the pH is different. So if you run it again, you will see the effect of pH. Now when we do this run this again, it was a new output file. We replaced old output file. But we still have that condition for 7.0 there. So this output will still be there. So it should have give you each suspicion of each condition. It's essentially reading all the different conditions. And then 7.0 is first and it's there. It's calculate 7.0. And then you have condition 2.0, 4.0. So here you see pH is this. You have another set of concentration and everything. You have another set of concentration. So it essentially gives you the concentration of different species under different pH conditions. And you can put the numbers out in either Excel file or whatever to plot what is asked for pH as a function, this as a function of pH. Now what if the plot is as a function presents as a question 3? And you can see under what pH condition do these different species dominate. Now what if we try to run this with charge balanced? You can see that in that condition, charge is not balanced. So let's do pH 7.0. Let's just do another example. Instead of specifying, let's call that pH 7.0 charge. And maybe you will see. You can almost see from the output right now at 7.0. So total, if we do not specify charge balance, it's a negative charge. That means in order to have charge balance, you need to make a positive charged species to do the charge balance, to kind of balance out this. So instead of doing by come, we should do the pH calculated from charge balance. Let's try that. And same thing for other situation. If you want to make sure charge is balanced, you need to make sure that it's the right species, either positive charge or negative charge in order to balance. And how you get the clue is from when you did not run the charge balance, what is the total charge? Come, is that positive? For example, pH 2.0, if you do charge balance, you need to use. This is already a positive charge. So you need a negative charge species to make charge balance, for example. So then when you do pH 2.0 for charge balance, you need to put an example there. Then you should put, let's call it again, charge. And then you should have bicarbonate charge because it's positive charge already. OK, let's run again to see how it works. I'm curious how that will come up with. OK, so and again, let's just look at the top two. 7.0, you still have this. And then when you have 7.0 charge, you see now the total charge is very small, so charge is more or less balanced. Now the solution pH will have to be almost 4.7 In order to have total carbonate being in the concentration of 10 to the minus 3, you have to have a solution pH of 4.7 to balance it out, which is very different from 7.0. And of course, then the concentration of the different species will be also very different. Hydrogen, H plus, H minus bicarbonate, carbon, they are all very different now. And if you look at the pH 2, is this. And with the pH 2 charge, again, this is much smaller number than the previous one, you will need very, very high concentration of carbonate in order to have charge balance with the pH 2. Because at pH 2, it should be the carbonic acid being dominating species. And you don't have that. And so you need bicarbonate and carbonate to charge it, to maintain charge balance. And these concentrations are very small. So in order to balance it, you need to have very, very high concentration of organic carbon or bicarbonate to balance it out. So in order to have that, you need a very high total in organic carbon. So that is what this is, this is very high, unrealistic high concentrations. So this essentially is almost like a thing. At some point, at pH 2.0, it's very hard to get the concentration of pH 2.0 in a system that you only have organic carbon species. All right, so I think that we are good with this example. So the take home practice one, essentially asking you to add calcium in the submersion and answer this question. I think it would be an interesting exercise. One, just to give you a hint, the only thing you need to do is having another total calcium concentration. And you can specify and you put this. I'm going to change it to make you have it to be charge balanced. And you need to make sure charge is balanced in the system. So that's through this. And then you have another homework assignment with question one, question two, with different. So question one is still the carbon system with an open system. So you have PCO2 of this. So you can look at it in the manual of different constraint. You should make it with CO2 gas in the 10 to minus 3.5. And then your question two is for mental complexation in seawater. And you can specify different species and everything. Make sure you check which second species might be dominant. OK, so I think this is for now. And I'm going to close that. And we can talk about it again once we finish the homework. This should give you enough exercise to work on it. This finishes lesson one.