Processes > Reactive transport modelling
Seeking Examples and Guidance for Using BMIPhreeqcRM
(1/1)
ZYWTDaEO6:
Hello dlparkhurst,
I am currently exploring how to integrate COMSOL and BMIPhreeqcRM to model liquid flow and mineral reactions in an evaporite-rich formation. I am new to PHREEQC, and I?d like to ask for some guidance or any relevant examples, especially for the BMIPhreeqcRM module.
1. Initially, I used MATLAB to call PhreeqcCOM for individual grid cells, allowing each cell to react based on concentration and mineral data. The results were then returned to COMSOL, with parallel processing in MATLAB. While this approach works, I learned from the forum that PhreeqcRM would be a better solution rather than PhreeqcCOM for coupling PHREEQC with a flow model.
2. I've since studied the SimpleAdvect example posted by dlparkhurst (Topic: PhreeqcRM Python bindings (https://phreeqcusers.org/index.php/topic,2389.msg8916.html#msg8916)) and reviewed the PhreeqcMatlab code. However, I aim to export the moles of minerals/phases after each reaction step. I came across a forum thread (Topic: Exporting Equilibrium Phases moles in Reactive Transport with PhreeqcRM (https://phreeqcusers.org/index.php/topic,2149.0.html)) where dlparkhurst mentioned the BMIPhreeqcRM module and the GetValue function for extracting mineral moles.
I found the official BMIPhreeqcRM documentation (https://usgs-coupled.github.io/phreeqcrm/classPhreeqcRM.html), but I am struggling to understand how to practically implement key functions as the documentation is quite complex for a beginner.
My Question are there any example scripts or sample codes (like MATLAB or Python) demonstrating the usage of BMIPhreeqcRM?
Any guidance on available learning resources or examples would be very helpful, as I am finding the learning curve quite steep. Thank you very much for any assistance!
dlparkhurst:
The advection example (Advect_cpp.cpp for C++) is a reasonably complete example of how PhreeqcRM is designed to be used. All of the chemical reactants are expected to be maintained in PhreeqcRM, and only the aqueous concentrations are extracted to be transported. Transported concentrations are then submitted to PhreeqcRM for reactions. The advection example only includes advection, but a complete transport model would include advection and dispersion or diffusion, or possibly electro diffusion.
BMIPhreeqcRM is relatively new, so I don't think there are many examples using its features except the example AdvectBMI_cpp.cpp, AdvectBMI_f90.f90, or AdvectBMI_py.py. For the YAML capabilities, there are the examples WriteYAMLFile_. There are also versions of TestAllMethods that show the use of each BMIPhreeqcRM method.
Source code is available for PHAST and VS2DRTI, which use PhreeqcRM. They are not the cleanest implementations because they evolved in the development of PhreeqcRM. There are many other papers in the literature that cite the use of PhreeqcRM in reaction transport modeling or model development.
The moles of minerals are available with GetValue by default when using BMIPhreeqcRM. The list of available variables can be obtained with GetOutputVarNames. You can also obtain the list of minerals with the method GetEquilibriumPhases.
Sorry if you are having a hard time. I made the interfaces as simple as I could.
ZYWTDaEO6:
Thank you, David. I'll go through these examples to better understand PhreeqcRM and BMIPhreeqcRM.
Navigation
[0] Message Index
Go to full version