Fixed Sg gfw and alkalinity in Amm.dat, phreeqc.dat, and pitzer.dat. Updated RELEASE.TXT

This commit is contained in:
David Parkhurst 2023-04-18 16:58:45 -06:00
parent 399344e2d5
commit ce92a0c10d

View File

@ -1,4 +1,62 @@
Version @PHREEQC_VER@: @PHREEQC_DATE@
-----------------
April 16, 2023
-----------------
PhreeqcRM: Added new methods to simplify getting and setting component and
aqueous species concentrations.
New methods:
GetIthConcentration(int i, std::vector<double>& c)--Gets the ith component concentration as
of the last RunCells calculation. Total number of components is retrieved with GetComponentCount.
GetIthSpeciesConcentration(int i, std::vector<double>& c)--Gets the ith aqueous species concentration as
of the last RunCells calculation. Total number of aqueous species is retrieved with GetSpeciesCount.
This method is for use with multicomponent diffusion, and SetSpeciesSaveOn must be set to true.
SetIthConcentration(int i, std::vector<double>& c)--Sets the ith component concentration; done after
transport calculations and before RunCells calculation. Total number of components is retrieved
with GetComponentCount. SetIthConcentration must be run for every component before RunCells is called.
SetIthConcentration(int i, std::vector<double>& c)--Sets the ith aqueous species concentration; done after
transport calculations and before RunCells calculation. Total number of aqueous species is
retrieved with GetSpeciesCount. This method is for use with multicomponent diffusion,
and SetSpeciesSaveOn must be set to true. SetIthSpeciesConcentration must be run for every aqueous
species before RunCells is called.
Fortran versions are
RM_GetIthConcentration(id, i, c)
RM_GetIthSpeciesConcentration(id, i, c)
RM_SetIthConcentration(id, i, c)
RM_SetIthSpeciesConcentration(id, i, c)
-----------------
April 14, 2023
-----------------
PhreeqcRM: Added new methods to simplify setting initial conditions.
New initial conditions methods:
InitialEquilibriumPhases2Module(equilibrium_phases);
InitialExchanges2Module(exchanges);
InitialGasPhases2Module(gas_phases);
InitialKinetics2Module(kinetics);
InitialSolutions2Module(solutions);
InitialSolidSolutions2Module(solid_solutions);
InitialSurfaces2Module(surfaces);
These methods are an alternative to InitialPhreeqc2Module, which used a 7 x nxyz array to
set all initial conditions in one method call. The new methods set only one reactant at a
time, and all methods use a single array of index numbers (referring to definitions in
the InitialPhreeqc instance) of length nxyz (the number of user grid cells). The methods
copy definitions from the InitialPhreeqc instance to define initial conditions in the
model cells.
Fortran implementation is as follows:
RM_InitialEquilibriumPhases2Module(id, equilibrium_phases);
RM_InitialExchanges2Module(id, exchanges);
RM_InitialGasPhases2Module(id, gas_phases);
RM_InitialKinetics2Module(id, kinetics);
RM_InitialSolutions2Module(id, solutions);
RM_InitialSolidSolutions2Module(id, solid_solutions);
RM_InitialSurfaces2Module(id, surfaces);
-----------------
April 3, 2023
-----------------
@ -82,95 +140,99 @@ Version @PHREEQC_VER@: @PHREEQC_DATE@
the YAML file with BMI_Initialize to execute the specified PhreeqcRM methods
to apply the data specified in the YAML file.
The following is represents the way BMI methods would be used to implement
The following represents the way BMI methods would be used to implement
a sequential, noniterative transport calculation:
PhreeqcRM phreeqc_rm(nxyz, nthreads);
phreeqc_rm.BMI_Initialize("myfile.yaml");
phreeqc_rm.Initialize("myfile.yaml");
int ncomps;
phreeqc_rm.BMI_GetValue("ComponentCount", &ncomps);
phreeqc_rm.GetValue("ComponentCount", &ncomps);
int ngrid;
phreeqc_rm.BMI_GetValue("GridCellCount", ngrid);
phreeqc_rm.GetValue("GridCellCount", ngrid);
std::vector c(ngrid*ncomps, 0.0);
phreeqc_rm.BMI_GetValue("Concentrations", c.data());
phreeqc_rm.BMI_SetValue("TimeStep", 86400);
phreeqc_rm.GetValue("Concentrations", c.data());
phreeqc_rm.SetValue("TimeStep", 86400);
for(double time = 0; time < 864000; time+=86400)
{
// Take a transport time step here and update the vector c.
your_transport(c);
phreeqc_rm.BMI_SetValue("Time", time);
phreeqc_rm.BMI_SetValue("Concentrations", c.data());
phreeqc_rm.BMI_Update();
phreeqc_rm.BMI_GetValue("Concentrations", c.data());
phreeqc_rm.SetValue("Time", time);
phreeqc_rm.SetValue("Concentrations", c.data());
phreeqc_rm.Update();
phreeqc_rm.GetValue("Concentrations", c.data());
}
The set of BMI methods is as follows:
std::string BMI_GetComponentName()
std::string GetComponentName()
Returns "PhreeqcRM".
double BMI_GetCurrentTime()
double GetCurrentTime()
Returns current time that has been set by the user.
double BMI_GetEndTime()
double GetEndTime()
Returns current time plus the time step.
int BMI_GetInputItemCount()
int GetInputItemCount()
Returns the number of variables that it is possible to set
with BMI_SetValue.
with SetValue.
std::vector<std::string> BMI_GetInputVarNames()
std::vector<std::string> GetInputVarNames()
Returns a list of the names of variables that can be set
with BMI_SetValue.
with SetValue.
int BMI_GetOutputItemCount()
int GetOutputItemCount()
Returns the number of variables that it is possible to retrieve
with BMI_GetValue.
with GetValue.
std::vector<std::string> BMI_GetOutputVarNames()
std::vector<std::string> GetOutputVarNames()
Returns a list of the names of variables that can be retrieved
with BMI_GetValue.
with GetValue.
double BMI_GetTimeStep()
double GetTimeStep()
Returns the current time step that has been set by the user.
std::string BMI_GetTimeUnits()
std::string GetTimeUnits()
Returns "seconds".
void BMI_GetValue(std::string name, void* dest)
void GetValue(std::string name, void* dest)
Returns a value or vector of values for the variable identified by name
void BMI_GetValuePtr(std::string name, void* dest)
void GetValuePtr(std::string name, void* dest)
Returns a pointer to current values of a variable. This method
is available for selected variables.
int BMI_GetVarItemsize(std::string name)
int GetVarItemsize(std::string name)
Returns the number of bytes needed for one element of the variable
identified by name.
int BMI_GetVarNbytes(std::string name)
int GetVarNbytes(std::string name)
Returns the total number of bytes neded to store the value or vector
of values identified by name.
std::string BMI_GetVarType(std::string name)
std::string GetVarType(std::string name)
Returns the type of the variable identified by name: "int", "double", or
"string".
std::string BMI_GetVarUnits(std::string name)
std::string GetVarUnits(std::string name)
Returns the units associated with the variable identified by name.
void BMI_Initialize(std::string config_file)
void Initialize(std::string config_file)
Same as InitializeYAML discussed above.
void BMI_SetValue(std::string name, void* src)
void SetValue(std::string name, void* src)
Sets the value or vector of values for the variable identified by name.
void BMI_Update(void)
void Update(void)
Calculates chemical reactions for a time step. It is equivalent to
the method RunCells. Equilibrium will be calculated between the solution
and all equilibrium reactants (EQUILIBRIUM_PHASES, EXCHANGE, etc), and
KINETICS will be integrated for the time step.
BMI is implemented in Fortran with USE BMIPhreeqcRM. Methods are nemed with a
prefix "bmif" and have an additional initial argument to identify the instance of
BMIPhreeqcRM that is being used.
-----------------
February 26, 2023
-----------------