PhreeqcUsers Discussion Forum

USER_PUNCH/USER_GRAPH => BASIC functions => Topic started by: amargert on February 20, 2019, 03:08:03 PM

Title: Single SELECTED_OUTPUT file for a simulation sequence
Post by: amargert on February 20, 2019, 03:08:03 PM
Hello!

Please, consider the following problem: there is a number of grid blocks filled with water-CO2 solution. Pressure and CO2 concentration are unique for each grid block. The aim is to create a single SELECTED_OUTPUT file for all the grid blocks. Input file is constructed as follows:

SOLUTION 1
    ...
    pressure X_1
    ...
EQUILIBRIUM_PHASES 1
    CO2(g)   A_1  B_1

KINETICS 1
Calcite
    ...
USER_PUNCH
-headings   si(CO2) si(H2O) Molality_CO2(aq) dens(kg/l) fugacity_CO2 Pres(atm) init_mol curr_mol
10 PUNCH    SI("CO2(g)"), SI("H2O(g)"), MOL("CO2"), RHO, PR_PHI("CO2(g)"), PRESSURE, M0, M

SELECTED_OUTPUT
    -file                 selected_out.txt
    -selected_out   true
    -user_punch     true
    -reset              false
END

SOLUTION 1
    ...
    pressure X_2
    ...
EQUILIBRIUM_PHASES 1
    CO2(g)   A_2  B_2

KINETICS 1
Calcite
    ...
USER_PUNCH
-headings   si(CO2) si(H2O) Molality_CO2(aq) dens(kg/l) fugacity_CO2 Pres(atm) init_mol curr_mol
10 PUNCH    SI("CO2(g)"), SI("H2O(g)"), MOL("CO2"), RHO, PR_PHI("CO2(g)"), PRESSURE, M0, M

SELECTED_OUTPUT
    -file                 selected_out.txt
    -selected_out   true
    -user_punch     true
    -reset              false
END
# and so on...

This script writes current simulation results to the file erasing the previous data. Is it possible to keep a single file holding the specified SELECTED_OUTPUT data from all simulations within a script?
Any help is much appreciated!

Best regards,
Andrei
Title: Re: Single SELECTED_OUTPUT file for a simulation sequence
Post by: dlparkhurst on February 20, 2019, 04:13:40 PM
If you eliminate the second definitions of SELECTED_OUTPUT and USER_PUNCH, all results go to one file.
Title: Re: Single SELECTED_OUTPUT file for a simulation sequence
Post by: amargert on February 20, 2019, 06:40:11 PM
Works perfectly now! Much obliged!