PhreeqcUsers Discussion Forum

Registrations currently disabled due to excessive spam. Please email phreeqcusers at gmail.com to request an account.
Welcome Guest
 

  • Forum Home
  • Login
  • Register

  • PhreeqcUsers Discussion Forum »
  • Processes »
  • Reactive transport modelling »
  • Method to get the concentration or species in Iphreeqc
« previous next »
  • Print
Pages: [1]   Go Down

Author Topic: Method to get the concentration or species in Iphreeqc  (Read 1170 times)

Yongqiang

  • Top Contributor
  • Posts: 123
Method to get the concentration or species in Iphreeqc
« on: 12/02/24 00:55 »
Hi David,

I wonder if the IPHREEQC has a similar method like the RM_GetConcentrations() and RM_GetSpeciesConcentrations in PHREEQCRM to obtain and set the concentration and species.

Thanks
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4067
Re: Method to get the concentration or species in Iphreeqc
« Reply #1 on: 12/02/24 16:32 »
No, IPhreeqc does not have those methods.

The only way to get that information is a bit complicated. You have to write SELECTED_OUTPUT/USER_PUNCH definitions to retrieve those concentrations.

The simplest way is simply to write SELECTED_OUTPUT/USER_PUNCH definitions and then process the results with GetSelectedOutputValue. You need to know which total and species concentrations you want to retrieve.

If you want a general, it is a bit more complicated. I'll outline the steps here:

1. Retrieve the elements in your system with GetComponentCount and GetComponent.
2. Define a SOLUTION with a small amount of each component other than H, O, H2O, and charge.
3. Write SELECTED_OUTPUT and USER_PUNCH definitions to extract all of the aqueous species names. The Basic function SYS("aq", can be used to get the names to write another set of SELECTED_OUTPUT/USER_PUNCH definitions that will extract all the concentrations you want for a calculation. (Alternatively, you can write the names to selected output and then write the new SELECTED_OUTPUT/USER_PUNCH definitions by processing the selected output data.)
4. Run the SOLUTION, SELECTED_OUTPUT, and USER_PUNCH definitions to create the new SELECTED_OUTPUT/USER_PUNCH definitions. This will be equivalent to a definition you would write by hand if you knew all the elements and species names.
5. Finally, you need to RUN this new SELECTED_OUTPUT/USER_PUNCH before you do the rest of your calculations. You will be able to process the selected output to get the concentrations you want.
Logged

Yongqiang

  • Top Contributor
  • Posts: 123
Re: Method to get the concentration or species in Iphreeqc
« Reply #2 on: 14/02/24 13:41 »
Many thanks, David. Your suggested method is brilliant.
I tried to compiled the PHREEQCRM in windows to get the shared library. Then I called the shared library in Matlab to use these methods. I learned a lot in this process!

Cheers,
Logged

  • Print
Pages: [1]   Go Up
« previous next »
  • PhreeqcUsers Discussion Forum »
  • Processes »
  • Reactive transport modelling »
  • Method to get the concentration or species in Iphreeqc
 

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