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 »
  • USER_GRAPH Questions
« previous next »
  • Print
Pages: [1]   Go Down

Author Topic: USER_GRAPH Questions  (Read 197 times)

davidblevy

  • Frequent Contributor
  • Posts: 17
USER_GRAPH Questions
« on: August 29, 2022, 04:44:16 PM »
I'm trying to better understand how to set up input files for various USER_GRAPH applications. I made a simple transport file with two different inflow solutions (concentrations of NaCl (0.001 and 0.002 mol/L) in SOLUTION 0). Two questions I have about this file are: (1) Why USER_GRAPH 2 is plotting the concentrations from the first transport run when I use two graphs, and (2) how to modify the file so that the two different transport runs (two different SOLUTION 0 compositions) can be plotted on a single USER_GRAPH. I have been playing around with the placement of the END statements etc. but can't get figure it out. Any information on what I am missing would be appreciated, thank you.  David

SOLUTION 0
units mol/L
Na   1e-3
Cl   1e-3

SOLUTION 1-10
pH   7

TRANSPORT
-cell   10
-shifts 100
-punch_cells 10

END

USER_GRAPH 1
-headings Na_1
-axis_titles "Pore Volume" "Na, mol/L"
-axis_scale x_axis 0 10
-axis_scale y_axis 0 auto
-plot_concentration_vs x
-start
10 x= (STEP_NO + 0.5)/cell_no
20 PLOT_XY x, TOT("Na"), symbol = Plus, symbol_size = 2
-end
END

SOLUTION 0
units mol/L
Na   2e-3
Cl   2e-3

SOLUTION 1-10
pH   7

TRANSPORT
-cell   10
-shifts 100
-punch_cells 10

USER_GRAPH 2
-headings Na_2
-axis_titles "Pore Volume" "Na, mol/L"
-axis_scale x_axis 0 10
-axis_scale y_axis 0 auto
-plot_concentration_vs x
-start
10 x= (STEP_NO + 0.5)/cell_no
20 PLOT_XY x, TOT("Na"), symbol = Plus, symbol_size = 2
-end
END
Logged

dlparkhurst

  • Top Contributor
  • Posts: 2736
Re: USER_GRAPH Questions
« Reply #1 on: August 29, 2022, 06:27:15 PM »
If we define a "simulation" as the code between one END (or the beginning of the file) and the next END (or end of the file), then, by default, USER_GRAPH will apply from the simulation in which it is defined until the end of the run.

In your case, no USER_GRAPH is defined for the first TRANSPORT calculation, and both USER_GRAPHS are defined for the second TRANSPORT calculation.

The following code will plot both TRANSPORT simulations on the same graph with different symbols and different headings. Plotting of initial solution calculations (SOLUTION) is eliminated with -initial_solutions false. Plotting both TRANSPORT simulations on the same graph is a bit tricky, but -connect_simulations must be set to true during the first TRANSPORT calculation, then set to false, and finally set to true again for the second TRANSPORT calculation; the -heading is also changed for the second TRANSPORT simulation.

There is also USER_GRAPH; -active true/false that turns on and off graphing. I am actually not sure how the logic between -connect_simulations and -active works. It would require some trial and error.

Code: [Select]
SOLUTION 0
units mol/L
Na   1e-3
Cl   1e-3
SOLUTION 1-10
pH   7
TRANSPORT
-cell   10
-shifts 100
-punch_cells 10
USER_GRAPH 1
-headings Na_1
-axis_titles "Pore Volume" "Na, mol/L"
-axis_scale x_axis 0 10
-axis_scale y_axis 0 auto
-plot_concentration_vs x
-initial_solutions false
-connect_simulations    true
-start
10 x= (STEP_NO + 0.5)/cell_no
20 PLOT_XY x, TOT("Na"), symbol = Plus, symbol_size = 2
-end
END

USER_GRAPH 1
-connect_simulations    false
SOLUTION 0
units mol/L
Na   2e-3
Cl   2e-3
SOLUTION 1-10
pH   7
END

USER_GRAPH 1
-connect_simulations    true
-headings Na_2
TRANSPORT
-cell   10
-shifts 100
-punch_cells 10
END
Logged

davidblevy

  • Frequent Contributor
  • Posts: 17
Re: USER_GRAPH Questions
« Reply #2 on: August 31, 2022, 07:29:40 PM »
Very helpful, thank you! David
Logged

  • Print
Pages: [1]   Go Up
« previous next »
  • PhreeqcUsers Discussion Forum »
  • Beginners »
  • PHREEQC basics »
  • USER_GRAPH Questions
 

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