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 »
  • Processes »
  • Dissolution and precipitation »
  • complex problem
« previous next »
  • Print
Pages: [1]   Go Down

Author Topic: complex problem  (Read 2800 times)

PrestoConFuoco

  • Frequent Contributor
  • Posts: 16
complex problem
« on: 27/02/19 15:31 »
I have a problem:
Firstly, i have a solution with a lot of salts. Then some water is evaporated, and some salts precipitate (assume that M kg at all), and some solution (assume that N kg of it) of some composition remains in the equilibrium with solid phases.

But in real conditions some solution is taken with precipitated salts, about 10% mass. So mass of precipitate becomes 1.1*M, and mass of solution becomes (N - 0.1*M).
After first simulation i can SAVE solution 1. But for second simulation i need not N kg, but (N - 0.1*M).
The good option is MIX of obtained solution with "negative quantity of water". But as far as i understand, parameters of MIX keyword maybe only constant values, entered by the user, and the parameter i need depends on the quantity of precipitate (M kg).

How to deal with this problem?
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4037
Re: complex problem
« Reply #1 on: 27/02/19 16:32 »
If you are talking about the mass of water in hydrated minerals, it is accounted for and removed from the solution. The following example precipitates about 10 mol of CaCO3:2H2O, so about 20 mol of H2O are removed from solution. The solution that is saved has only 0.64 kg of water.

Code: [Select]
SOLUTION
-units mol/kgw
Ca 10
S(6) 10
EQUILIBRIUM_PHASES
Gypsum 0 0
SAVE solution 2
END
Logged

PrestoConFuoco

  • Frequent Contributor
  • Posts: 16
Re: complex problem
« Reply #2 on: 27/02/19 17:39 »
Quote from: dlparkhurst on 27/02/19 16:32
If you are talking about the mass of water in hydrated minerals, it is accounted for and removed from the solution. The following example precipitates about 10 mol of CaCO3:2H2O, so about 20 mol of H2O are removed from solution. The solution that is saved has only 0.64 kg of water.

Code: [Select]
SOLUTION
-units mol/kgw
Ca 10
S(6) 10
EQUILIBRIUM_PHASES
Gypsum 0 0
SAVE solution 2
END

No, i mean that extra water (not in structure of hydrates), that is taken by precipitate; i.e. it's somewhat like "wet precipitate".

UPD:
In fact, the question is: how to calculate some quantity within the BASIC interpreter so that it could be possible to use it in the MIX block.

Something like
Code: [Select]
-start
...
x = <some formula>
PUT(x)
...
-end


MIX 2
H2O -1
GET(x)  # this is a quantity of reaction added to system

(i know that it's not possible to use GET outside BASIC fragments, but this is something a would want to get)
« Last Edit: 27/02/19 21:37 by PrestoConFuoco »
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4037
Re: complex problem
« Reply #3 on: 27/02/19 22:24 »
You can write code from Basic and then run it with INCLUDE$. Look at example 8 (and 21).

You can also use IPhreeqc in programming languages of PhreeqcCOM in scripting languages (VBA in Excel for example).

Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4037
Re: complex problem
« Reply #4 on: 27/02/19 23:40 »
Why not just add some hydration water to the formula for each of the minerals?

PHASES
NaCl+Water
NaCl:0.1H2O = Na+ + Cl- + 0.1H2O
Logged

PrestoConFuoco

  • Frequent Contributor
  • Posts: 16
Re: complex problem
« Reply #5 on: 28/02/19 01:16 »
Quote from: dlparkhurst on 27/02/19 22:24
You can write code from Basic and then run it with INCLUDE$. Look at example 8 (and 21).

You can also use IPhreeqc in programming languages of PhreeqcCOM in scripting languages (VBA in Excel for example).

Thank you! The "INCLUDE$" option is one of the great things of this world, it seems like PHREEQC really becomes a program for modeling technological lines ;)
Logged

  • Print
Pages: [1]   Go Up
« previous next »
  • PhreeqcUsers Discussion Forum »
  • Processes »
  • Dissolution and precipitation »
  • complex problem
 

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