Skip to content

Commit

Permalink
Tony's tweak to transport, updated RELEASE.TXT
Browse files Browse the repository at this point in the history
  • Loading branch information
dlparkhurst committed Oct 17, 2024
1 parent 89aae60 commit 4fa78e0
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 deletions.
9 changes: 6 additions & 3 deletions doc/RELEASE.TXT
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Version @PHREEQC_VER@: @PHREEQC_DATE@
-----------------
October 8, 2024
-----------------
PHREEQC: Improved algorithem for transport of heat in TRANSPORT, and included
additional viscosity effects in transport calculations.
PHREEQC: Revised the multicomponent diffusion calculation of heat and solutes,
accounting now for the heat also for the T-dependent viscosity of the solutions.

-----------------
October 8, 2024
Expand All @@ -17,7 +17,10 @@ Version @PHREEQC_VER@: @PHREEQC_DATE@
October 8, 2024
-----------------
PHREEQC: Fixed bug in MIX that produced erroneous temperature and pressure
if the solutions being mixed did not have 1 kg of water.
if the solutions being mixed did not have 1 kg of water. (Note that PHREEQC does
not consider the heat content of the solutions when the temperature of the mixture
is calculated.)


Version 3.8.2: August 29, 2024
-----------------
Expand Down
7 changes: 5 additions & 2 deletions mytest/ex13_impl.out
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
WARNING: Database file from DATABASE keyword is used; command line argument ignored.
Input file: ex13_impl
Output file: ex13_impl.out
Database file: ../database/wateq4f.dat
Expand Down Expand Up @@ -262,6 +261,10 @@ Calculating transport: 10 (mobile) cells, 1 shifts, 338 mixruns...

WARNING: No porosities were read; used the value 3.00e-01 from -multi_D.
WARNING:
Calculating implicit transport: 10 (mobile) cells, 1 shifts, 15 mixruns, max. mixf = 10.
Calculating implicit transport: 10 (mobile) cells, 1 shifts, 16 mixruns, max. mixf = 10.


-------------------------------
End of Run after 1.322 Seconds.
-------------------------------

15 changes: 9 additions & 6 deletions src/transport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ struct MOLES_ADDED /* total moles added to balance negative conc's */
} *moles_added;
int count_moles_added;

#if !defined(NPP)
#if defined(_MSC_VER) && (_MSC_VER <= 1400) // VS2005
# define nullptr NULL
#endif
Expand All @@ -61,7 +62,7 @@ int count_moles_added;
# define nullptr NULL
# endif
#endif

#endif
#if defined(PHREEQCI_GUI)
#ifdef _DEBUG
#define new DEBUG_NEW
Expand Down Expand Up @@ -1842,7 +1843,7 @@ fill_spec(int l_cell_no, int ref_cell)
class master *master_ptr;
LDBLE dum, dum2, l_tk_x;
LDBLE lm;
LDBLE por, por_il, viscos_f0, viscos_f, viscos_il_f0, viscos, viscos_0;
LDBLE por, por_il, viscos_f0, viscos_f, viscos_il_f0, viscos, viscos0;
bool x_max_done = false;
std::set <std::string> loc_spec_names;

Expand Down Expand Up @@ -1914,13 +1915,15 @@ fill_spec(int l_cell_no, int ref_cell)
* correct diffusion coefficient for temperature Dw(TK) = Dw(298.15) * exp(dw_t / TK - dw_t / 298.15), SC data from Robinson and Stokes, 1959
* and viscosity, D_T = D_298 * viscos_0_298 / viscos_0_tk
*/
sol_D[l_cell_no].viscos_0 = viscos_0 = Utilities::Rxn_find(Rxn_solution_map, l_cell_no)->Get_viscos_0();
sol_D[l_cell_no].viscos = viscos = Utilities::Rxn_find(Rxn_solution_map, l_cell_no)->Get_viscosity();
sol_D[l_cell_no].viscos_0 = viscos0 = Utilities::Rxn_find(Rxn_solution_map, l_cell_no)->Get_viscos_0();
if (!sol_D[l_cell_no].viscos_0)
sol_D[l_cell_no].viscos_0 = viscos0 = viscos;
/*
* put temperature factor in por_factor which corrects for porous medium...
*/
dum = viscos_0_25 / viscos_0;
dum2 = viscos_0 / viscos;
dum = viscos_0_25 / viscos0;
dum2 = viscos0 / viscos;
viscos_f0 *= dum;
viscos_il_f0 *= dum;
viscos_f *= dum2;
Expand Down Expand Up @@ -2129,7 +2132,7 @@ fill_spec(int l_cell_no, int ref_cell)
if (s_ptr->dw_a_v_dif)
{
sol_D[l_cell_no].spec[count_spec].dw_a_v_dif = s_ptr->dw_a_v_dif;
sol_D[l_cell_no].spec[count_spec].Dwt *= pow(viscos_0 / viscos, s_ptr->dw_a_v_dif);
sol_D[l_cell_no].spec[count_spec].Dwt *= pow(viscos0 / viscos, s_ptr->dw_a_v_dif);
}
else
sol_D[l_cell_no].spec[count_spec].dw_a_v_dif = 0.0;
Expand Down

0 comments on commit 4fa78e0

Please # to comment.