PhreeqcUsers Discussion Forum

Welcome Guest
 

  • Forum Home
  • Login
  • Register

  • PhreeqcUsers Discussion Forum »
  • Beginners »
  • PHREEQC basics »
  • Inconsistent amounts of elements when input is in mg/L
« previous next »
  • Print
Pages: [1]   Go Down

Author Topic: Inconsistent amounts of elements when input is in mg/L  (Read 1360 times)

klk

  • Contributor
  • Posts: 4
Inconsistent amounts of elements when input is in mg/L
« on: 18/08/23 15:52 »
Hello. Consider the following script, executed with phreeqc.dat database and PHREEQC v3.7.3:

Code: [Select]
SOLUTION
units mg/L
Na   40000.0 charge
Ca   6000.0
Cl   80000.0
Fe   100.0

The reported volume of the solution is 1.09362 L and the element amounts are:

Code: [Select]
Ca = 1.713e-01 mol
Cl = 2.582e+00 mol
Fe = 2.049e-03 mol
Na = 2.236e+00 mol

Let's convert the computed amounts of Ca, Cl, and Fe to mg/L (ignoring Na, because the input amount is just an approximation), using the following element molar masses and the volume of the solution:

Code: [Select]
MM Ca = 40.078 g/mol
MM Cl = 35.4527 g/mol
MM Fe = 55.847 g/mol

The concentrations in mg/L of the elements are:

Code: [Select]
Ca: 6277.6  instead of 6000 mg/L
Cl: 83702.6 instead of 80000 mg/L
Fe: 104.6   instead of 100 mg/L

The full calculation uses the expressions:

Code: [Select]
mg/L Ca = (1.713e-01 mol) * (40.0780 g/mol) * (1000.0 mg/g) / (1.09362 L)
mg/L Cl = (2.582e+00 mol) * (35.4527 g/mol) * (1000.0 mg/g) / (1.09362 L)
mg/L Fe = (2.049e-03 mol) * (55.8470 g/mol) * (1000.0 mg/g) / (1.09362 L)

What am I missing here? My expectation was that I would get matching results and mass conservation for these elements.

Many thanks for explaining.
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 3996
Re: Inconsistent amounts of elements when input is in mg/L
« Reply #1 on: 18/08/23 21:56 »
You are missing density. PHREEQC needs the density to convert concentrations in mg/L to mol/kgw.

To simplify, I removed the charge-balance adjustment. The density that is consistent with the concentrations you give can be calculated with -density 1 calc. The program will iterate so that the density the density used to convert the units is the same as the density calculated for the solution.

Code: [Select]
SOLUTION
units mg/L
-density 1 charge
Na   40000.0
Ca   6000.0
Cl   80000.0
Fe   100.0
USER_PRINT
10 PRINT "Element  ", "  mg/L"
20 PRINT "Na       ", TOTMOL("Na") * GFW("Na") * 1000 / SOLN_VOL
30 PRINT "Ca       ", TOTMOL("Ca") * GFW("Ca") * 1000 / SOLN_VOL
40 PRINT "Cl       ", TOTMOL("Cl") * GFW("Cl") * 1000 / SOLN_VOL
50 PRINT "Fe       ", TOTMOL("Fe") * GFW("Fe") * 1000 / SOLN_VOL
Logged

MichaelZ20

  • Top Contributor
  • Posts: 158
Re: Inconsistent amounts of elements when input is in mg/L
« Reply #2 on: 19/08/23 07:28 »
Hi David!
In a case of the charge-balance adjustment for some element the USER_PRINT gives changed concentrations (in mg/l) also for other elements. Is it possible to consider the solution volume change for getting the measured concentrations?
« Last Edit: 19/08/23 08:40 by MichaelZ20 »
Logged

klk

  • Contributor
  • Posts: 4
Re: Inconsistent amounts of elements when input is in mg/L
« Reply #3 on: 19/08/23 09:24 »
Thanks, David.

If the solution density must be given, I'd expect the final solution composition, temperature and pressure to thermodynamically correspond to the specified density. But this is not what happens, which creates inconsistencies between input and output concentrations in mg/L.

For the problem at hand, Na+ should be added/removed as much as needed so that the final solution is charge balanced. Thus, the script below should be used.

I found that after iterating several times (i.e., take output density, set as input density, repeat), I could improve the consistency among input and output concentrations of elements. The density 1.08569 kg/L is what I found after several iterations to ensure input density = output density:

Code: [Select]
SOLUTION
units mg/L
-density 1.08569
Na   40000.0 charge
Ca   6000.0
Cl   80000.0
Fe   100.0
USER_PRINT
10 PRINT "Element  ", "  mg/L"
20 PRINT "Na       ", TOTMOL("Na") * GFW("Na") * 1000 / SOLN_VOL
30 PRINT "Ca       ", TOTMOL("Ca") * GFW("Ca") * 1000 / SOLN_VOL
40 PRINT "Cl       ", TOTMOL("Cl") * GFW("Cl") * 1000 / SOLN_VOL
50 PRINT "Fe       ", TOTMOL("Fe") * GFW("Fe") * 1000 / SOLN_VOL

The printed concentrations of elements (in mg/L) are:

Code: [Select]
----------------------------------User print-----------------------------------

Element     mg/L
Na          4.4712e+04
Ca          5.9730e+03      (should be 6000.0)
Cl          7.9640e+04      (should be 80000.0)
Fe          9.9550e+01      (should be 100.0)

The input-output mismatch is now reduced. Is there a way to get this done automatically with PHREEQC?
« Last Edit: 21/08/23 07:17 by klk »
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 3996
Re: Inconsistent amounts of elements when input is in mg/L
« Reply #4 on: 20/08/23 04:33 »
I think you are getting a little carried away. Most calculations will work fine with solutions that have a charge imbalance. PHREEQC will carry the charge imbalance through the calculations as an unidentified ion. I don't think this is any worse than attributing all of the error to sodium.

There is no easy way to automatically adjust both density and charge balance.

The following does it one solution at a time, and you could use IPhreeqc to program a similar calculation for each solution. But I am getting carried away.

Code: [Select]
RATES
Adjust
10 k = 1e-2
20 rate = k * (1000*TOTMOL("Cl")*GFW("Cl")/SOLN_VOL - 80000)
30 moles = rate * time
40 save moles

END
SOLUTION 1
units mg/L
-density 1.08569
Na   40000.0 charge
Ca   6000.0
Cl   80000.0
Fe   100.0
END
USE solution 1
KINETICS 1
Adjust
-formula H2O
-m 100
-time 1
-cvode
USER_PRINT
10 PRINT "Element  ", "  mg/L"
20 PRINT "Na       ", TOTMOL("Na") * GFW("Na") * 1000 / SOLN_VOL
30 PRINT "Ca       ", TOTMOL("Ca") * GFW("Ca") * 1000 / SOLN_VOL
40 PRINT "Cl       ", TOTMOL("Cl") * GFW("Cl") * 1000 / SOLN_VOL
50 PRINT "Fe       ", TOTMOL("Fe") * GFW("Fe") * 1000 / SOLN_VOL
END
Logged

  • Print
Pages: [1]   Go Up
« previous next »
  • PhreeqcUsers Discussion Forum »
  • Beginners »
  • PHREEQC basics »
  • Inconsistent amounts of elements when input is in mg/L
 

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