state
-state <:int:option>
-state <:txt:option>
Keyword CALCULATE_VALUES
Identifies the functionality of a script defined by CALCULATE_VALUES.
If -state is omitted, the default use is assumed.
|
option |
int or txt |
Positive number or txt to identify the functionality of the script. Default: Default or 0 |
Functions
|
Option Number |
Option |
Option (Alternative) |
Main use |
Notes |
|
0 |
Default |
|
Use as in PHREEQC |
|
|
1 |
|
Single execution, e.g. definition of global variables |
Scripts are executed once just after reading the scripting block. |
|
|
2 |
Initial |
|
To calculate initial values |
Scripts are executed once for each node just before the transport simulations (see flowchart of HPx) By using this option, global variables can be defined using the basic statements put()/put_val(), put_var(), put_def(), put_node(). The save() does not save any result of the script with this functionality. |
|
Update |
|
To update porosity and scaling factors of the linear model for spatial-temporal variation |
During the transport simulations, these scripts are executed for each node and at each time step just after the geochemical calculations (see flowchart of HPx). The scripts can be used to update porosity and the scaling factors of the linear model for spatial-temporal variation if -update hp is set in reactive_transport. Porosity and scaling factors are changed with change_por(), update_sfwater() and change_sfwater(). They also can be used to calculate and save geochemical variables that are needed in other scripts (e.g. those related to update tortuosity) with script functions as put()/put_val(), put_var(), put_def(), put_node(). The save() does not save any result of the script with this functionality. |
|
|
TortuosityWater |
tortw |
To update the tortuosity in the water phase |
During the transport simulultion, these scripts are executed for each node and each time step after solving water flow equation and heat transport equation for the given time step when the identifier -update tortw in the data block REACTIVE_TRANSPORT is set true. To calculate the tortuosity, following variables can be used: (i) the water content of the current time step, (ii) the temperature of the current time step and (iii) the porosity and the geochemical variables stored as global variables by put()/put_val(), put_var(), put_def(), put_node() from the previous time step or by using a script block with the -state update and the identifier -update hp in the data block REACTIVE_TRANSPORT is set true. Only a limited number of number of PHREEQC-specific script functions can be used. See: List of valid BASIC-Statements. A save() statement is needed to store the result (i.e., the tortuosity of the water phase for a given node and a given time step) of the script block |
The full geochemical information through script functions is only available for the functionalities 'default', 'initial', and 'update'. These three options are related to a node with corresponding solution, exchange and surface sites, solid phase, gas phase and kinetic reactants. The functionality 'update' can save geochemical variables to be used in other functionalities.
List of valid script functions
Only following PHREEQC related script functions can be used in -state tortw:
- cell_no
- get / get_val
- get_def
- put
- put / put_val
- tc
- tk
- tot
Examples
How to
Change transport properties - Porosity (scaling factor of water content)