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 »
  • Beginners »
  • SELECTED_OUTPUT »
  • Output all 'Description of solution' carbonate speciation values in a simulation
« previous next »
  • Print
Pages: [1]   Go Down

Author Topic: Output all 'Description of solution' carbonate speciation values in a simulation  (Read 4729 times)

e.fried

  • Contributor
  • Posts: 2
Output all 'Description of solution' carbonate speciation values in a simulation
« on: 04/04/24 19:54 »
Dear all,

Thank you in advance for your input. I am new to PHREEQC and trying to do simple freshwater carbonate speciation from many thousands of pH, temp, and alkalinity measurements. So far, I have decided to use the SOLUTION_SPREAD format and then run each cell using RUN_CELL, testing on three sets of values. While I am able to use USER_PUNCH to yield the first Total CO2 value, I am unable to successfully show subsequent 'Description of Solution' values within a single simulation after calling phrRunFile(file) and phrGetSelectedOutput(). I would appreciate advice on how to solve this problem or restructure my approach.

All the best

Code: [Select]
SOLUTION_SPREAD
-units mg/L
Alkalinity pH Temperature
mg/L as CaCO3     
18 6.05 6.2
21 5.715 9.3
17 6.16 3.9
END
RUN_CELLS
  -cells 1-3
SELECTED_OUTPUT
  -file co2_speciation.sel
  -high_precision true
  -simulation false
  -state false
  -distance false
  -time false
  -step false
  -pH true
  -pe false
  -alkalinity true
  -reaction false
  -temperature true
  -ionic_strength false
USER_PUNCH
  -headings Total_CO2
  -start
  PUNCH TOT("C")
  -end
END
« Last Edit: 05/04/24 15:25 by e.fried »
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4222
Re: Output multiple 'Description of solution' values within simulations
« Reply #1 on: 04/04/24 23:37 »
There are two calculations for each solution the way you have defined the script. First there is an initial solution calculation for each solution in SOLUTION_SPREAD, and then there is a reaction calculation for each solution due to RUN_CELLS. In your case, the two calculations for a solution produce the same results. In general, the initial solution allows for redox disequilibrium, and the reaction calculation produces redox equilibrium (and any equilibrium for any additional reactants like EQUILIBRIUM_PHASES, EXCHANGE, etc). For your calculations, there is no difference, so you need do the reaction calculations.

The reason you did not get all of the output you expected is that you need line numbers in the USER_PUNCH definition.

I think this would produce the results that you want.

Code: [Select]
SELECTED_OUTPUT
  -file co2_speciation.sel
  -high_precision true
  -simulation false
  -state false
  -distance false
  -time false
  -step false
  -pH true
  -pe false
  -alkalinity true
  -reaction false
  -temperature true
  -ionic_strength false
USER_PUNCH
  -headings Total_CO2
  -start
  10 PUNCH TOT("C")
  -end
END
SOLUTION_SPREAD
-units mg/L
Alkalinity pH Temperature
mg/L as CaCO3     
18 6.05 6.2
21 5.715 9.3
17 6.16 3.9
END
#RUN_CELLS
#  -cells 1-3
#
#END
Logged

e.fried

  • Contributor
  • Posts: 2
Re: Output multiple 'Description of solution' values within simulations
« Reply #2 on: 05/04/24 15:24 »
I see I had some redundancy in this situation, thank you for the clarification and much appreciate the correction to get the full output!
Logged

  • Print
Pages: [1]   Go Up
« previous next »
  • PhreeqcUsers Discussion Forum »
  • Beginners »
  • SELECTED_OUTPUT »
  • Output all 'Description of solution' carbonate speciation values in a simulation
 

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