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
»
USER_PUNCH/USER_GRAPH
»
BASIC functions
»
Distribution of alkalinity
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: Distribution of alkalinity (Read 2139 times)
khwee
Contributor
Posts: 6
Distribution of alkalinity
«
on:
September 28, 2021, 02:17:29 PM »
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: 3892
Re: Distribution of alkalinity
«
Reply #1 on:
September 28, 2021, 06:28:47 PM »
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: 6
Re: Distribution of alkalinity
«
Reply #2 on:
September 29, 2021, 09:53:45 AM »
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:
May 30, 2023, 08:19:16 PM »
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: 3892
Re: Distribution of alkalinity
«
Reply #4 on:
May 31, 2023, 03:54:34 PM »
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
»
USER_PUNCH/USER_GRAPH
»
BASIC functions
»
Distribution of alkalinity