PNG 550
Reactive Transport in the Subsurface

1.3 Setting up CrunchFlow for aqueous complexation in closed, well-mixed system

PrintPrint

In this subsection we will discuss setting up aqueous complexation calculations in CrunchFlow.

Example 1.1 RTM setup

We have a closed carbonate system as an example 1.1 with the total inorganic carbonate concentration (TIC) being 10-3 mol/L. Please answer the following questions:

  1. What are the equations to be solved in this system?
  2. If the pH of the system is 7.0, what are the concentrations of all involved species?
  3. Calculate the concentrations of all individual species at pH varying from 1~14, with pH interval 2. That is, calculate concentrations of all individual species at pH 2, 4, 6, 8, 10, 12, 14.
  4. Plot TIC, H2CO3, HCO3-, CO32-, H+, and OH- as a function of pH.
  5. Observing from the plot, under what pH range H2CO3, HCO3- and CO32- dominate, respectively?

Assuming this is a dilute system so that the values of activities are the same as concentrations. If we do not impose the charge balance condition, the code solves the following 5 equations for the 5 species questions 0):

$$\begin{array}{l}
K_{a 1}=\frac{C_{H^{+}} C_{H C O_{3}^{-}}}{C_{H_{2} C O_{3}^{0}}}=10^{-6.35} \\
K_{a 2}=\frac{C_{H^{+}} C_{C O_{3}^{2-}}}{C_{H C O_{3}^{-}}}=10^{-10.33} \\
K_{w}=C_{H^{+}} C_{O H^{-}}=10^{-14.00} \\
-\log _{10} C_{H^{+}}=7.0(\mathrm{pH} \text { is } 7) \\
C_{T}=1.0 \times 10^{-3}=C_{H_{2} C O_{3}^{0}}+C_{H C O_{3}^{-}}+C_{C O_{3}^{2}}
\end{array}$$

If charge balance is imposed, with the following equation:

$$C h \text { arg } e \text { balance: } C_{H^{+}}=C_{H C O_{3}^{-}}+2 C_{C O_{3}^{2-}}+C_{O H^{-}}$$

Then either the pH condition or the TIC condition should disappear so we do not over condition they system (6 equations for 5 unknowns).

Please watch the following 37 minute video, Lesson 1, Example 1

Click here for a transcript of the Example 1 video.

PRESENTER: Let's go through this example on aqueous complexation reaction, how to set this up with zero dimension, essentially a closed, well-mixed system in CrunchFlow. This is for lesson 1 in the aqueous complexation lesson.

So let's just go through the example. We a closed carbonate system as an example one, where we already talked about primary species, secondly species, what's the general principle of picking primary species and secondary species. These are very important concepts.

So here we have an example with a total inorganic carbonate contraction equals 10 to minus 3 mole per liter. TIC, 10 to minus 3 mole per liter. So essentially you would have, the question is, first of all, the pH of the system is 7.0, what are the concentrations of all involved species? We already talked about this. A carbonate system, we should have hydrogen, OH minus, and all the three carbonate species. You had you should have carbonic acid, bicarbonate, and carbonate. So the total concentration is 10 to minus 3 mol per liter. Let's set this up.

So again, I'm opening this folder. Let's open the folder. Lesson 1, CrunchFlow example. So again, you see the four different files that are required to have in order to run the simulation. You have executable. You have the library file, input file, and database. So what I have here is a template. so

There's some keyword blocks already there. Let's put this title lesson 1-- aqueous complexation. 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 1, because we only talk about reaction 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 as simple a system as you can get.

Everything is at a equilibrium because there's only aqueous complexation reactions. And these reactions are really fast. So we don't need output to put anything output. This is for when you have time dimension. We don't 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. We don't have transport. We don't have flow. We don't have no porosity.

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 blocks of the system. This needs to be, in this system that you have carbonate, you have the three CO2 species. You have the pH and everything. So you should have, let's see. You at least should have H plus.

We always use H plus 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 plus, you should have hydroxide. You should have CO2 aq. You should have-- and you also should have carbonate, these three species.

Now you have five different species. So this is like the example that we were talking in this example one, closed carbonate system. You only have these three reactions. You have five species in total. So then you have two primary species and three secondary species. And all the secondary species can be expressed in primary species.

So we have all these species. Now it's saying that the question one is pH is 7.0. And we know the total inorganic carbonate species is 10 to minus 3 mole per liter. So let's look at it what shall we put in this. So we should have conditions.

The unit is mole per liter instead of mole per kilogram. Let's call that condition pH 7, maybe. Because later on, we'll be doing other pH conditions. So I think it's useful to have the condition named with our variables of pH.

When we specify pH, we more or less can already specify the pH condition, the hydrogen ion concentration. 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 concentration.

There are several choices in controls that you can use to specify what are different Let's just search condition to make sure. That's how I do geochemical condition. Let's get to the point. Let's see. Are there lots of conditions. Can't believe it. I think we're almost there. These are for the runtime conditions.

So this part, page 48, is talking about input file 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 secondary species has to be coming from the secondary species block.

But you actually can specify, for example, one of the carbonate species, you can specify one of them. The code uses a basic switch technique. You can pick any one of the carbonate species as primary species. The code kind of knows and can transfer between are different-- which one you choose primary and which is secondary species.

So it's fine to either pick carbonic acid or bicarbonate or carbon, even when in the database, bicarbonate is in primary species while the other two are not in primary species. The code uses basic switching technique to switch between the two. So it's OK as long as you choose one of them.

Can't believe I still haven't found it. Let' see. These are all of our databases that we talked about last time. Aqueous species. This is the page you need, page 65. So type of constraint for concentrations, aqueous species. So this table is useful.

If you want to put constraint for total concentration, you can just-- let's say you want to put sodium concentration 0.001, you just put the total concentration. So you have the uses for when you have more balance on total aqueous or total aqueous plus absorbed 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 with sodium is 0.001. So the sodium, when it's in water, it can be Na plus 3 species and also Na carbide or NaOH. 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 has the concentration 0.001. And then other species are calculated based on this and their equivalent constants. And there's species activity you should specify sodium plus 0.001 and specify that's activity. So this differs. 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 the gas phase. For example, oxygen, if you want to specify aqueous oxygen as an equilibrium with gas oxygen at partial pressure of 0.20 atmosphere, this is what you do.

Or if you want to equilibrate your primary species with a mineral oxygen aq with pyrite. Or if you want specified charge balance, you can do sodium charge. That would ensure charge balance is specified. Charge balance is honored.

So this is what do we do. And then here, other things later that mainly talk about how it does these calculations. Let's ignore this. So let's go back to the input file. So here, essentially, this is in the same format as, for example, here. So that means we are specifying total concentration, which is consistent with the condition we're given here, 10 to minus 3 mole per liter.

So if we do that, then we should be able to calculate-- don't need another condition. Only need one condition. That's good. 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 round that. So you'll be putting one lesson example 1.5.

Concentration unit not recognized. Looks like we-- Let's just check on the In the condition, we have mole per liter. And so I search units. And it jumped to concentrations units. So there's different concentration units there.

So it should be always mole per liter, millimole per liter, or micromole per liter, or PPM. So mole per liter is not there. So if things are not working, let's go back to the menu again to see where We have to do mole per kilogram of water.

Now in dilute solution, it doesn't really matter if it's mole per liter or mole 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 based on the density.

Here, so let's say we change it back to mole per kilogram, which is almost Note here, in dilute solution, which is what we have here, the mole per kilogram approximates mole per liter. If it's a concentrated concentration, this liter water versus kilogram water is different. So you need to use a density to convert between the two. Let's see. Let's run again.

pH 7.1, initialization condition. Speciation of initial boundary condition successfully completed. No aqueous kinetic block found. NZ. So that's what happens when you have no initial condition.

So let's specify, this means you will need to specify a discretization. Let's try that. This is how you run. You have no guarantee that you always get the right answer until you, for example, are really familiar with the code. Sometime you still make mistakes. So this is how you use it and learn. And I'm trying to show the process so eventually we'll get to it, how we can get it run.

So discretization, let's say you need to put one. For equivalence, it shouldn't really matter. Let's say we put units of-- you will need to put this condition in the initial conditions. And we do the speciation.

Or the other way you 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. Hm. Interesting. They might change the code-- let's see-- different from previous version.

There used to be a speciation only keyword. Speciate only, that's what. This is going to page 42. In the table is a list of all the keywords. So it's another way of getting fast hold of the keyword you need.

The example we have is only some dynamics, no timestamping. So you really don't need the initialization. So let's say we put speciate only with two. So then it should be running just a speciation reaction without necessarily setting up initial condition and everything. Let's try that. It's completed. That means it's run.

So always when you have input file, you there will be another corresponding output file. I talked about before, it's kind of anchoring what has been done the system. And actually for just aqueous speciation reaction, this is essentially the initialization process, going through initialization process.

And for just aqueous complexation, because we don't need timestamping, this is all it does. It's reading the total concentration, reading the pH, temperature, decide which one occurred, what condition in terms of temperature, pH conditioning. And then it's calculating the concentration of all the individual species.

Now if you look through this, these are the everything. It reads a number component, which is the primary species. Number secondary species is three. Number of gas, number of kinetic mineral, we don't have all of these. And it reads in the log K value of these aqueous complexation reactions.

So for OH it's with H plus. Log K is 13.99. This is CO2. So you want to make sure the log K values they're using is correct. If it's not correct, then you need to make sure they are the right number.

So here is I've conditioned it It said primary species are bicarbonate. And then it has the gas. The code needs initial gas to start the simulation. Total concentration constraint phase, so total concentration bicarbonate So it's reading everything correctly.

And then it does the speciation geochemical conditions. So speciation process is part of the initialization. Now it anchors all the geochemical conditions you have. Temperature, we didn't specify a porosity so the defined is 1. Saturation is 1. Liquid density, is this solid, answer no. Ion exchange 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 we want. We can do it in another example. Then the code essentially calculates the individual species, log activity, activity, H plus, bicarbonate, OH minus. So it has molarity of the different species. The activity, all these are pretty close to one.

Carbon is relatively small because it has two charges. So it is relatively small. Everything else is very close to one. It has activity. So now you can answer the question seeing how much were these concentration of individual species. As I said, answer the question one in the example.

So second question is asking you to do concentration of all individual at pH from 2, 6, 7, 8, 9. So essentially, it will be very similar to what you have in question one, except that you are going to do 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-- OK, I'm sorry. 4, 6, 10, 12, and then 14.

So we have all the conditions. And essentially, you do this is one file, which is convenient. So if everything else is the same, only the pH is different, so if you run again, you see the effect of pH. Now when we do run this again, a new output file would replace old output file. But we still have that condition for 7.0 there. So this output will still be there. OK. It's done.

So it should have given you the speciation of each condition. It's essentially reading all the different conditions. And then 7.0 is first. And it's there. It calculates 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 concentrations.

So it essentially gives you the concentration of different species under different pH conditions. And you can pull the numbers out in either Excel file or whatever to plot what is asked for this as a function pH.

Now what if the [INAUDIBLE] the function [INAUDIBLE]? That's question three. And you can see under what pH conditions 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 the pH 7.0 charge. And maybe we will see. You can almost see from the output right now at 7.0, 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 positively charged species to do the charge balance, to kind of balance out this.

Instead of doing bicarbonate, we should do the pH calculated from charge balance. Let's try that. And same thing for other situations. 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? is it positive?

For example, pH 2.0, if you do charge balance, you need to use-- this is already positive charge. So you need a negative charge species to make charge balance. Then when you do pH 2.0 for charge balance, you need to put this for 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. Let's run it again to see how it works.

Look at output file. I'm curious how that will come up with-- so and again, all this. Let's just look at the top two. 7.0, you still have this. And then when you have some 7.0, you see now the total charge is very small. So charge is more or less balanced.

Now in the solution, pH will have to be almost 4.7 in order to have total carbonate being in the concentration of 10 to minus 3. You 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, OH minus, bicarbonate, carbon, they are all very different now. And if you look at the pH 2, it's this. And with the pH 2 charge, again, this a much smaller number than the previous one. You will need very, very high concentration of carbonate in order to have charge balance with a 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 carbon 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 inorganic carbon or bicarbonate to balance it out. So in order to have that, you need a very high total inorganic carbon.

So that is what this is. This is very high, unrealistically high concentrations. So this essentially, it's almost like saying at pH 2.0, it's very hard to get a concentration pH to 1.0 in a system that you only have inorganic carbon species. So I think now we are good with this example.

So there's a take-home Practice One essentially asking you to add calcium in the simulation and answer these questions. I think it'll 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 charged balanced. And you need to make sure charge is balanced in the system.

So let's do this. And then you have another homework assignment with question one, question two. So question one is still the carbonate system with an open system. So you have P-CO2 of this. So you can look at the manual different constraints you should make it with CO2 gas in the 10 to minus 3.5.

And then the other question two is for metal complexation in seawater. And you can specify different species and everything. Make sure you check which secondary species might be dominant

So I think this is it for now. And I'm going to close that. And we can talk about it again once you have finished the homework give you enough exercise to work on it. This finishes lesson 1.

Credit: Li Li @ Penn State University is licensed under CC BY-NC-SA 4.0

Take home practice 1.1 RTM Set up

We have a closed system with total inorganic carbonate concentration (TIC) being 10-3 mol/L and the total Ca(II) concentration (summation of all Ca-containing species) being 10-4 mol/L. This is the same system as in the example with addition Ca2+, CaHCO3-, CaCO30 species. 

  1. What do you think are the equations that are solved in this system? 
  2. If the pH is 7.0, what are the concentrations of all involved species?
  3. Calculate the concentrations of all individual species at pH varying from 1~14, with pH interval 2. That is, calculate concentrations of all individual species at pH 2, 4, 6, 8, 10, 12, 14 (Hint: for each pH, you will need to have one "condition" block in the input file).
  4. Plot TIC, H2CO3, HCO3-, CO32-, H+, and OH-, and Ca(II)-containing sepcies as a function of pH.
  5. Observing from the plot, describe the top 2 dominant species under each pH condition.

Example 1.1 Files

Practice 1.1 Solution