PhreeqcUsers Discussion Forum

Please email phreeqcusers at gmail.com with your name and affiliation to request an account.
Welcome Guest
 

  • Forum Home
  • Login
  • Register

  • PhreeqcUsers Discussion Forum »
  • Conceptual Models »
  • Program coupling »
  • Coupling PHREEQC with CENTURY from NREL
« previous next »
  • Print
Pages: [1]   Go Down

Author Topic: Coupling PHREEQC with CENTURY from NREL  (Read 16176 times)

MACAHarding

  • Contributor
  • Posts: 8
Coupling PHREEQC with CENTURY from NREL
« on: 02/04/24 00:09 »
Hello,

Is it possible to use data from CENTURY as input to PHREEEQC? Better yet, you have any suggestions on books that would help me potentially combine them like PHREEQC is combined to OpenFOAM?

PHREEQC is awesome, and I just finished a course. I learned about CENTURY for agricultural purposes. It doesn't do CEC analysis. I would love to combine them. It might take me the rest of my life, but I appreciate the usefulness of both, and I am concentrating on farmland.

Specifically, I plan to use OpenSMOKE++OPENFOAM to analyze pyrolysis of biomass, PARAVIEW to slice the 3D Model, and porespy with Python to get a distribution of pore diameters. I will also have detailed chemistry of the biochar surfaces. Afterwards, I hope to use Century and PHREEQC to model enhanced weathering with basalt in a soil that has high CEC biochar mixed in at various percentages, and 1) obtain output on fertility, CEC, etc. 2) Obtain output on CO2 absorbed from atmosphere.

I am relatively intelligent but not a genius. I have done projects with OpenFOAM.

Is this possible? I noticed that you said it was possible with FORTRAN and transport software.
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4336
Re: Coupling PHREEQC with CENTURY from NREL
« Reply #1 on: 02/04/24 15:20 »
There are two flavors of PHREEQC that can be used to couple with other models--IPhreeqc and PhreeqcRM.

IPhreeqc has both a COM version, which can be used with Visual Basic and other apps that can interact with a COM, and a version that can be linked to C++, C, or Fortran programs. IPhreeqc simplifies making PHREEQC calculations within scripting and programming languages. However, it is essentially string-based and requires an input file or input string to do calculations. You would need to create strings of PHREEQC input to do the calculations that you want. There are _MODIFY and _RAW methods (Appendix of the the manual) that allow you to define complete solution and other reactant compositions.

PhreeqcRM is designed to run PHREEQC reaction calculations on a set of cells, generally, the cells of a reactive-transport model. The basic strategy is to run chemistry on a set of cells with PhreeqcRM, transfer the dissolved concentrations to a transport model, calculate transport in the transport model (either individually for each element, or by mixing solutions), and then transfer the new concentrations back to PhreeqcRM for a new time step starting with geochemical calculations. Transfer of data is by native arrays, not strings. PhreeqcRM can be used by C++, Fortran, Python, and C programs. In addition, PhreeqcRM is parallelized by either OpenMP or MPI so that cell geochemistry can be run in parallel. All capabilities of PHREEQC are available for the geochemical calculations in a cell.

The latest beta version of PhreeqcRM implements the Basic Model Interface (BMI) that has an initialize, update, finalize paradigm, where time stepping is sequential calls to update. If you are using other models that are BMI models, it could simplify your coupled model development.
Logged

MACAHarding

  • Contributor
  • Posts: 8
Re: Coupling PHREEQC with CENTURY from NREL
« Reply #2 on: 02/04/24 23:49 »
Thanks so much, Dr. Parkhurst.
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4336
Re: Coupling PHREEQC with CENTURY from NREL
« Reply #3 on: 03/04/24 00:11 »
No Dr.
Logged

tomjscox

  • Contributor
  • Posts: 2
Re: Coupling PHREEQC with CENTURY from NREL
« Reply #4 on: 12/03/26 11:06 »
FYI we coupled a version of Century in PhreeqC making use of the inbuilt BASIC interpreter. I wanted to post a link to the code but apparently I'm not allowed to post external links. You'll find the code on zenodo and a preprint of the paper under review on cdrxiv if you search for "Integrating experiments and models to unravel interactions between soil organic matter and enhanced weathering"

Tom
Logged

  • Print
Pages: [1]   Go Up
« previous next »
  • PhreeqcUsers Discussion Forum »
  • Conceptual Models »
  • Program coupling »
  • Coupling PHREEQC with CENTURY from NREL
 

  • SMF 2.0.19 | SMF © 2021, Simple Machines | Terms and Policies
  • XHTML
  • RSS
  • WAP2