// Load database status = phreeqc_rm.LoadDatabase("phreeqc.dat");
SOLUTIONpH 7 chargeS(6) 1Fe(3) 1USER_PRINT10 t = SYS("S", count, name$, type$, moles)20 PRINT "Species mol/L S coef"30 FOR i = 1 TO count40 if (type$(i) <> "aq") THEN GOTO 11050 n$ = SPECIES_FORMULA(name$(i), count_e, elt$, coef)60 FOR j = 1 TO count_e70 if (elt$(j) <> "S") then goto 10080 sum = sum + MOL(name$(i)) * coef(j)90 PRINT PAD(name$(i),17), STR_E$(MOL(name$(i))*TOT("water")/SOLN_VOL, 15, 4), coef(j)100 NEXT j110 NEXT i120 PRINT "Sum species, mol/L: ", sum*TOT("water")/SOLN_VOL130 PRINT 'Total S, mol/L: ', TOT("S")*TOT("water")/SOLN_VOLEND
SOLUTION-units mmol/L-density 1.029 calcpH 7 chargeNa 56S(6) 28USER_PRINT10 PRINT "SO4, mmol/L: ", 1000*TOTMOL("S(6)")/SOLN_VOLENDUSE solution 1REACTION_PRESSURE500END
SOLUTION_SPECIES2 NO3- + 12 H+ + 10 e- = N2 + 6 H2O #-log_k 207.08 -log_k 0 -delta_h -312.130 kcal -dw 1.96e-9 -Vm 7 # Pray et al., 1952, IEC 44. 1146SOLUTION 1 -temp 10 -units mmol/L -density 1 calc Alkalinity 2.3 C(4) 2.1 C(-4) 1 N(-3) 1 Ca 10 Mg 50 Na 470 K 10 Cl 550 S(6) 28 S(-2) 1 Si 1 -water 1 # kgENDMIX 11 1END[/codeAnother reaction is the oxidation of C(-4) by S(6), where C(-4) basically disappears, S(6) decreases, and S(-2) increases. I don't know if you want to disable this reaction of not; you could argue either way. If you want C(-4) not to react, you can define the methane as Mtg instead of C(-4). Mtg is not defined as part of the C (carbon) aqueous species. Mtg has only one aqueous specie and cannot be oxidized, although it could increase or decrease by REACTION or KINETICS. Note that CH4(aq) can still form if, for instance, organic matter (CH2O) reacts with your solution; Mtg will not change but C(4) could be reduced to CH4(aq).
SOLUTION 1-2-units mmol/kgwpH 7 chargeNa 1Cl 1ENDSOLUTION_MODIFY 1-totalsCl 1.5e-3Na 1e-3ENDSOLUTION_MODIFY 2-cb -0.0005-totals Cl 1.5e-3Na 1e-3ENDRUN_CELLS-cells 1-2END
for (int i = 0; i < nxyz; i++) { ic1[i] = 1; // Solution 1 ic1[nxyz + i] = -1; // Equilibrium phases none ic1[2*nxyz + i] = 1; // Exchange 1 ic1[3*nxyz + i] = -1; // Surface none ic1[4*nxyz + i] = -1; // Gas phase none ic1[5*nxyz + i] = -1; // Solid solutions none ic1[6*nxyz + i] = -1; // Kinetics none }
std::vector<double> bc_conc;std::vector<int> bc1;bc1.push_back(2); // solution 0 from Initial IPhreeqc instancestatus = phreeqc_rm.InitialPhreeqc2SpeciesConcentrations(bc_conc, bc1);
status = phreeqc_rm.SetSpeciesSaveOn(true);int ncomps = phreeqc_rm.FindComponents();int npecies = phreeqc_rm.GetSpeciesCount();const std::vector<std::string> &species = phreeqc_rm.GetSpeciesNames();
USE solution 2USE equilibrium_phases 2REACTION_TEMPERATURE100REACTION_PRESSURE50SAVE solution 2END
std::string str = "EQUILIBRIUM_PHASES 1-n; CO2(g) -3.4 10; END"phreeqc_rm.RunString(true,false,false,str);phreeqc_rm.RunCells();
phreeqc_rm.RunString(true,true,true,str);
oss << "EQUILIBRIUM_PHASES 1-" << N << "; CO2(g) -3.4 10";oss << "END" << "\n";phreeqc_rm.RunString(true,false,false,str);
oss << "SOLUTION 1" << "\n"; //Initial conditions for the workers phreeqc_rm.RunString(true, false, false, str);
oss << "SOLUTION 2" << "\n"; //Boundary condition for the transport model phreeqc_rm.RunString(false, true, false, str);
R-T loop
oss << "EQUILIBRIUM_PHASES 1-" << N << "; CO2(g) -3.4 10; END "; phreeqc_rm.RunString(true,false,false,str);