PhreeqcUsers Discussion Forum
Click here to donate to keep PhreeqcUsers open

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 

  • Forum Home
  • Login
  • Register

  • PhreeqcUsers Discussion Forum »
  • Beginners »
  • PHREEQC basics »
  • Simulating change in SI as a function of pH over time
« previous next »
  • Print
Pages: [1]   Go Down

Author Topic: Simulating change in SI as a function of pH over time  (Read 375 times)

DyliS

  • Contributor
  • Posts: 2
Simulating change in SI as a function of pH over time
« on: November 01, 2021, 05:54:29 PM »
Hello,

I am trying to simulate the change of SI of MSH phase over time as a function of pH. I've attached the input file and the modified database that is being use to carry this out. When I run this input file, I keep getting the same error pasted down below. I'm not sure what the problem is after fixing this error or the syntax I have might be throwing this error as an accident.  Any guidance will be appreciated.

Thank you
~Dylan

(
ERROR: Syntax_error : missing " or ( in line:
ERROR:  in BASIC line
 20   if (SI("M075SH") => 0)then goto 100
ERROR: Fatal Basic error in rate Periclase.
)

Logged

dlparkhurst

  • Top Contributor
  • Posts: 2736
Re: Simulating change in SI as a function of pH over time
« Reply #1 on: November 01, 2021, 08:16:12 PM »
You need to use ">=" rather than "=>".

Also need to remove spaces after the hyphens in the KINETICS definitions.

This code runs, but periclase is supersaturated, so the RATES expression always evaluates to zero.

Code: [Select]
SOLUTION 1
    temp      25
    pH        7 charge
    pe        4
    redox     pe
    units     mmol/kgw
    density   1
    Na        10
    Si        5
    N(5)      15
    Mg        30
    -water    1# kg

RATES
    Periclase
-start
  1   rem PARM(1) = normalized surface area
 10  if (M <= 0)then goto 100
 20  if (SI("M075SH") >= 0)then goto 100
 30  si_MSH075 = SI("M075SH")
 40  if M > 0 then area = PARM(1)*M
 50  rate = 10^(-0.9877436 * (-LA("H+"))- 3.9806115) * area
 60  moles = rate * TIME
100 SAVE moles
-end

KINETICS 1
 Periclase
  -tol 1e-8
  -m0  0
  -m  6.38e-3
  -parms 3.005e5 # normalized surface area (cm^2)
  -steps 3600 in 10 steps # steps are in seconds, 10 hours

USER_GRAPH 1
-headings Reaction MSH(0.75) MSH(1.5) Brucite pH
-chart_title "MgO Dissolution"
-axis_titles "Time (s)" "Saturation Index " "pH"
-initial_solutions true
-start
10 graph_x  SIM_TIME
20 graph_y SI("M075SH") SI("M15SH") SI("Brc")
30 graph_sy  -LA("H+")
-end
Logged

DyliS

  • Contributor
  • Posts: 2
Re: Simulating change in SI as a function of pH over time
« Reply #2 on: November 07, 2021, 03:27:45 AM »
Thank you for your help!
Logged

  • Print
Pages: [1]   Go Up
« previous next »
  • PhreeqcUsers Discussion Forum »
  • Beginners »
  • PHREEQC basics »
  • Simulating change in SI as a function of pH over time
 

  • SMF 2.0.17 | SMF © 2019, Simple Machines | Terms and Policies
  • XHTML
  • RSS
  • WAP2