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 »
  • BASIC functions »
  • High Ammonia and Sulphate
« previous next »
  • Print
Pages: [1]   Go Down

Author Topic: High Ammonia and Sulphate  (Read 9547 times)

magan.govender

  • Contributor
  • Posts: 6
High Ammonia and Sulphate
« on: 02/11/23 11:04 »
Good day, i am new to the forum and seek advise in modelling the sample chem below. any assistance would be greatly appreciated. I would like to remove the ammonia first then precipitate the sulphate

Solution 1
pH    13.02
pe    10
temp    20
redox pe
-units mg/L
Na     738.8
Ca       515.8
Mg       9.2
Cl      0.0
S(6)      28500.0
Si      1.0
#Alkalinity  8099.0 as HCO3
Amm  9025.88
Ba     0.22
B      19.2
Mn     2624.0
Sr        1.44
Logged

MichaelZ20

  • Top Contributor
  • Posts: 170
Re: High Ammonia and Sulphate
« Reply #1 on: 02/11/23 13:00 »
You may want to remove ammonia by struvite precipitation. Add MgCl2 and NaH2PO4 by using REACTION.
Alternative method - air stripping.
« Last Edit: 02/11/23 16:57 by MichaelZ20 »
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4213
Re: High Ammonia and Sulphate
« Reply #2 on: 02/11/23 15:47 »
Michael's approach to precipitating Struvite is easier to model because you can add the REACTION in multiple increments.

With gas stripping, I have set up the calculation to sequentially equilibrate the solution with 100 liters of air. The total volume of air required to remove the ammonia is fairly large, ~1e5 liters.  I have used SELECTED_OUTPUT and USER_PUNCH to write a file to simulate 100 gas/water equilibrations. It's a little messy, so you could simply cut and paste the following 100 times:

Code: [Select]
USE solution 1
USE gas_phase 1
SAVE solution 1
END

Here is the script that does the gas stripping followed by precipitation of barite incrementally.

Code: [Select]
Solution 1
pH    13.02
pe    10 O2(g) -5
temp    20
redox pe
-units mg/L
Na     738.8
Ca       515.8
Mg       9.2
Cl      0.0
S(6)      28500.0
Si      1.0
#Alkalinity  8099.0 as HCO3
Amm  9025.88
Ba     0.22
B      19.2
Mn     2624.0
Sr        1.44
SELECTED_OUTPUT 2
-file sparge.pqi
USER_PUNCH 2
10 FOR i = 1 to 100
20   s$ = s$ + "USE solution 1" + EOL$
30   s$ = s$ + "USE gas_phase 1" + EOL$
40   s$ = s$ + "SAVE solution 1" + EOL$
50   s$ = s$ + "END" + EOL$
60 NEXT I
70 PUNCH s$
END
SELECTED_OUTPUT 2
-active false
GAS_PHASE 1
-fixed_pressure
-volume 100
Amm(g) 0
Ntg(g)  0.78
Oxg(g)  0.2
CO2(g)  0.0004
SAVE solution 2
END
USER_PRINT
10 PUT(GET(0)+100, 0)
USER_GRAPH 1
    -axis_titles            "Volume of air, in liters" "Amm concentration, in molality" ""
10 liters = GET(0)
30 GRAPH_X liters
40 GRAPH_Y TOT("Amm")
50 END
END
INCLUDE$ sparge.pqi
END
USER_GRAPH 1
    -active                 false
USER_PRINT
10 REM
END
USE solution 1
REACTION
BaCl2 1
0.5 in 10 steps
EQUILIBRIUM_PHASES
Barite 0 0
USER_GRAPH 2
    -axis_titles            "BaCl2 added, moles" "Total sulfate, in molality" ""
    -initial_solutions      false
    -connect_simulations    true
    -plot_concentration_vs  x
  -start
10 GRAPH_X RXN
20 GRAPH_Y TOT("S(6)")
  -end
END


Logged

MichaelZ20

  • Top Contributor
  • Posts: 170
Re: High Ammonia and Sulphate
« Reply #3 on: 03/11/23 13:33 »
Hi David!
I tried to use the 1-st method. From an unknown reason I have got much higher remainder of ammonia.
Where am I wrong?
Code: [Select]
SOLUTION 0
-units mg/L
temp    20
pH    13.02
pe    10 O2(g) -5
redox pe
Na     738.8
Ca       515.8
Mg       9.2
Cl      0.0
S(6)      28500.0
Si      1.0
#Alkalinity  8099.0 as HCO3
Amm  9025.88
Ba     0.22
B      19.2
Mn     2624.0
Sr        1.44
END

USER_GRAPH 1
-axis_titles            "Volume of air, L" "Amm concentration, mol/kgw" ""
  -start
10 GRAPH_X GAS_VM * (GAS("Amm(g)") + GAS("Ntg(g)") + GAS("Oxg(g)") + GAS("CO2(g)") + GAS("H2O(g)")) 
20 GRAPH_Y TOT("Amm")
  -end

USE solution 0
GAS_PHASE 1
-fixed_pressure
#-pressure 1  # default
-volume 500
Amm(g) 0
Ntg(g)  0.78
Oxg(g)  0.22
CO2(g)  0.0004
END

USE solution 0
GAS_PHASE 2
-fixed_pressure
-volume 1000
Amm(g) 0
Ntg(g)  0.78
Oxg(g)  0.22
CO2(g)  0.0004
END

USE solution 0
GAS_PHASE 3
-fixed_pressure
-volume 1500
Amm(g) 0
Ntg(g)  0.78
Oxg(g)  0.22
CO2(g)  0.0004
SAVE SOLUTION 3
END

USE solution 0
GAS_PHASE 4
-fixed_pressure
-volume 2000
Amm(g) 0
Ntg(g)  0.78
Oxg(g)  0.22
CO2(g)  0.0004
END

USE solution 0
GAS_PHASE 5
-fixed_pressure
-volume 2500
Amm(g) 0
Ntg(g)  0.78
Oxg(g)  0.22
CO2(g)  0.0004
END

USE solution 0
GAS_PHASE 6
-fixed_pressure
-volume 3000
Amm(g) 0
Ntg(g)  0.78
Oxg(g)  0.22
CO2(g)  0.0004
END

USE solution 0
GAS_PHASE 7
-fixed_pressure
-volume 3500
Amm(g) 0
Ntg(g)  0.78
Oxg(g)  0.22
CO2(g)  0.0004
END

USE solution 0
GAS_PHASE 8
-fixed_pressure
-volume 4000
Amm(g) 0
Ntg(g)  0.78
Oxg(g)  0.22
CO2(g)  0.0004
END

USE solution 0
GAS_PHASE 9
-fixed_pressure
-volume 4500
Amm(g) 0
Ntg(g)  0.78
Oxg(g)  0.22
CO2(g)  0.0004
END

USE solution 0
GAS_PHASE 10
-fixed_pressure
-volume 5000
Amm(g) 0
Ntg(g)  0.78
Oxg(g)  0.22
CO2(g)  0.0004
END

USE solution 0
GAS_PHASE 11
-fixed_pressure
-volume 5500
Amm(g) 0
Ntg(g)  0.78
Oxg(g)  0.22
CO2(g)  0.0004
END

USE solution 0
GAS_PHASE 12
-fixed_pressure
-volume 6000
Amm(g) 0
Ntg(g)  0.78
Oxg(g)  0.22
CO2(g)  0.0004
END

USE solution 0
GAS_PHASE 13
-fixed_pressure
-volume 6500
Amm(g) 0
Ntg(g)  0.78
Oxg(g)  0.22
CO2(g)  0.0004
END

USE solution 0
GAS_PHASE 14
-fixed_pressure
-volume 7000
Amm(g) 0
Ntg(g)  0.78
Oxg(g)  0.22
CO2(g)  0.0004
END

USE solution 0
GAS_PHASE 15
-fixed_pressure
-volume 7500
Amm(g) 0
Ntg(g)  0.78
Oxg(g)  0.22
CO2(g)  0.0004
END

USE solution 0
GAS_PHASE 16
-fixed_pressure
-volume 8000
Amm(g) 0
Ntg(g)  0.78
Oxg(g)  0.22
CO2(g)  0.0004
END

USE solution 0
GAS_PHASE 17
-fixed_pressure
-volume 8500
Amm(g) 0
Ntg(g)  0.78
Oxg(g)  0.22
CO2(g)  0.0004
END

USE solution 0
GAS_PHASE 18
-fixed_pressure
-volume 9000
Amm(g) 0
Ntg(g)  0.78
Oxg(g)  0.22
CO2(g)  0.0004
END

USE solution 0
GAS_PHASE 19
-fixed_pressure
-volume 9500
Amm(g) 0
Ntg(g)  0.78
Oxg(g)  0.22
CO2(g)  0.0004
END

USE solution 0
GAS_PHASE 20
-fixed_pressure
-volume 10000
Amm(g) 0
Ntg(g)  0.78
Oxg(g)  0.22
CO2(g)  0.0004
END

USE solution 0
GAS_PHASE 21
-fixed_pressure
-volume 10500
Amm(g) 0
Ntg(g)  0.78
Oxg(g)  0.22
CO2(g)  0.0004
END

USE solution 0
GAS_PHASE 22
-fixed_pressure
-volume 11000
Amm(g) 0
Ntg(g)  0.78
Oxg(g)  0.22
CO2(g)  0.0004
END

USE solution 0
GAS_PHASE 23
-fixed_pressure
-volume 11500
Amm(g) 0
Ntg(g)  0.78
Oxg(g)  0.22
CO2(g)  0.0004
END

USE solution 0
GAS_PHASE 24
-fixed_pressure
-volume 12000
Amm(g) 0
Ntg(g)  0.78
Oxg(g)  0.22
CO2(g)  0.0004
END

USE solution 0
GAS_PHASE 25
-fixed_pressure
-volume 12500
Amm(g) 0
Ntg(g)  0.78
Oxg(g)  0.22
CO2(g)  0.0004
END
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4213
Re: High Ammonia and Sulphate
« Reply #4 on: 03/11/23 15:12 »
You need to SAVE solution 0 after each step.
Logged

MichaelZ20

  • Top Contributor
  • Posts: 170
Re: High Ammonia and Sulphate
« Reply #5 on: 03/11/23 18:25 »
With this approach, I use the result of each previous calculation as a new initial solution.
« Last Edit: 03/11/23 22:52 by MichaelZ20 »
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4213
Re: High Ammonia and Sulphate
« Reply #6 on: 03/11/23 19:55 »
This is exactly the calculation made by writing the sparge.pqi file and then running it.

Code: [Select]
Solution 1
pH    13.02
pe    10 O2(g) -5
temp    20
redox pe
-units mg/L
Na     738.8
Ca       515.8
Mg       9.2
Cl      0.0
S(6)      28500.0
Si      1.0
#Alkalinity  8099.0 as HCO3
Amm  9025.88
Ba     0.22
B      19.2
Mn     2624.0
Sr        1.44
SELECTED_OUTPUT 2
-file sparge.pqi
USER_PUNCH 2
10 FOR i = 1 to 100
20   s$ = s$ + "USE solution 1" + EOL$
30   s$ = s$ + "USE gas_phase 1" + EOL$
40   s$ = s$ + "SAVE solution 1" + EOL$
50   s$ = s$ + "END" + EOL$
60 NEXT I
70 PUNCH s$
END
SELECTED_OUTPUT 2
-active false
GAS_PHASE 1
-fixed_pressure
-volume 100
Amm(g) 0
Ntg(g)  0.78
Oxg(g)  0.2
CO2(g)  0.0004
SAVE solution 2
END
USER_PRINT
10 PUT(GET(0)+100, 0)
USER_GRAPH 1
    -axis_titles            "Volume of air, in liters" "Amm concentration, in molality" ""
10 liters = GET(0)
30 GRAPH_X liters
40 GRAPH_Y TOT("Amm")
50 END
END

USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END
USE solution 1
USE gas_phase 1
SAVE solution 1
END

Logged

MichaelZ20

  • Top Contributor
  • Posts: 170
Re: High Ammonia and Sulphate
« Reply #7 on: 03/11/23 20:54 »
David, why do we need such a "chain" calculation?
A simulation for a single large volume gives different results: relatively high ammonia concentration.
Code: [Select]
SOLUTION 0
-units mg/L
temp    20
pH    13.02
pe    10 O2(g) -5
redox pe
Na     738.8
Ca       515.8
Mg       9.2
Cl      0.0
S(6)      28500.0
Si      1.0
#Alkalinity  8099.0 as HCO3
Amm  9025.88
Ba     0.22
B      19.2
Mn     2624.0
Sr        1.44
END

USER_GRAPH 1
-axis_titles            "Volume of air, L" "Amm concentration, mol/kgw" ""
  -start
10 GRAPH_X GAS_VM * (GAS("Amm(g)") + GAS("Ntg(g)") + GAS("Oxg(g)") + GAS("CO2(g)") + GAS("H2O(g)")) 
20 GRAPH_Y TOT("Amm")
  -end

USE solution 0
GAS_PHASE 25
-fixed_pressure
-volume 12500
Amm(g) 0
Ntg(g)  0.78
Oxg(g)  0.22
CO2(g)  0.0004
END
« Last Edit: 03/11/23 22:57 by MichaelZ20 »
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4213
Re: High Ammonia and Sulphate
« Reply #8 on: 03/11/23 22:45 »
When you do only one step, all of the Amm that was originally in the solution is still present, but partitioned between the solution and the gas phase.

When you do multiple steps, the gas phase is removed from the system at each step; the gas phase at each step starts with zero Amm. So, after each step, there is less Amm in the system. If you have many steps, most of the Amm has been removed.
Logged

MichaelZ20

  • Top Contributor
  • Posts: 170
Re: High Ammonia and Sulphate
« Reply #9 on: 05/11/23 09:31 »
Thank you, David!
Logged

magan.govender

  • Contributor
  • Posts: 6
Re: High Ammonia and Sulphate
« Reply #10 on: 06/11/23 06:59 »
Thanks Michael and David!
Logged

  • Print
Pages: [1]   Go Up
« previous next »
  • PhreeqcUsers Discussion Forum »
  • Beginners »
  • BASIC functions »
  • High Ammonia and Sulphate
 

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