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 »
  • Beginners »
  • BASIC functions »
  • Distribution of alkalinity
« previous next »
  • Print
Pages: [1]   Go Down

Author Topic: Distribution of alkalinity  (Read 12275 times)

khwee

  • Contributor
  • Posts: 8
Distribution of alkalinity
« on: 28/09/21 14:17 »
Dear all,

The keyword PRINT gives an option to show the list of species that contributes to alkalinity, but is there a way to punch the list to a file via USER_PUNCH instead?  If there is no such an option, then is there a Basic function similar to SYS("aq"), that could be used to query and output the list into an array, along with their molarity and Alk/Mol?

Thanks so much for your help!
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4315
Re: Distribution of alkalinity
« Reply #1 on: 28/09/21 18:28 »
Sorry, there is no function to get the alkalinity of a species.

All I could come up with is to make a lookup table between species name and alkalinity in USER_PRINT or USER_PUNCH. The following program uses brute force to allow you to calculate the alkalinity contribution of each species for the phreeqc.dat database.

The code includes a list of all elements in the periodic table as a means of finding all of the species in the database. I ran the code with the phreeqc.dat database and then edited the Alkalinity Distribution output data block to get the names and alkalinities for all alkalinity species. I  then wrote the USER_PRINT data block using a DATA statement in Basic. Not pretty (or efficient), but it will work if you really need the distribution of alkalinity.
Logged

khwee

  • Contributor
  • Posts: 8
Re: Distribution of alkalinity
« Reply #2 on: 29/09/21 09:53 »
Thanks so much for your help dlparkhurst!

Yes, it is not as elegant as a Basic function, but it certainly will work for my use case.  Really appreciate your help putting this together so quickly.
Logged

swhit

  • Frequent Contributor
  • Posts: 14
Re: Distribution of alkalinity
« Reply #3 on: 30/05/23 20:19 »
Hello, I get a 404 error when I try to dowload this attachment.  Would it be possible to post a reply with the text of the code?

Thanks!
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4315
Re: Distribution of alkalinity
« Reply #4 on: 31/05/23 15:54 »
Sorry, but no. All of the attachments seem to be lost in this forum.

All I can suggest is to use the -alk option of the PRINT data block to get the alkalinity contribution of each species in your system. You can also write the total alkalinity to a selected output file with a SELECTED_OUTPUT option or the Basic function ALK in USER_PUNCH.
Logged

  • Print
Pages: [1]   Go Up
« previous next »
  • PhreeqcUsers Discussion Forum »
  • Beginners »
  • BASIC functions »
  • Distribution of alkalinity
 

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