Click here to donate to keep PhreeqcUsers open
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Forum Home
Login
Register
PhreeqcUsers Discussion Forum
»
Processes
»
Reactive transport modelling
»
Advection simulation in IPhreeqc+C language
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: Advection simulation in IPhreeqc+C language (Read 833 times)
Yushan GU
Contributor
Posts: 1
Advection simulation in IPhreeqc+C language
«
on:
July 25, 2022, 09:19:51 AM »
Hi Dr. Parkhurst,
I am currently learning to use IPhreeqc in C to simulate the advection of groundwater into a concrete material. Please help me with some questions:
1. In the example, advect.c, the advection is simulated by modifying the solution 2 with the solution 1. I am wondering what to do if we have 100 cells. From my understanding, the function "solution_modify" can be applied to one solution once. Could you please give me any suggestion how to transfer the solution 1 to 100 cells in a easy way?
2. Could you please tell me how to define the groundwater flow rate? I know in Phreeqc basic, the rate is calculated by cell length/time_step, the values of which are given in the function TRANSPORT.
3. A question similar to the second one: how can I define the diffusion parameters if needed. In the function TRANSPORT, the diffusion coefficients are given. However, I have no idea what to do in IPhreeqc.
Thank you in advance for your reply!
Best regards,
Yushan
Logged
dlparkhurst
Top Contributor
Posts: 3585
Re: Advection simulation in IPhreeqc+C language
«
Reply #1 on:
July 25, 2022, 04:46:32 PM »
I am a little confused at what you are doing. Advect.c is an example program distributed with PhreeqcRM. So, my first question is whether you are using PhreeqcRM or IPhreeqc?
IPhreeqc is software designed to automate the use of PHREEQC. The COM version can be used in Excel Visual Basic, Matlab, or COMSOL for example, whereas, the non-COM version can be linked into C, C++, or Fortran. One example of using IPhreeqc is in Monte Carlo simulations assessing the effects of a distribution of equilibrium constants on the saturation indices of minerals.
PhreeqcRM is software that can be used in reactive transport simulators. PhreeqcRM automates the use of one or more IPhreeqc instances to run chemistry for the cells of a flow and transport model. The idea usually is to use operator splitting, where one model calculates flow and conservative transport of multiple constituents, followed by PhreeqcRM (RM_RunCells method) to calculate chemical reactions in each cell.
If you want to calculate more than the simplistic advection of water from cell to cell, which is what advect.c does, you may have a major task, unless you simply use PHREEQC to calculate transport with its mixing cell approach to TRANSPORT calculations. In this case, there is no reason to use IPhreeqc or PhreeqcRM.
If you want to do your own flow and transport calculations, you should probably use PhreeqcRM. In general, you would need a flow model to calculate the water flow and a multicomonent transport model to use the flow vectors to calculate transport. In concept you would place these calculations at the place where the advection subroutine is called in advect.c. You would have to define the porosity, dispersivity, and other flow, transport, and boundary properties, either through some kind of input to the program or hard-wired in the code. Your new subroutine would then solve for one time step of water flow and conservative transport of all the chemical components (elements plus H, O, and charge). After returning from the flow and transport subroutine, you would use the same kind of logic that is in advect.c, to run reactions on all of the cells.
In most cases, PhreeqcRM is intended to be used with an existing flow and multi-component transport model. In this case, you would add code to the flow and tranpsport model to be able to use PhreeqcRM to update the concentration array derived from flow and conservative transport with revised concentrations accounting for a chemical reaction step. This is the approach of the USGS code PHAST, where the flow and transport model HST3D was used with PhreeqcRM. You can also look at the USGS code for VS2DRT, where the merging of the two codes is simpler.
Logged
Print
Pages: [
1
]
Go Up
« previous
next »
PhreeqcUsers Discussion Forum
»
Processes
»
Reactive transport modelling
»
Advection simulation in IPhreeqc+C language