 OK, let's talk about the crunch flow. So this short video is supposed to be orientation for crunch flow. I introduced in the lesson, in the orientation lesson, that there are a lot of other reactive transport codes, like besides crunch flow, you have tough react, P fraud chain, freak C, geocampsic workbench. Different reactive transport has a bit of different flavors, but they all kind of solve the same, similar mass conservation equations for different species. So the backbone of different reactive transport codes are the same, but they have different solvers. They could have different computational speed because of the use of different solvers, or also using different solvers, they could have different convergence capabilities. So the way it's numerical solved, it could be very different. And that directly determine how fast things are going to run in your system. I choose to teach crunch flow for several reasons among all these other reactive transport codes, mostly because I think it's very flexible in terms of setting up in profile. At the beginning, the learning curve might be a little bit, you might think it's a bit short because of the, it's not a gooey interface. It's not graphic. And you might not use to text file and opening up these executables. But once you get used to it, and this allow you a lot of flexibility to run things and putting things that are much faster than a lot of other reactive transport codes does. And also, it uses advanced solvers like this PESI package, which has a lot of fast solvers. This PESI package is developing one of the national lab, I believe it's Agung. If I remember correctly. So it runs fast, and it tends to be robust. It usually don't get into non-convergence problem unless your system is ill conditioned. Or there's a bit of somewhere, there's a bug there. But then it also is very flexible in terms of setting up a heterogeneous system. Like if you have different low-permission, high-permission, some mineral in somewhere that is more abundant in another location and less abundant, you can actually express it set up in CrunchFlow, which I think it's the biggest advantage for CrunchFlow. So in order to be able to run CrunchFlow, you need actually, so in this class, I put all the different executables on the cost website. There's also the menu file. There's a folder of CrunchFlow exercise, which has a lot of different files there. That cost default when he taught CrunchFlow short causes before he tend to run these executable files, use these exercise files. So this, you can see the exercise in addition to what we teach here. And if, at the end, we are running your project, you will be looking for things that you can use. And this exercise could be a very nice complementary in terms of adding additional examples and template input file for you to use. So I think when you do, in this class, is when you try to learn CrunchFlow, you should use the menu frequently. You can search for the keywords and look at the explanation. You don't have to read everything at the beginning, because I think that doesn't, if you do that, the informator doesn't register as much, because you haven't got much of a handle on understanding the code yet. So I always advertise, learn it when you use it. I think that's where the information register the best. So what I have here is a folder that has four files. So executable CrunchTope 64-bit for the Windows system I have. There's a DLL file, there's the input file, and DBS file. So these four files are the necessary file for you in order to run the CrunchFlow in a folder. You can actually set up exactly in the system to make it run default without copying to different folder. But for now, let's just keep it simple and keep it in this folder. So we have this executable, which is the newest family of the CrunchFlow executable. It actually, its reason is called now, it's called CrunchTope, because it actually incorporates isotope geochemistry. So the code should be able to run isotope fomeration and everything. This DLL file is a library file. So seeing it happens, how the code does is when it's solving the equations, it actually calls some dynamic library. So this library file is necessary in order for the code to finish. And then you have the input file and the database file. So we are going to introduce these two files a bit, just to introduce a structure of it. I'm not going to talk about in detail, but just give you kind of a sense of what's going on. And then in the later lessons, or most of the keywords will be introduced. And you learn by working on exercise and examples. So the input file is mostly divided into keyword blocks. For example, here you have title, block which you can have in a name and introduce what is this input file about. It's a good record keeping. Every keyword block, typically try to differentiate keyword block name and keywords. So you use the capital to indicate the keyword block names. So it's easier to see. And each keyword block should end with the end, like what we have here. So typically, this is for flow and transfer in 1D system. So there's multiple keyword block here. There's runtime, there's output discretization and all that. Today, I probably would just introduce the runtime mostly. A lot of these keywords are not really it's related to a numerical solution process. Typically, I don't suggest changing it early on because you might whatever default that you use it. One thing that's sometimes useful is this is specify the solver, just name the solver. So there are several different solvers if you look up in the menu. There are several different solvers you potentially can change one to the other if you have, for example, non-convergence problem at some point. So the PC, PC, left, they are all explained in contrast. So typically what I do it, I tend to kind of open the menu when I learn it. I tend to look at all that and try to learn what it means when I'm using that, for example. PC level, PC level. So it explains, the menu explains what it means and everything so you can dig into that and do things. And one thing that is important to keep in mind is for, in order to put in comments, for example, there's line you want to put in, explain what that number is from and what it means and what are the units and everything. You can use command line starting with this exclamation mark. You cannot do exclamation mark in the middle of line for them doing this. This code is not going to recognize. So you always need to start a new line with starting with exclamation mark to do comments. So the code will be kind of actually read that as a text, not as a keyword. One thing that's important to keep in mind is your database file, the name of database file need to be exact the same as the name of the database file in the same folder. For example, here we have data.com.dps. You should put that there. If you put another name there and then you don't have that database in this folder, then it's not going to run. Or if you have multiple databases in the same folder, you need to specify which one you are going to use. These are the different ways of solving. So screen output is the number of steps that you will skip before the screen actually have an output. If it's one, it's putting out every time step. If it's 10, it's putting out every 10 time steps. And there's output to keyword blocks. You can put in time units like minutes, seconds, hours, et cetera. This is a time. You can put several times. You want to see the snapshot of the system. And the last one is how long the system is going to run to. So in this system, it's going to run to 250 minutes. Time series is where you want to have, for example, in a particular grid block, you want to have a time series from time beginning to the end of the simulation. You want to see how the contrition for example means that grid block evolve over time. So that's the name of the output file that is going to have that information. And this specifies which grid block you want to have that time series. You can do multiple time series with different names and different grid blocks. And this time series will determine how fast, how many, like every one, so every time step, so the code is going to write on the breakthrough curve. If you want it to be output every time, every 10 times times that fine too, then you make the submission as a file, breakthrough file, a bit smaller, because you have less output. Anyway, so these are the output. I'm not going to introduce everything else in the system because we will be introduced in detail all the keyword block in one lesson on 1D physical processes with advection, diffusion, dispersion process. So I'm going to leave these to there for the introduction of these blocks. So all we teach is more or less kind of get familiar with the keywords for each different process that we do need to do in order to setting up this meaning for it and making sense. Now before we close, let's talk about the database. So this is the data.com. This is a long file and it's borrowed from EQ3 database, essentially. It started with a line called temperature points. So these are eight different temperature points. If you want to understand the details, for example, there's eight different temperature points. These are for different degree Celsius. So there's log cave later when we talk about the reaction, different reactions. There are eight different cave values corresponding to the eight different temperatures, which is already down in the EQ3 six. So if you are specifying for going to temperature, it is 150. So code is going to read the log cave value for the different reactions from the fifth number, not from the default 25 degree Celsius. That's what it is for. All right, so that's a temperature point. These are the Debye-Hacko coefficients because the code used Debye-Hacko equation to calculate the coefficients. And then after Debye-Hacko block, you have from starting from water to should be at the end of primary. So the answer from up until here, it's a list of primary species. And each primary species have three parameters there. The first one is a Debye-Hacko parameter that you can use for that species. This is charge, and this is molecular weight for all the different primary species. So you can actually add in your own primary species if you either artificial makeup and elements or something. So sometimes you need to manipulate code to do something that you want. There should be a presence in the primary species because the primary species is essentially the building block of the system. So after primary species, you would have starting from the line following the end of primary, you would start to have the secondary species. So all these secondary species are written, for example, like this. Let's see, let's look at HS. So for the relevant primary species, for the sulfide species is a sulfate. It didn't exist in this database. You actually can put in another sulfide if you want. But here it's actually the primary species here is sulfate. So there's no sulfides there. You can do the sulfide species when you give it another name. So you can specify the sulfide species as written in terms of redox reaction with oxygen. So a sulfide becomes reduced to become sulfide. Or HS plus O2 gas to become sulfate being oxidized. Let's look at another maybe bicarbonate or something. So for carbon, let's look at carbonate. For carbonate species, what do you specify in the system is CO2? There should be a CO2, let's see. Let's search for. Oh yeah, there's a bicarbonate there. So the bicarbonate is the primary species. And then everything else, for example, the CO2-AQ or bicarbonate should be written as bicarbonate. So here when it's, so let's look at this line specifically. This is essentially writing CO3 carbon species. It involves two different species. One is hydrogen ion. The other is bicarbonate. So if you write, it will be CO3 minus minus plus. When it's minus, meaning it's in left-hand side of the equation. Plus H plus equals to bicarbonate. So the prime species need to be in the right-hand side. And what are these? So these should be the equilibrium constants. These are the right equilibrium constants. It's the equilibrium constant for following the way that the reaction is written. So it's saying bicarbonate species can be bicarbonate. If you write it that way, it will be 9.6 log K. This is log K value. So this is not 10.0, which means it's at a different temperature. And it's using the same value. So it's not corresponding to a temperature. So if you want to look at the temperature effect, every reaction you, when later when you're writing, you will need to specify. If you are actually running high temperature, you want to look up these numbers to make sure this number in database is correct just to confirm that sometimes these databases are changed by people. So you want to make sure these numbers are right because these are very important numbers. If we look at CO2, AQ is essentially in CO2. AQ plus water equals to H plus and bicarbonate. So there's three species involved. And for this reaction, you have log K equal to at 0 is minus 6.58. And at high temperature, it keeps on decreasing. So this set of numbers make sense. But you still want to check. Every number you use and you end up using in the modeling process, you want to check these numbers. So 3.0, again, is a Dubai Haku. So this three number is essentially like the same three numbers as you see in the primary species, you see Dubai Haku, parameters, charge, and the molecular weight. So that's a list of second primaries. So it should be, and as I do control F, I will see end of secondary. So it will say end of second. Then this is toward the end of a second species list. Everything is written in second species. It's written in primary species. And then you see a block of everything with the G. Process G means the gas phase. So all the gas phase are listed here. And then there should be end of gases. Here's the end of gases. And then after that, after gases, you would have all these mineral phases. So you can see the different reaction, let's search for calcite. So again, for the calcite, you have molecular weight. So we're actually rooting into two species. This is a stoichiometric coefficient, right? One chasium and one carbonate. And again, you have these other log K. Again, here, the value is not necessarily right because you have all the same. But I believe this number should be the log K equals, at 25 degrees Celsius. For the mineral phase, you only have molecular weight. You don't have to buy HACO and charge because these are not in the water for the aqueous phase. So each mineral is written this way. So if you go to end of minerals, this ends as the end of mineral phase. And then it will begin the sulfate complexation session. Specify the weight of the sulfate complexation is written as well as, again, this is a reaction. And then there's a log K value in different conditions. Every time you see all the 500.000, these are numbers that are kind of dummy numbers that you put in because you don't know what number to use. So this number means if you are looking for them. So that's this in here. We know that the 25 degree Celsius log K for this reaction is 8.82. But for all other temperatures, we don't know. So if you need to use these at other temperature, you need to look it up in the literature. And then this ending, end of sulfate complexation. Now, the other thing I want to point out is there's also sulfate complexation at the end. So there's a begin sulfate complexation parameters that give you the charges of the different sulfate species. So these are the actual surface charges of the surface reaction that directly relates to sulfate complexation. OK, so this is sulfate complexation. Then you have aqueous kinetic block and then mineral kinetic block. Again, I always suggest that you will be looking up literature for real numbers. For example, let's say here you are specified. Let's look at calcite again as an example. So for example, calcite here is specified several different in several different blocks for different weight loss. So everyone has a label. In this block, the label default. And you are actually looking at this reaction and with dependence on H plus. Here it didn't specify dependence. So it should be there's no dependence here. Like here, it will be dependence on active H plus raised to 1.0. And this is rate constants, activation energy, the type of rate load used and all that. And for the other one, for this one, you are saying it depends on CO2AQ to the 1.0 and for the calcite distribution reaction. So for example, somewhere else, you also write paride, oxidation reaction, and you have all these. So you can also, in the implied, put the rate constant like this. So if you put an implied rate constant, then it's going to ignore what you have in the database and use the one in the input file. Anyway, so that's for the mineral kinetics. And if the mineral that you are interested in is not already there, you can add another block specifying all these numbers. And as long as you specify, for example, the minerals, is part of the mineral list. If you have a new mineral that is not in the list of minerals, you can add that in in the mineral list, which specifies the reaction is locate values for that mineral. And then you add another mineral block for the kinetics here. OK, so that's for the mineral kinetics. And then you would have the exchange block, which specifies, you can specify multiple site ion exchange or a single site ion exchange. These are specified essentially. Again, the reactions for the half ion exchange reaction and the exchange coefficient. So at the end, you have this. After this, the later parts, you have some numbers or whatever there. These tend to be seen for them. If you want to move around a little bit, you can temporarily start there. So you can more or less ignore these if you want. I could just remove all that. OK, so let's do just a run. So what you do is when you try to run CrunchFlow, you click on that executable file, and then you will be putting the name. It will ask for the name of the input file, transport1d. You always have your input file in .in so that the code can recognize this is the input file. OK, now after this, you see a lot more file. Because with all these, so you should look at the extension. All the output file are the output. So because I specify in the special profile one time, it will be output at that one time for all the different velocity, for the total concentration, which we'll be talking about later, total concentration, speciation, pressure, gas, concentration, and there's also an isotope file. So in any case, and also a breakthrough curve because I want this, but it's an outlet time series. So you will see a lot of these output files. If you change your input file at this point, let's say it's changed some number, and rerun again here, the new output file will replace the old output file. So if you want to keep a record of both, you need to have another folder to run the simulation in order to be able to still have the record of each. Otherwise, it's going to be overwritten. And if we look at, let's look at transport 1D out, it's essentially kind of echo what has been ready. It's essentially going through the file to see the input file and kind of keep a record of what has been ready. And then it says, at the end, it says, OK, I'm going to start initialization completed starting time stepping. So sometimes if the code has stopped running in the middle or something, you can look at this file to see if everything has been written in correctly. If not, that means there's something wrong in your input file. Another thing to keep in mind is in your input file, you're not supposed to use tab. You have to use space, too, if you want to kind of things lay out nicely and everything. Or with use, don't use tab. The code doesn't recognize tab. Let's look at the breakthrough. OK. So here, what we specify as a specific bromide. So this is essentially for that gray cell, which is at the outlet. You have time, you have bromide concentration. This is, so early on, they run very, because I put one or something for time interval, so it run every time. So early on, it's like starting from 10 to minus 10 minutes. It's essentially initial continue. You don't have any bromide. And then in the input file, in the inlet, you inject input files as a bromide country. So it starts to have high and high concentration at some point later. So the inlet concentration is this. The inlet concentration is this. So at somewhere, for example, around maybe 100 minutes or something, you start to have something come out and then eventually you have these concentrations stabilized to the end. So this is a system of just transport. And these should be the log concentration. This is concentration bromide in log concentration. So this runs. And if you need to end this concentration to the concentration for this non-racial species, it's not really important. So I'm going to stop here. And hopefully you have a bit of sense of what's going on. Several things that you should remember is you always need the executable file, database, input file, and the library file to run the simulation. And the control menu will be your good friend in this class. Besides the reading materials, you will learn about the general principles. I'm going to stop here. So from lesson one, we'll introduce for individual processes what are the important keywords and parameters. Then we'll go through exercises and then run some simulations to do homework to kind of re-emphasize what you have learned in class. All right, that's what we have for.