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 »
  • The command "save solution" doesn't work
« previous next »
  • Print
Pages: [1]   Go Down

Author Topic: The command "save solution" doesn't work  (Read 4725 times)

Zhaoyang

  • Top Contributor
  • Posts: 70
The command "save solution" doesn't work
« on: 25/10/20 14:15 »
Hi, everyone,

I met a problem in the attached input file. Why can't I use save solution 1 and then use solution 1? If I use save solution 1, I can't get correct answer. Any help will be appreciated.

Code: [Select]
SOLUTION 1
    units     mol/kgw
    Cl        1 charge
    Na        2

EXCHANGE 1
  X 1
  -equilibrate with SOLUTION 1

#SAVE SOLUTION 1 # I don't know why you can't use these three lines in here

#END

#USE SOLUTION 1

REACTION 1
K 1 Na -1   
3 mole in 100 steps

USER_GRAPH
-headings whatever 1_Normal
-axis_titles "Solution"  "Exchanger"
-axis_scale x_axis 0 1
-axis_scale y_axis 0 1
-initial_solutions false
-start
10 graph_x TOT("K")/(TOT("K")+TOT("Na"))
20 graph_y MOL("KX")/TOT("X")
-end

END

Best regards,
Zhaoyang
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4222
Re: The command "save solution" doesn't work
« Reply #1 on: 25/10/20 15:22 »
Let me explain how SAVE solution works.

First, SAVE solution has no effect on a simple SOLUTION calculation. SOLUTION 2 will not exist in this example. (Use SOLUTION 1-2, if you want to define two equivalent solutions.)

Code: [Select]
SOLUTION 1
SAVE solution 2
END

SAVE solution only occurs after a "reaction" calculation; that is when a solution reacts with another reactant--EXCHANGE, EQUILIBRIUM_PHASES, KINETICS, SURFACE, GAS_PHASE, SOLID_SOLUTION, MIX, REACTION, REACTION_TEMPERATURE, and (or) REACTION_PRESSURE. A simulation is defined by the data blocks between END statements. For a reaction to occur, a simulation must contain a SOLUTION (or SOLUTION_SPREAD) or a USE solution block plus one of the above-mentioned reactants. Alternatively, MIX, with or without additional reactants, is considered a reaction calculation.

So, in your case:

Code: [Select]
SOLUTION 1
EXCHANGE
-eq 1
SAVE solution 1
END

This sequence defines three calculations. There is an initial SOLUTION calculation, there is an initial EXCHANGE calculation that calculates the exchange composition in equilibrium with solution 1, and there is a reaction calculation that reacts solution 1 with exchange 1. The result of the reaction calculation is saved as solution 1; however, because the exchanger is in equilibrium with solution 1 by the initial exchange calculation, the reaction calculation does not change solution 1. The exchanger and solution are already in equilibrium.

Subsequently, you need to do the following to include the exchange reaction.

Code: [Select]
USE solution 1
USE exchange 1
REACTION 1
...
END

Here is the most explicit way to do the calculations:

Code: [Select]
SOLUTION 1
...
END
EXCHANGE 1
...
-eq 1
END
REACTION 1
...
END
USE solution 1
USE exchange 1
USE reaction 1
END

Logged

  • Print
Pages: [1]   Go Up
« previous next »
  • PhreeqcUsers Discussion Forum »
  • Beginners »
  • BASIC functions »
  • The command "save solution" doesn't work
 

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