mirror of
https://git.gfz-potsdam.de/naaice/iphreeqc.git
synced 2025-12-16 00:28:23 +01:00
2243d25 Merge commit '013c822f76e5dc2e4fc19e87c6e5777aea6151d2' c1af6f3 added newlines for CRAN 013c822 added newlines for CRAN e4bd9ba [phreeqc3] fixes -Wclass-memaccess warnings for CRAN 29f06d2 fixed alignment in Description of solution 09a2680 guarded write_banner with NO_UTF8_ENCODING 082edbb changed src/print.cpp back to windows-1252 encoding; updated check_utf.sh 8d7c1fc adding mcd_Jtot and mcd_Jconc 9f0f622 Merge branch 'master' of github.com:usgs-coupled/phreeqc3 1040066 Merge remote-tracking branch 'usgs-coupled/master' 2a94644 cleaned up to eliminate some prints 07a864d all jacobians are consistent. Looks pretty good. 56975a7 Saved surface for numerical derivatives df0d68b Runs all the test cases. Numerical derivatives work, but still some changes in residuals before and after jacobian calculations. 6bd936e Fixed numerical derivative (non-pitzer) 0dde2b0 removed comments aef51fa Finally have derivatives right, I think 20281a0 always reset gases 13ec2fc best I could do for H2S while maintaining old tests. Used INCREMENTAL reactions 8be1ba8 revised jacobian_pz with new logic. Works with fixed_pressure examples H2S, H2S_pz, H2S_pz_appt, H2S_NaCl_Na2SO4. 71cf2a9 still produces different residuals 9022ded Tony H2S. Amm.dat, phreeqc.dat, pitzer.dat, utf8, updated test cases cb1f9af Finished up C, Fortran, documentation. Need to check DOxygen 9dad447 Merge remote-tracking branch 'origin/master' into state d647eec Added StateSave, StateApply, StateDelete with documentation for C++. Need testing, Fortran, and C 48cb5e8 Including OH- in converting units. Revised calculated density for H+ and OH-. Makes a difference in several test cases. Removed timing at end of .out in test cases. Checking in all test cases and selected output. 47e1ce5 added OH in density iteration calculation, test case NaOH_density 4aefb06 allow Fe(+3), equivalent to Fe(3), in TOT and TOTMOL. Previously fixed in SELECTED_OUTPUT -total bea0ad1 unused variable, punch Fe(+3) eaf788b fixed add_constant, undefined surface null pointer, added test cases 2212f9c fixed bug in reprep when sit had surface species. Added capability of sit + edl, have not tested it 79956e3 made tally_table a vector of class tally 58b0d1f Merge commit 'd77c11ec700085f19b76af6543013e23ee0739d3' d77c11e [phreeqci] fixed header error with phast 63175ab [phreeqci] fixed header error with phast 0feb715 [phreeqci] fixed WINDOWS.H already included error on windows builds 123cc8a [phreeqci] fixed _ASSERTE error on linux builds 22c4a62 [phreeqci] struct to class changes 4cee19d Merge commit '2d8ca2d0f37d13ad67be582208a4e65edfcf702f' 2d8ca2d [phreeqci] added 'new' debugging d0c8212 [phreeqci] added 'new' debugging 9661fea tokadd_heading leak 4565c5d catching upMerge remote-tracking branch 'origin/master' into classify c22d792 fix notab leak 6d2b45a Merge remote-tracking branch 'usgs-coupled/master' 38cfe18 memory leak user_print, pitz/sit store, add uphill_NPa, remove TESTINT 24f9bf7 removed TESTING definition e2ce928 Tony agreed with change for all_cells, new test case d2a5d63 reset all_cells in all cases e3c0d61 initialize aphi c960e05 builds on vs2005; still needs to initialize class pitz_param* aphi 71dc944 cl1mp, bad initialization 2e5f255 fixed errors/warnings from ming and intel 369733e converted to classes 7961b16 release.txt, couple size_t 5d76f82 copy operator works well enough 7ce8947 updated InternalCopy for operator equal 7bd13ff new/delete theta params, pitz_param_copy 50e8903 new/delete pitz_params 87d6792 reverting changes to sit_params and theta_params. Will consider using new and delet dcb9efe sit_params ac3335e theta_params 8878232 delete rate, unused cptr 492df61 descriptions 25e0621 cell_data 051ddba stag_data 33157a2 fixed more size_t and initialized all structs f86f430 back to original set of files I think af1b761 removing CReaction and Classes files 006d1de reorganizing 287f81c elt_list vectorized 7228bd0 move struct rxn_token 28de8b5 more size_t d2e3a4e Removed cxxChemRxn ce64720 cleaned up, removed struct reaction 028e908 moving to CReaction dc2dc53 vectorized token 9fd3f2a save_values rewritten with map 8a6cef5 vectorized save_values 8685225 fixed clang errors, needed .c_str 318e267 (size_t) max and count 1547d91 finished up spread b5c7ba4 going to work on warnings 4c848b4 all inverse structures vectorized. Starting on solver workspace 980d58e finished vectorizing struct inverse. Need to do sub structs d13bb76 removed count_elts 89ab28d vector inverse elts d575ade tidy.cpp, title_x 16fd18f removed string_duplicate from prep.cpp 82a10d6 revised get_elt and get_token d7e3be4 cleaned up some string_duplicate 76366a6 fixed processing file names 157a458 description_x 51fec19 class_main c748922 added const qualifier for all the parsing 380a6ea methods set to const, variables need to follow 6d67e22 copier and dash 48e6b93 fixed a new master, advection punch_temp and print_temp, some tidying 5f21daf unknown->master now a vector. Using size instead of a null to end list. 3c432d0 user_graph commands, alk_list 2b14f80 last_model 7a6b8b6 Merge branch 'warnings_redux' into vectorize_2 885a2f7 Fix memory bug in ex13_impl, tweak Makefile. 6907bb0 base, sit arrays 90e8412 starting on pitzer bd0cad9 vector kinetics arrays 1850c32 basic commands are now std::string 78a83ed c,d in polint d82d5d6 vector llnl parameters, removed hash references 7c538b6 Revert "delete s[i]" 97bcfd7 Merge branch 'warnings_redux' into vectorize 15a8991 delete s[i] 0b19404 master new/delete b100f85 more new/delete. Fixed str_tolower for ming fd93f84 needed to new/delete species and phase structs 1986e00 alphabetize tokens ee6fa53 bool analytic cc614e6 add_logk for logk, species, phases 67447c5 Removed hashtable, all hashes have been replaced with maps. ee7d2c5 replaced hash for isotope_ratio, isotope_alpha, calculate_value with maps. Fixed some case errors with new maps. 52e0622 replase master_isotope_hash_table with master_isotope_map c01c8d6 replace logk_hash_table with logk_map. Added str_tolower(std::string) 3e69461 replaced phases_hash_table with phases_map effafe0 replace species_hash_table with species_map 8bff6d3 removed HASH code. replaced elements_hash_table with elements_map 90e9ee0 removed ineq_init. Vector advection_print, advection_punch 2f38047 size_t for subscripts 5161ea7 Merged origin/master, Alphabetized Basic toks f8e05c1 only call qsort with more than one element 1ab8641 remove _v, use std::vector only, alloc at least 1 scratch 9732a1c cannot qsort size 0 vector 67fc478 one more .data 2f0f5e1 Some replacements of .data() were incorrect ba9813a remove .data() 43765f8 need <struct xxx> 0feb20d after merging origin/master, one fix needed f136feb Merging origin/master. Merge remote-tracking branch 'origin/master' into warnings_redux 71aa5b9 bug count_sys not incremented e43550c vector inverse d4cc14e vector x 6c0edef vector rates e3cc46a vector save_values 41b9965 vector species_list 449a54f vector mb_unknowns 51514eb vector delta, sum_jacobx f0707aa vector sum_mb1, sum_mb2 7d303de vector trxn.token 83cfb29 elt_list, moved qsort to elt_list_combine e8c9027 vector elt_list 0957a52 vector theta_params b1af156 vector pitz_params e3ea010 vector sit_params b87d0cd vector my_array, residual, delta e43471a vector s_x 622d361 vector s_x 3d41ef8 vector logk e8dd208 vector sys 3c9f594 vector master de1ba62 vector s e7c78a8 vector phases f2c64fe vector elements e8af689 vector isotope_alpha ba2601a vector isotope_ratio 76da4f8 finished master_isotope 4bb1c80 vector master_isotope 97e574d vector calculate_value** 9d9fbfb cl1 variables converted to std::vector 1e0d410 using memset 54b0d4d starting on space 5a649c2 Merge pull request #2 from usgs-coupled/gasphasepressures a992537 (void)sscanf, removed SKIP, removed PHREEQ98 6a5bb8a Merge pull request #1 from usgs-coupled/mar10 d9ced82 Fixed uninitialized constructors and couple of other warnings c79d2c2 working on UTF-8 fcee4d5 Added delta_h_species, delta_h_phase, dh_a0, dh_bdot Basic functions 81e862d Tonys changes Mar 10. SIs in inverse calulations 9e8b382 Merge remote-tracking branch 'usgs-coupled/master' 053b4c6 Merge remote-tracking branch 'origin/master' 20091aa Merge branch 'log10molalities' into gasphasepressures 41e1112 Last of changes for GetGasPhasePressures and GetGasPhasePhi, openmp and mpi. MPI fortrans not tested. e1f9cb1 more checking in. Should be down to tweaks for SetGasPhaseMoles. 00ee6e3 C++ is working with OpenMP and MPI for Get/SetGasPhaseMoles. Need to add c and F90. c3a3153 Added GetSpeciesLog10Molalities. Tested OpenMP with VS. Tested MPI with MinGW. Fortran, C, and C++ seem to work. e8b11f3 added optional 6th argument to Basic function sys to change sort order from molality or moles to the name. Added synonym PAD$. Added new mytest/sys_sort. 3e4fc7e cleanup commented lines 54b992f working on tabs and no newline 2181847 Merge branch 'master' of https://github.com/usgs-coupled/phreeqc3 deeecb0 needed strexpr in ADD_HEADING to allow expressions 9b7785f [iphreeqccom] updated date 711b1d0 Merge commit '608e74f5d3c55a4d91a4e08d86f2fd6df0ce0a05' 608e74f [wphast] updated date 5128e13 [phreeqc3] updated image location fba8ae2 [phreeqc3] updated image location 43988f0 initialize punch_newline 176fb02 Moved initialization from header to constructor, special characters in As.out c9f796a added ADD_HEADING for IPhreeqc 1362f0f Added EOL_NOTAB$ and NO_NEWLINE$, updated release notes 2b4dbbd Merge commit 'cd51d8aeed46909e5f028a19089acfef43d6ede9' f2023c4 Merge branch 'gtest' into 'master' cd51d8a reset for dlls 54161f4 reset for dlls 01c99a7 Merge remote-tracking branch 'github/master' 23f3917 Merge remote-tracking branch 'scharlton2/master' f6644e6 check for null pointer. Encoding for .out file 9319c9d Merge commit '5b816fa1fd82eb94e2702b6bd9df6066fb71267b' 5b816fa added src/phreeqcpp/common/PHRQ_exports.h 07717b1 added src/phreeqcpp/common/PHRQ_exports.h d8c638f Merge remote-tracking branch 'origin/master' into gtest 87bbb6a adjusted alignment for utf-8 strings 03bda16 added write_banner to non-DOS and added UTF8 define 995de52 converted to utf-8 fc8fe3e re-added src/ZedGraph.dll fbae3e9 code change for extending porosity definition. Change to TonyLitharge2a 46257e7 added googletest and fixed some minor bugs 13ca055 added googletest and fixed some minor bugs f1dda6c Fixed problem with exchange-related when exchanger is defined as CaX2 20daad4 I guess cxxSurface::NO_EDL is correct 801812d Tony's changes to implicit Nernst-Planck calculation 6b4892c added Basic function DEBYE_LENGTH and test case zeta 921ab10 Changed tidy_exchange_min and tidy_exchange_kin to tidy only for new_def and n_user >= 0. Fixed bug if surf_charge not defined for NO_EDL. Added test MoreExchMix 2aef60a Finished up surface and exchange related for cases where related phase or kinetic reaction was modified. Proportionality should now be maintained. Added test cases. 569e1e1 Exchange related. Needed to update in case the related entity changed. ea54e02 Free str in callback in PBasic a87cd1f Merge commit '1871b026ca8487c23a025415dbc0b2eca01f9af4' 1871b02 fixed some c2011 warnings, added more info for -formula errors, fixed pressure llnl examples aa4d023 fixed some c2011 warnings, added more info for -formula errors, fixed pressure llnl examples e1465e3 Commit from David's Email 2020-05-22; Implementing llnl-type databases with higher temperature nad pressure e18e1ec Tony bug fix for TRANSPORT. Harmonic mean for boundary? Added Cub example. 44f077e Merge commit 'e68934133fc9cd45e7cccc397c55e13f7ee92e5b' e689341 [phreeqci] Testing subtree merges 4f34fd0 [phreeqci] Testing subtree merges 69c0bb3 fixed conflict on merge 55c4dba Merge commit 'b25fc5bdd48b6d3ab8d677f7d38ad3a462789500' b25fc5b fixed conflict on merge ca80be6 fixed conflict on merge 49a74a6 [phreeqc3] Testing subtree merges aec6f90 [phreeqc3] Testing subtree merges c4c224a Merge commit '84865ad5ac30a9edb86c89ced4194d127ee896fd' 0bf4138 Merge commit '4a8727cecd9fefd1587485820e913c0e666b77d9' 553875f Merge commit 'aab8bc12ea8be8aec5943e1c77a54b19d28168cb' aab8bc1 Merge commit '84865ad5ac30a9edb86c89ced4194d127ee896fd' 7bd02ff Fixed bug with more porosities than cells in TRANSPORT. Added silica sorption to databases. Revised CalPortDiff 84865ad Added .gitlab-ci.yml d398195 Added .gitlab-ci.yml 40c2787 Added .gitlab-ci.yml 3b6ce6c Added .gitlab-ci.yml daf64a1 Added .gitlab-ci.yml ae06f35 Fixed GFW bug on new elements in TRANSPORT 9cc783b added Basic functions for PHAST: velocity_x, velocity_y, velocity_z, transport_cell_no 79f768a Merge branch 'master' into 'master' bd7634a removed j = j in loop 542394c IPhreeqc: ifdef'd out references to std::cerr and std::cout 6067ce8 Merge branch 'implicit3' into 'master' 21bd20f Fixed more compile warnings. Removed andra_kin_ss from testing, results are inconsistent between Linux and Windows, presumably the ifs in RATES 97b9c58 Merge branch 'implicit3' into 'master' 45db5cf Another Linux warning, lower tol on andra_kin_ss. 443be1c Merge branch 'implicit3' into 'master' 9a29aaf Last Linux compile warnings. Added more precision to andra_kin_ss. 6dafd7d Merge branch 'implicit3' into 'master' fbde633 Fixing Linux compiler warnings, checking in new regression test files. 2207711 Merge branch 'implicit3' into 'master' 77e36a2 Tony fixed some transport, revised colloid_U. New cases added to Makefile. f07caf9 Changed back print to allow incremental_reactions to work correctly beadd07 Merge commit '5947da90657d1cb8f832152b4573dca0bbefb49e' 6a49d41 changes to make related and mixing items independent of case. surface_mix test case. 5947da9 initial Tony changes 8089c10 initial Tony changes 009aec7 Merge remote-tracking branch 'coupled/master' 4676ee4 added more P-R gas paramteters c07314c Merge commit '492a4d257f300b7a9e0b5dc7e212c8f85ecb7f6e' 492a4d2 Merge remote-tracking branch 'coupled/master' 81ca633 Merge remote-tracking branch 'coupled/master' 950fca2 CRAN: replaced deprecated std::ptr_fun with lambda function 597bcd7 CRAN: replaced deprecated std::ptr_fun with lambda function 044e0ea phreeqc_ptr bug in internal copy 5934297 Merge commit '5c53fb207238bc0e846123a7e0d71a48bd9976ab' 5c53fb2 Merge commit '1327e93127e40e7a55ec629dcc9dd91ec29e77fe' c117e18 Tony fix of index error b90ddb5 Fixed Tony's fix, added implicit_as example 03acc3f changed abs to fabs 1fef40e added implicit, max_mixf to internal copy 32939ba Merge commit '1327e93127e40e7a55ec629dcc9dd91ec29e77fe' b3bf691 fixed > > in templates for gcc c929113 Tony fix May 31 1327e93 Implicit seems to be working with Tony's latest changes 55ea163 Implicit seems to be working with Tony's latest changes c7111f7 Sort of works, still bugs and serious errors compared to explicit 600c7ee Fixed some bugs with iso.dat inverse modeling, added test case. Still does not generate [13C](4) and [13C](-4) from SOLUTION 2291700 Fixed gas_phase_mix bug, added test case 035a4e0 Tony tweak to transport.cpp bd4fc25 Merge branch 'tony20190117' into 'master' 71c994b skipping restart 1257f8c Merge branch 'issue-3' into 'master' ce33478 Fixed -Wcatch-value warnings reported by CRAN 040fd95 include restart, remove ex20_debug d57264d 2. changes to solid solution numerical method 3fd8155 changes to solid solution numerical method 2b14a94 Tony's changes 20190117 ae6e8b0 added modify methods for restart files b500c54 changed restart file to include UZ fffac6d another try for ex20_debug fa5ee50 fix problem with ex20_debug d993901 encoding, limit.h 92c81f9 Revised logic for nmix 3cc84da Merge remote-tracking branch 'coupled/master' into ss_trans 56b5bf3 create valid ranges when sscanf doesn't return 2 c43c9af tweaked ss, changed surf function per Kinniburgh b10df16 Corrected syntax of integer limit, previous commit actually changed ss convergence parameter, used to multiply by 0.99 d74c8ff Corrected syntax of integer limit 906cfd4 Check value of nmix 058375c removed check of ss when sum of components is small 2977db4 Tonys fix to diffusion bug with porosity change f904467 revised lists to be cumulative for eq, gas, kin, ss 9285985 merging coupled/master into copy 7c23b62 Fixed string_duplicate memory error 2d5551a fixed sc7 for copy and initial time 4842d9e inverse iter 100000; finished copy operator; a bit more testing to go 4eefe43 ex20_debug fix 78e39cd still debugging copy cee10e7 fixing bugs in copy operator ebab4bc fixing bugs in copy operator 5a35e02 Fixed Linux warnings, memory errors b86f793 Beginning to test copy operator 5d40e69 [IPhreeqc] added parens for clang++ -Wlogical-op-parentheses 936de38 removed register keywords and updated for misc clang warnings ec9de4c beginning of checking copy operation ebeddcd [iphreeqc] Changes for CRAN 3.4.7 9592d6e Merge branch 'dlpark-phreeqc3-TonyApr2018' into 'master' 7c0fb65 [phreeqc3] needed to check gas phase type for same model, added test case 9152ca2 Closes #1 ebc4f69 Merge branch 'dlpark-phreeqc3-TonyApr2018' into 'master' 97a0cec Fixed bug where 1W was interpreted as an isotope 2deb4ed added option -ddl to surface. Added test case df7d5de Merge branch 'gammas' into 'master' 34abb5b gammas finished, working on reactants 5314827 Tony's changes; diffuse layer with pitzer 4271ca4 Tonys corrections, added balonis test 2e390fd commit fix for Mtg git-subtree-dir: phreeqcpp git-subtree-split: 2243d25babbc524e7875b3d591bb6b91c4399a95
1654 lines
36 KiB
C++
1654 lines
36 KiB
C++
#ifndef _INC_GLOBAL_STRUCTURES_H
|
|
#define _INC_GLOBAL_STRUCTURES_H
|
|
#include "Surface.h"
|
|
#include "GasPhase.h"
|
|
/* ----------------------------------------------------------------------
|
|
* #define DEFINITIONS
|
|
* ---------------------------------------------------------------------- */
|
|
#ifndef NAN
|
|
# define NAN -99999999
|
|
#endif
|
|
#define MISSING -9999.999
|
|
#include "NA.h" /* NA = not available */
|
|
|
|
#define F_C_MOL 96493.5 /* C/mol or joule/volt-eq */
|
|
#define F_KJ_V_EQ 96.4935 /* kJ/volt-eq */
|
|
#define F_KCAL_V_EQ 23.0623 /* kcal/volt-eq */
|
|
#define R_LITER_ATM 0.0820597 /* L-atm/deg-mol */
|
|
#define R_KCAL_DEG_MOL 0.00198726 /* kcal/deg-mol */
|
|
#define R_KJ_DEG_MOL 0.00831470 /* kJ/deg-mol */
|
|
#define EPSILON 78.5 /* dialectric constant, dimensionless. Is calculated as eps_r(P, T) in calc_dielectrics. Update the code?? */
|
|
#define EPSILON_ZERO 8.854e-12 /* permittivity of free space, C/V-m = C**2/m-J */
|
|
#define JOULES_PER_CALORIE 4.1840
|
|
#define PASCAL_PER_ATM 1.01325E5 /* conversion from atm to Pa */
|
|
#define AVOGADRO 6.02252e23 /* atoms / mole */
|
|
#define pi 3.14159265358979
|
|
#define AH2O_FACTOR 0.017
|
|
|
|
#define TRUE 1
|
|
#define FALSE 0
|
|
#define OK 1
|
|
#define ERROR 0
|
|
#define STOP 1
|
|
#define CONTINUE 0
|
|
|
|
#define OPTION_EOF -1
|
|
#define OPTION_KEYWORD -2
|
|
#define OPTION_ERROR -3
|
|
#define OPTION_DEFAULT -4
|
|
#define OPT_1 -5
|
|
|
|
#define DISP 2
|
|
#define STAG 3
|
|
#define NOMIX 4
|
|
#define MIX_BS 5 // mix boundary solutions in electromigration
|
|
|
|
#define CONVERGED 2
|
|
#define MASS_BALANCE 3
|
|
|
|
#define REWRITE 2
|
|
#define INIT -1
|
|
|
|
/* check_line values, plus EMPTY, EOF, OK */
|
|
#define KEYWORD 3
|
|
|
|
/* copy_token values */
|
|
#define EMPTY 2
|
|
#define UPPER 4
|
|
#define LOWER 5
|
|
#define DIGIT 6
|
|
#define UNKNOWN 7
|
|
#define OPTION 8
|
|
|
|
/* species types */
|
|
#define AQ 0
|
|
#define HPLUS 1
|
|
#define H2O 2
|
|
#define EMINUS 3
|
|
#define SOLID 4
|
|
#define EX 5
|
|
#define SURF 6
|
|
#define SURF_PSI 7
|
|
#define SURF_PSI1 8
|
|
#define SURF_PSI2 9
|
|
|
|
/* unknown types */
|
|
#define MB 10
|
|
#define ALK 11
|
|
#define CB 12
|
|
#define SOLUTION_PHASE_BOUNDARY 13
|
|
#define MU 14
|
|
#define AH2O 15
|
|
#define MH 16
|
|
#define MH2O 17
|
|
#define PP 18
|
|
#define EXCH 19
|
|
#define SURFACE 20
|
|
#define SURFACE_CB 21
|
|
#define SURFACE_CB1 22
|
|
#define SURFACE_CB2 23
|
|
#define GAS_MOLES 24
|
|
#define SS_MOLES 25
|
|
#define PITZER_GAMMA 26
|
|
#define SLACK 28
|
|
/* state */
|
|
#define INITIALIZE 0
|
|
#define INITIAL_SOLUTION 1
|
|
#define INITIAL_EXCHANGE 2
|
|
#define INITIAL_SURFACE 3
|
|
#define INITIAL_GAS_PHASE 4
|
|
#define REACTION 5
|
|
#define INVERSE 6
|
|
#define ADVECTION 7
|
|
#define TRANSPORT 8
|
|
#define PHAST 9
|
|
|
|
/* constaints in mass balance */
|
|
#define EITHER 0
|
|
#define DISSOLVE 1
|
|
#define PRECIPITATE -1
|
|
|
|
/* gas phase type */
|
|
#define PRESSURE 1
|
|
#define VOLUME 2
|
|
|
|
#define MAX_PP_ASSEMBLAGE 10 /* default estimate of the number of phase assemblages */
|
|
#define MAX_ADD_EQUATIONS 20 /* maximum number of equations added together to reduce eqn to
|
|
master species */
|
|
#define MAX_ELEMENTS 50 /* default estimate of the number of elements */
|
|
#define MAX_LENGTH 256 /* maximum number of characters component name */
|
|
#define MAX_LINE 4096 /* estimate of maximum line length */
|
|
#define MAX_MASS_BALANCE 10 /* initial guess of number mass balance equations for a solution */
|
|
#define MAX_MASTER 50 /* default estimate of the number of master species */
|
|
#define MAX_ELTS 15 /* default estimate for maximum number of times elements occur in
|
|
an equation */
|
|
#define MAX_PHASES 500 /* initial guess of number of phases defined */
|
|
#define MAX_S 500 /* default estimate for maximum number of species in aqueous model */
|
|
#define MAX_SUM_JACOB0 50 /* list used to calculate jacobian */
|
|
#define MAX_SUM_JACOB1 500 /* list used to calculate jacobian */
|
|
#define MAX_SUM_JACOB2 500 /* list used to calculate jacobian */
|
|
#define MAX_SUM_MB 500 /* list used to calculate mass balance sums */
|
|
#define MAX_TRXN 16 /* default estimate for maximum number of components in an eqn */
|
|
#define MAX_UNKNOWNS 15 /* default estimate for maximum number of unknowns in model */
|
|
#define TOL 1e-9 /* tolerance for comparisons of double numbers */
|
|
#define MAX_LM 3.0 /* maximum log molality allowed in intermediate iterations */
|
|
#define MAX_M 1000.0
|
|
#ifdef USE_DECIMAL128
|
|
// #define MIN_LM -80.0 /* minimum log molality allowed before molality set to zero */
|
|
// #define LOG_ZERO_MOLALITY -80 /* molalities <= LOG_ZERO_MOLALITY are considered equal to zero */
|
|
// #define MIN_TOTAL 1e-60
|
|
// #define MIN_TOTAL_SS MIN_TOTAL/100
|
|
// #define MIN_RELATED_SURFACE MIN_TOTAL*100
|
|
// #define MIN_RELATED_LOG_ACTIVITY -60
|
|
#else
|
|
// #define MIN_LM -30.0 /* minimum log molality allowed before molality set to zero */
|
|
// #define LOG_ZERO_MOLALITY -30 /* molalities <= LOG_ZERO_MOLALITY are considered equal to zero */
|
|
// #define MIN_TOTAL 1e-25
|
|
// #define MIN_TOTAL_SS MIN_TOTAL/100
|
|
// #define MIN_RELATED_SURFACE MIN_TOTAL*100
|
|
// #define MIN_RELATED_LOG_ACTIVITY -30
|
|
#endif
|
|
#define REF_PRES_PASCAL 1.01325E5 /* Reference pressure: 1 atm */
|
|
#define MAX_P_NONLLNL 1500.0
|
|
|
|
//
|
|
// Typedefs and structure definitions
|
|
//
|
|
typedef enum { kcal, cal, kjoules, joules } DELTA_H_UNIT;
|
|
typedef enum { cm3_per_mol, dm3_per_mol, m3_per_mol } DELTA_V_UNIT;
|
|
enum entity_type
|
|
{ Solution, Reaction, Exchange, Surface, Gas_phase, Pure_phase, Ss_phase,
|
|
Kinetics, Mix, Temperature, Pressure, UnKnown
|
|
};
|
|
|
|
typedef enum {
|
|
logK_T0,
|
|
delta_h,
|
|
T_A1,
|
|
T_A2,
|
|
T_A3,
|
|
T_A4,
|
|
T_A5,
|
|
T_A6,
|
|
delta_v, /* set in calc_delta_v: calculated molar volume-change of the reaction */
|
|
vm_tc, /* set in calc_vm: calculated molal volume of the species at tc */
|
|
vm0, /* read: molar volume of a phase */
|
|
vma1, vma2, vma3, vma4, /* read: a1..a4 from supcrt, see calc_vm */
|
|
wref, /* from supcrt */
|
|
b_Av, /* b in z^2 * A_v * log(1 + b * I^0.5) / (2 * b) */
|
|
vmi1, vmi2, vmi3, vmi4, /* ionic strength terms: (i1 + i2/(TK - 228) + i3 * (TK - 228) ) * I^i4 */
|
|
MAX_LOG_K_INDICES /* Keep this definition at the end of the enum */
|
|
} LOG_K_INDICES;
|
|
|
|
typedef struct PHRQMemHeader
|
|
{
|
|
struct PHRQMemHeader *pNext; /* memory allocated just after this one */
|
|
struct PHRQMemHeader *pPrev; /* memory allocated just prior to this one */
|
|
size_t size; /* memory request + sizeof(PHRQMemHeader) */
|
|
#if !defined(NDEBUG)
|
|
char *szFileName; /* file name */
|
|
int nLine; /* line number */
|
|
int dummy; /* alignment */
|
|
#endif
|
|
} PHRQMemHeader;
|
|
|
|
struct Change_Surf
|
|
{
|
|
const char *comp_name;
|
|
LDBLE fraction;
|
|
const char *new_comp_name;
|
|
LDBLE new_Dw;
|
|
int cell_no;
|
|
int next;
|
|
};
|
|
/*----------------------------------------------------------------------
|
|
* CReaction
|
|
*---------------------------------------------------------------------- */
|
|
class CReaction
|
|
{
|
|
public:
|
|
CReaction(void);
|
|
CReaction(size_t ntoken);
|
|
~CReaction(void) {}
|
|
double* Get_logk(void) { return this->logk; }
|
|
void Set_logk(double* d);
|
|
double* Get_dz(void) { return this->dz; }
|
|
void Set_dz(double* d);
|
|
size_t size() { return token.size(); }
|
|
std::vector<class rxn_token>& Get_tokens(void) { return this->token; }
|
|
void Set_tokens(const std::vector<class rxn_token>& t) { this->token = t; }
|
|
|
|
public:
|
|
double logk[MAX_LOG_K_INDICES];
|
|
double dz[3];
|
|
std::vector<class rxn_token> token;
|
|
};
|
|
class rxn_token
|
|
{
|
|
public:
|
|
~rxn_token() {};
|
|
rxn_token()
|
|
{
|
|
s = NULL;
|
|
coef = 0.0;
|
|
name = NULL;
|
|
}
|
|
class species* s;
|
|
LDBLE coef;
|
|
const char* name;
|
|
};
|
|
class save
|
|
{
|
|
public:
|
|
~save() {};
|
|
save()
|
|
{
|
|
solution = 0;
|
|
n_solution_user = 0;
|
|
n_solution_user_end = 0;
|
|
mix = 0;
|
|
n_mix_user = 0;
|
|
n_mix_user_end = 0;
|
|
reaction = 0;
|
|
n_reaction_user = 0;
|
|
n_reaction_user_end = 0;
|
|
pp_assemblage = 0;
|
|
n_pp_assemblage_user = 0;
|
|
n_pp_assemblage_user_end = 0;
|
|
exchange = 0;
|
|
n_exchange_user = 0;
|
|
n_exchange_user_end = 0;
|
|
kinetics = 0;
|
|
n_kinetics_user = 0;
|
|
n_kinetics_user_end = 0;
|
|
surface = 0;
|
|
n_surface_user = 0;
|
|
n_surface_user_end = 0;
|
|
gas_phase = 0;
|
|
n_gas_phase_user = 0;
|
|
n_gas_phase_user_end = 0;
|
|
ss_assemblage = 0;
|
|
n_ss_assemblage_user = 0;
|
|
n_ss_assemblage_user_end = 0;
|
|
}
|
|
int solution;
|
|
int n_solution_user;
|
|
int n_solution_user_end;
|
|
int mix;
|
|
int n_mix_user;
|
|
int n_mix_user_end;
|
|
int reaction;
|
|
int n_reaction_user;
|
|
int n_reaction_user_end;
|
|
int pp_assemblage;
|
|
int n_pp_assemblage_user;
|
|
int n_pp_assemblage_user_end;
|
|
int exchange;
|
|
int n_exchange_user;
|
|
int n_exchange_user_end;
|
|
int kinetics;
|
|
int n_kinetics_user;
|
|
int n_kinetics_user_end;
|
|
int surface;
|
|
int n_surface_user;
|
|
int n_surface_user_end;
|
|
int gas_phase;
|
|
int n_gas_phase_user;
|
|
int n_gas_phase_user_end;
|
|
int ss_assemblage;
|
|
int n_ss_assemblage_user;
|
|
int n_ss_assemblage_user_end;
|
|
};
|
|
|
|
/*----------------------------------------------------------------------
|
|
* Copy
|
|
*---------------------------------------------------------------------- */
|
|
class copier
|
|
{
|
|
public:
|
|
~copier() {};
|
|
copier()
|
|
{}
|
|
std::vector<int> n_user;
|
|
std::vector<int> start;
|
|
std::vector<int> end;
|
|
};
|
|
/*----------------------------------------------------------------------
|
|
* Inverse
|
|
*---------------------------------------------------------------------- */
|
|
class inverse
|
|
{
|
|
public:
|
|
~inverse() {};
|
|
inverse()
|
|
{
|
|
n_user = -1;
|
|
description = NULL;
|
|
new_def = FALSE;
|
|
minimal = FALSE;
|
|
range = FALSE;
|
|
mp = FALSE;
|
|
mp_censor = 1e-20;
|
|
range_max = 1000.0;
|
|
tolerance = 1e-10;
|
|
mp_tolerance = 1e-12;
|
|
//uncertainties.clear();
|
|
//ph_uncertainties.clear();
|
|
water_uncertainty = 0.0;
|
|
mineral_water = TRUE;
|
|
carbon = TRUE;
|
|
//dalk_dph.clear();
|
|
//dalk_dc.clear();
|
|
count_solns = 0;
|
|
//solns.clear();
|
|
//force_solns.clear();
|
|
//elts.clear();
|
|
//phases.clear();
|
|
count_redox_rxns = 0;
|
|
//isotopes.clear();
|
|
//i_u.clear();
|
|
//isotope_unknowns.clear();
|
|
netpath = NULL;
|
|
pat = NULL;
|
|
}
|
|
int n_user;
|
|
char* description;
|
|
int new_def;
|
|
int minimal;
|
|
int range;
|
|
int mp;
|
|
LDBLE mp_censor;
|
|
LDBLE range_max;
|
|
LDBLE tolerance;
|
|
LDBLE mp_tolerance;
|
|
std::vector<double> uncertainties;
|
|
std::vector<double> ph_uncertainties;
|
|
LDBLE water_uncertainty;
|
|
int mineral_water;
|
|
int carbon;
|
|
std::vector<double> dalk_dph;
|
|
std::vector<double> dalk_dc;
|
|
size_t count_solns;
|
|
std::vector<int> solns;
|
|
std::vector<bool> force_solns;
|
|
std::vector<class inv_elts> elts;
|
|
std::vector<class inv_phases> phases;
|
|
size_t count_redox_rxns;
|
|
std::vector<class inv_isotope> isotopes;
|
|
std::vector<class inv_isotope> i_u;
|
|
std::vector<class isotope> isotope_unknowns;
|
|
const char* netpath;
|
|
const char* pat;
|
|
};
|
|
class inv_elts
|
|
{
|
|
public:
|
|
~inv_elts() {};
|
|
inv_elts()
|
|
{
|
|
name = NULL;
|
|
master = NULL;
|
|
row = 0;
|
|
//uncertainties.clear();
|
|
}
|
|
const char* name;
|
|
class master* master;
|
|
size_t row;
|
|
std::vector<double> uncertainties;
|
|
};
|
|
class inv_isotope
|
|
{
|
|
public:
|
|
~inv_isotope() {};
|
|
inv_isotope()
|
|
{
|
|
isotope_name = NULL;
|
|
isotope_number = 0;
|
|
elt_name = NULL;
|
|
//uncertainties.clear();
|
|
}
|
|
const char* isotope_name;
|
|
LDBLE isotope_number;
|
|
const char* elt_name;
|
|
std::vector<double> uncertainties;
|
|
};
|
|
class inv_phases
|
|
{
|
|
public:
|
|
~inv_phases() {};
|
|
inv_phases()
|
|
{
|
|
name = NULL;
|
|
phase = NULL;
|
|
column = 0;
|
|
constraint = EITHER;
|
|
force = FALSE;
|
|
//isotopes.clear();
|
|
}
|
|
const char* name;
|
|
class phase* phase;
|
|
int column;
|
|
int constraint;
|
|
int force;
|
|
std::vector<class isotope> isotopes;
|
|
};
|
|
/*----------------------------------------------------------------------
|
|
* Jacobian and Mass balance lists
|
|
*---------------------------------------------------------------------- */
|
|
class Model
|
|
{
|
|
public:
|
|
Model()
|
|
{
|
|
force_prep = true;
|
|
gas_phase_type = cxxGasPhase::GP_UNKNOWN;
|
|
numerical_fixed_volume = false;
|
|
dl_type = cxxSurface::NO_DL;
|
|
surface_type = cxxSurface::UNKNOWN_DL;
|
|
};
|
|
~Model()
|
|
{
|
|
};
|
|
bool force_prep;
|
|
bool numerical_fixed_volume;
|
|
cxxGasPhase::GP_TYPE gas_phase_type;
|
|
std::vector<class phase*> gas_phase;
|
|
std::vector<const char*> ss_assemblage;
|
|
std::vector<class phase*> pp_assemblage;
|
|
std::vector<double> si;
|
|
std::vector<const char*> add_formula;
|
|
cxxSurface::DIFFUSE_LAYER_TYPE dl_type;
|
|
cxxSurface::SURFACE_TYPE surface_type;
|
|
std::vector<const char*> surface_comp;
|
|
std::vector<const char*> surface_charge;
|
|
};
|
|
class name_coef
|
|
{
|
|
public:
|
|
~name_coef() {};
|
|
name_coef()
|
|
{
|
|
name = NULL;
|
|
coef = 0;
|
|
}
|
|
const char* name;
|
|
LDBLE coef;
|
|
};
|
|
/*----------------------------------------------------------------------
|
|
* Species_list
|
|
*---------------------------------------------------------------------- */
|
|
class species_list
|
|
{
|
|
public:
|
|
~species_list() {};
|
|
species_list()
|
|
{
|
|
master_s = NULL;
|
|
s = NULL;
|
|
coef = 0;
|
|
}
|
|
class species* master_s;
|
|
class species* s;
|
|
LDBLE coef;
|
|
};
|
|
/*----------------------------------------------------------------------
|
|
* Jacobian and Mass balance lists
|
|
*---------------------------------------------------------------------- */
|
|
class list0
|
|
{
|
|
public:
|
|
~list0() {};
|
|
list0()
|
|
{
|
|
target = NULL;
|
|
coef = 0;
|
|
}
|
|
LDBLE* target;
|
|
LDBLE coef;
|
|
};
|
|
class list1
|
|
{
|
|
public:
|
|
~list1() {};
|
|
list1()
|
|
{
|
|
source = NULL;
|
|
target = NULL;
|
|
}
|
|
LDBLE* source;
|
|
LDBLE* target;
|
|
};
|
|
class list2
|
|
{
|
|
public:
|
|
~list2() {};
|
|
list2()
|
|
{
|
|
source = NULL;
|
|
target = NULL;
|
|
coef = 0;
|
|
}
|
|
LDBLE* source;
|
|
LDBLE* target;
|
|
LDBLE coef;
|
|
};
|
|
class isotope
|
|
{
|
|
public:
|
|
~isotope() {};
|
|
isotope()
|
|
{
|
|
isotope_number = 0;
|
|
elt_name = NULL;
|
|
isotope_name = NULL;
|
|
total = 0;
|
|
ratio = 0;
|
|
ratio_uncertainty = 0;
|
|
x_ratio_uncertainty = 0;
|
|
master = NULL;
|
|
primary = NULL;
|
|
coef = 0; /* coefficient of element in phase */
|
|
}
|
|
LDBLE isotope_number;
|
|
const char* elt_name;
|
|
const char* isotope_name;
|
|
LDBLE total;
|
|
LDBLE ratio;
|
|
LDBLE ratio_uncertainty;
|
|
LDBLE x_ratio_uncertainty;
|
|
class master* master;
|
|
class master* primary;
|
|
LDBLE coef;
|
|
};
|
|
class iso
|
|
{
|
|
public:
|
|
~iso() {};
|
|
iso()
|
|
{
|
|
name = NULL;
|
|
value = 0;
|
|
uncertainty = 0.05;
|
|
}
|
|
const char* name;
|
|
LDBLE value;
|
|
LDBLE uncertainty;
|
|
};
|
|
/*----------------------------------------------------------------------
|
|
* Transport data
|
|
*---------------------------------------------------------------------- */
|
|
class stag_data
|
|
{
|
|
public:
|
|
~stag_data() {};
|
|
stag_data()
|
|
{
|
|
count_stag = 0;
|
|
exch_f = 0;
|
|
th_m = 0;
|
|
th_im = 0;
|
|
}
|
|
int count_stag;
|
|
LDBLE exch_f;
|
|
LDBLE th_m;
|
|
LDBLE th_im;
|
|
};
|
|
class cell_data
|
|
{
|
|
public:
|
|
~cell_data() {};
|
|
cell_data()
|
|
{
|
|
length = 1;
|
|
mid_cell_x = 1.;
|
|
disp = 1.0;
|
|
temp = 25.;
|
|
// free (uncharged) porewater porosities
|
|
por = 0.1;
|
|
// interlayer water porosities
|
|
por_il = 0.01;
|
|
// potential (V)
|
|
potV = 0;
|
|
punch = FALSE;
|
|
print = FALSE;
|
|
same_model = FALSE;
|
|
}
|
|
LDBLE length;
|
|
LDBLE mid_cell_x;
|
|
LDBLE disp;
|
|
LDBLE temp;
|
|
LDBLE por;
|
|
LDBLE por_il;
|
|
LDBLE potV;
|
|
int punch;
|
|
int print;
|
|
int same_model;
|
|
};
|
|
/*----------------------------------------------------------------------
|
|
* Keywords
|
|
*---------------------------------------------------------------------- */
|
|
//class key
|
|
//{
|
|
//public:
|
|
// ~key() {};
|
|
// key()
|
|
// {
|
|
// name = NULL;
|
|
// keycount = 0;
|
|
// }
|
|
// char* name;
|
|
// int keycount = 0;
|
|
// };
|
|
//class const_key
|
|
//{
|
|
//public:
|
|
// ~const_key() {};
|
|
// const_key()
|
|
// {
|
|
// name = NULL;
|
|
// keycount = 0;
|
|
// }
|
|
// const char* name;
|
|
// int keycount;
|
|
//};
|
|
/*----------------------------------------------------------------------
|
|
* Elements
|
|
*---------------------------------------------------------------------- */
|
|
class element
|
|
{
|
|
public:
|
|
~element() {};
|
|
element()
|
|
{
|
|
// element name
|
|
name = NULL;
|
|
/* int in; */
|
|
master = NULL;
|
|
primary = NULL;
|
|
gfw = 0;
|
|
}
|
|
const char* name;
|
|
class master* master;
|
|
class master* primary;
|
|
LDBLE gfw;
|
|
};
|
|
/*----------------------------------------------------------------------
|
|
* Element List
|
|
*---------------------------------------------------------------------- */
|
|
class elt_list
|
|
{
|
|
public:
|
|
~elt_list() {};
|
|
elt_list()
|
|
{ /* list of name and number of elements in an equation */
|
|
elt = NULL; /* pointer to element structure */
|
|
coef = 0.0; /* number of element e's in eqn */
|
|
}
|
|
class element* elt;
|
|
LDBLE coef;
|
|
};
|
|
/*----------------------------------------------------------------------
|
|
* Species
|
|
*---------------------------------------------------------------------- */
|
|
class species
|
|
{
|
|
public:
|
|
~species() {};
|
|
species()
|
|
{ /* all data pertinent to an aqueous species */
|
|
name = NULL; // name of species
|
|
mole_balance = NULL; // formula for mole balance
|
|
in = FALSE; // set internally if species in model
|
|
number = 0;
|
|
// points to master species list, NULL if not primary master
|
|
primary = NULL;
|
|
// points to master species list, NULL if not secondary master
|
|
secondary = NULL;
|
|
gfw = 0; // gram formula wt of species
|
|
z = 0; // charge of species
|
|
// tracer diffusion coefficient in water at 25oC, m2/s
|
|
dw = 0;
|
|
// correct Dw for temperature: Dw(TK) = Dw(298.15) * exp(dw_t / TK - dw_t / 298.15)
|
|
dw_t = 0;
|
|
// parms for calc'ng SC = SC0 * exp(-dw_a * z * mu^0.5 / (1 + DH_B * dw_a2 * mu^0.5))
|
|
dw_a = 0;
|
|
dw_a2 = 0;
|
|
dw_a_visc = 0; // viscosity correction of SC
|
|
dw_t_SC = 0; // contribution to SC, for calc'ng transport number with BASIC
|
|
dw_corr = 0; // dw corrected for TK and mu
|
|
erm_ddl = 0; // enrichment factor in DDL
|
|
equiv = 0; // equivalents in exchange species
|
|
alk = 0; // alkalinity of species, used for cec in exchange
|
|
carbon = 0; // stoichiometric coefficient of carbon in species
|
|
co2 = 0; // stoichiometric coefficient of C(4) in species
|
|
h = 0; // stoichiometric coefficient of H in species
|
|
// stoichiometric coefficient of O in species
|
|
o = 0;
|
|
// WATEQ Debye Huckel a and b-dot; active_fraction coef for exchange species
|
|
dha = 0, dhb = 0, a_f = 0;
|
|
lk = 0; // log10 k at working temperature
|
|
// log kt0, delh, 6 coefficients analytical expression + volume terms
|
|
for (size_t i = 0; i < MAX_LOG_K_INDICES; i++) logk[i] = 0;
|
|
// 7 coefficients analytical expression for B, D, anion terms and pressure in Jones_Dole viscosity eqn
|
|
for (size_t i = 0; i < 10; i++) Jones_Dole[i] = 0;
|
|
// regression coefficients to calculate temperature dependent phi_0and b_v of Millero density model
|
|
for (size_t i = 0; i < 7; i++) millero[i] = 0;
|
|
original_units = kjoules; // enum with original delta H units
|
|
//add_logk.clear();
|
|
lg = 0; // log10 activity coefficient, gamma
|
|
lg_pitzer = 0; // log10 activity coefficient, from pitzer calculation
|
|
lm = 0; // log10 molality
|
|
la = 0; // log10 activity
|
|
dg = 0; // gamma term for jacobian
|
|
dg_total_g = 0;
|
|
moles = 0; // moles in solution; moles/mass_water = molality
|
|
type = 0; // flag indicating presence in model and types of equations
|
|
gflag = 0; // flag for preferred activity coef eqn
|
|
exch_gflag = 0; // flag for preferred activity coef eqn
|
|
// vector of elements
|
|
//next_elt.clear();
|
|
//next_secondary.clear();
|
|
//next_sys_total.clear();
|
|
// switch to check equation for charge and element balance
|
|
check_equation = TRUE;
|
|
//CReaction rxn; // data base reaction
|
|
//CReaction rxn_s; // reaction converted to secondary and primary master species
|
|
//CReaction rxn_x; // reaction to be used in model
|
|
// (1 + sum(g)) * moles
|
|
tot_g_moles = 0;
|
|
// sum(moles*g*Ws/Waq)
|
|
tot_dh2o_moles = 0;
|
|
for (size_t i = 0; i < 5; i++) cd_music[i] = 0;
|
|
for (size_t i = 0; i < 3; i++) dz[i] = 0;
|
|
original_deltav_units = cm3_per_mol;
|
|
}
|
|
const char* name;
|
|
const char* mole_balance;
|
|
int in;
|
|
int number;
|
|
class master* primary;
|
|
class master* secondary;
|
|
LDBLE gfw;
|
|
LDBLE z;
|
|
LDBLE dw;
|
|
LDBLE dw_t;
|
|
LDBLE dw_a;
|
|
LDBLE dw_a2;
|
|
LDBLE dw_a_visc;
|
|
LDBLE dw_t_SC;
|
|
LDBLE dw_corr;
|
|
LDBLE erm_ddl;
|
|
LDBLE equiv;
|
|
LDBLE alk;
|
|
LDBLE carbon;
|
|
LDBLE co2;
|
|
LDBLE h;
|
|
LDBLE o;
|
|
LDBLE dha, dhb, a_f;
|
|
LDBLE lk;
|
|
LDBLE logk[MAX_LOG_K_INDICES];
|
|
LDBLE Jones_Dole[10];
|
|
LDBLE millero[7];
|
|
DELTA_H_UNIT original_units;
|
|
std::vector<class name_coef> add_logk;
|
|
LDBLE lg;
|
|
LDBLE lg_pitzer;
|
|
LDBLE lm;
|
|
LDBLE la;
|
|
LDBLE dg;
|
|
LDBLE dg_total_g;
|
|
LDBLE moles;
|
|
int type;
|
|
int gflag;
|
|
int exch_gflag;
|
|
std::vector<class elt_list> next_elt;
|
|
std::vector<class elt_list> next_secondary;
|
|
std::vector<class elt_list> next_sys_total;
|
|
int check_equation;
|
|
CReaction rxn;
|
|
CReaction rxn_s;
|
|
CReaction rxn_x;
|
|
LDBLE tot_g_moles;
|
|
LDBLE tot_dh2o_moles;
|
|
LDBLE cd_music[5];
|
|
LDBLE dz[3];
|
|
DELTA_V_UNIT original_deltav_units;
|
|
};
|
|
class logk
|
|
{
|
|
public:
|
|
~logk() {};
|
|
logk()
|
|
{ /* Named log K's */
|
|
name = NULL; // name of species
|
|
lk = 0.0; // log10 k at working temperature
|
|
// log kt0, delh, 6 coefficients analalytical expression
|
|
for (size_t i = 0; i < MAX_LOG_K_INDICES; i++) log_k[i] = 0;
|
|
// enum with original delta H units
|
|
original_units = kjoules;
|
|
done = FALSE;
|
|
//add_logk.clear();
|
|
// log kt0, delh, 5 coefficients analalytical expression
|
|
for (size_t i = 0; i < MAX_LOG_K_INDICES; i++) log_k_original[i] = 0;
|
|
original_deltav_units = cm3_per_mol;
|
|
}
|
|
const char* name;
|
|
LDBLE lk;
|
|
LDBLE log_k[MAX_LOG_K_INDICES];
|
|
DELTA_H_UNIT original_units;
|
|
int done;
|
|
std::vector<class name_coef> add_logk;
|
|
LDBLE log_k_original[MAX_LOG_K_INDICES];
|
|
DELTA_V_UNIT original_deltav_units;
|
|
};
|
|
/*----------------------------------------------------------------------
|
|
* Phases
|
|
*---------------------------------------------------------------------- */
|
|
class phase
|
|
{
|
|
public:
|
|
~phase() {};
|
|
phase()
|
|
{ /* all data pertinent to a pure solid phase */
|
|
name = NULL; //name of species
|
|
formula = NULL; // chemical formula
|
|
in = FALSE; // species used in model if TRUE
|
|
lk = 0; // log10 k at working temperature
|
|
// log kt0, delh, 6 coefficients analalytical expression
|
|
for (size_t i = 0; i < MAX_LOG_K_INDICES; i++) logk[i] = 0;
|
|
// enum with original delta H units
|
|
original_units = kjoules;
|
|
original_deltav_units = cm3_per_mol;
|
|
//add_logk.clear();
|
|
moles_x = 0;
|
|
delta_max = 0;
|
|
p_soln_x = 0;
|
|
fraction_x = 0;
|
|
log10_lambda = 0;
|
|
log10_fraction_x = 0;
|
|
dn = 0, dnb = 0, dnc = 0;
|
|
gn = 0, gntot = 0;
|
|
gn_n = 0, gntot_n = 0;
|
|
// gas: critical TK, critical P(atm), Pitzer acentric coeff
|
|
t_c = 0, p_c = 0, omega = 0;
|
|
// Peng-Robinson parm's
|
|
pr_a = 0, pr_b = 0, pr_alpha = 0;
|
|
// Temperature (K), Pressure (atm)
|
|
pr_tk = 0, pr_p = 0;
|
|
// fugacity coefficient (-)
|
|
pr_phi = 0;
|
|
// for calculating multicomponent phi
|
|
pr_aa_sum2 = 0;
|
|
// delta_v[0] = [1] + [2]*T + [3]/T + [4]*log10(T) + [5]/T^2 + [6]*T^2 + [7]*P
|
|
for (size_t i = 0; i < 9; i++) delta_v[i] = 0;
|
|
// si adapter: log10(phi) - delta_v[0] * (P - 1) /RT
|
|
pr_si_f = 0;
|
|
// Peng-Robinson in the calc's, or not
|
|
pr_in = false;
|
|
// flag indicating presence in model and types of equations
|
|
type = SOLID;
|
|
// list of elements in phase
|
|
//next_elt.clear();
|
|
//next_sys_total.clear();
|
|
// switch to check equation for charge and element balance
|
|
check_equation = TRUE;
|
|
// data base reaction
|
|
//CReaction rxn;
|
|
// reaction converted to secondary and primary master species
|
|
//CReaction rxn_s;
|
|
// reaction to be used in model
|
|
//CReaction rxn_x;
|
|
// equation contains solids or gases
|
|
replaced = FALSE;
|
|
in_system = FALSE;
|
|
}
|
|
const char* name;
|
|
const char* formula;
|
|
int in;
|
|
LDBLE lk;
|
|
LDBLE logk[MAX_LOG_K_INDICES];
|
|
DELTA_H_UNIT original_units;
|
|
DELTA_V_UNIT original_deltav_units;
|
|
std::vector<class name_coef> add_logk;
|
|
LDBLE moles_x;
|
|
LDBLE delta_max;
|
|
LDBLE p_soln_x;
|
|
LDBLE fraction_x;
|
|
LDBLE log10_lambda;
|
|
LDBLE log10_fraction_x;
|
|
LDBLE dn, dnb, dnc;
|
|
LDBLE gn, gntot;
|
|
LDBLE gn_n, gntot_n;
|
|
LDBLE t_c, p_c, omega;
|
|
LDBLE pr_a, pr_b, pr_alpha;
|
|
LDBLE pr_tk, pr_p;
|
|
LDBLE pr_phi;
|
|
LDBLE pr_aa_sum2;
|
|
LDBLE delta_v[9];
|
|
LDBLE pr_si_f;
|
|
bool pr_in;
|
|
int type;
|
|
std::vector<class elt_list> next_elt;
|
|
std::vector<class elt_list> next_sys_total;
|
|
int check_equation;
|
|
CReaction rxn;
|
|
CReaction rxn_s;
|
|
CReaction rxn_x;
|
|
int replaced;
|
|
int in_system;
|
|
};
|
|
/*----------------------------------------------------------------------
|
|
* Master species
|
|
*---------------------------------------------------------------------- */
|
|
class master
|
|
{
|
|
public:
|
|
~master() {};
|
|
master()
|
|
{
|
|
// TRUE if in model, FALSE if out, REWRITE if other mb eq
|
|
in = 0;
|
|
// sequence number in list of masters
|
|
number = 0;
|
|
// saved to determine if model has changed
|
|
last_model = FALSE;
|
|
// AQ or EX
|
|
type = 0;
|
|
// TRUE if master species is primary
|
|
primary = FALSE;
|
|
// coefficient of element in master species
|
|
coef = 0;
|
|
// total concentration for element or valence state
|
|
total = 0;
|
|
isotope_ratio = 0;
|
|
isotope_ratio_uncertainty = 0;
|
|
isotope = 0;
|
|
total_primary = 0;
|
|
// element structure
|
|
elt = NULL;
|
|
// alkalinity of species
|
|
alk = 0;
|
|
// default gfw for species
|
|
gfw = 1;
|
|
// formula from which to calcuate gfw
|
|
gfw_formula = NULL;
|
|
// pointer to unknown structure
|
|
unknown = NULL;
|
|
// pointer to species structure
|
|
s = NULL;
|
|
// reaction writes master species in terms of primary master species
|
|
//CReaction rxn_primary;
|
|
// reaction writes master species in terms of secondary master species
|
|
//CReaction rxn_secondary;
|
|
pe_rxn = NULL;
|
|
minor_isotope = FALSE;
|
|
}
|
|
int in;
|
|
size_t number;
|
|
int last_model;
|
|
int type;
|
|
int primary;
|
|
LDBLE coef;
|
|
LDBLE total;
|
|
LDBLE isotope_ratio;
|
|
LDBLE isotope_ratio_uncertainty;
|
|
int isotope;
|
|
LDBLE total_primary;
|
|
class element* elt;
|
|
LDBLE alk;
|
|
LDBLE gfw;
|
|
const char* gfw_formula;
|
|
class unknown* unknown;
|
|
class species* s;
|
|
CReaction rxn_primary;
|
|
CReaction rxn_secondary;
|
|
const char* pe_rxn;
|
|
int minor_isotope;
|
|
};
|
|
/*----------------------------------------------------------------------
|
|
* Unknowns
|
|
*---------------------------------------------------------------------- */
|
|
class unknown
|
|
{
|
|
public:
|
|
~unknown() {};
|
|
unknown()
|
|
{
|
|
type = 0;
|
|
moles = 0;
|
|
ln_moles = 0;
|
|
f = 0;
|
|
sum = 0;
|
|
delta = 0;
|
|
la = 0;
|
|
number = 0;
|
|
description = NULL;
|
|
//master.clear();
|
|
phase = NULL;
|
|
si = 0;
|
|
n_gas_phase_user = 0;
|
|
s = NULL;
|
|
exch_comp = NULL;
|
|
pp_assemblage_comp_name = NULL;
|
|
pp_assemblage_comp_ptr = NULL;
|
|
ss_name = NULL;
|
|
ss_ptr = NULL;
|
|
ss_comp_name = NULL;
|
|
ss_comp_ptr = NULL;
|
|
ss_comp_number = 0;
|
|
ss_in = FALSE;
|
|
surface_comp = NULL;
|
|
surface_charge = NULL;
|
|
related_moles = 0;
|
|
potential_unknown = NULL;
|
|
potential_unknown1 = NULL;
|
|
potential_unknown2 = NULL;
|
|
// list for CD_MUSIC of comps that contribute to 0 plane mass-balance term
|
|
//comp_unknowns.clear();
|
|
phase_unknown = NULL;
|
|
mass_water = 1;
|
|
dissolve_only = FALSE;
|
|
inert_moles = 0;
|
|
V_m = 0;
|
|
pressure = 1;
|
|
mb_number = 0;
|
|
iteration = 0;
|
|
}
|
|
int type;
|
|
LDBLE moles;
|
|
LDBLE ln_moles;
|
|
LDBLE f;
|
|
LDBLE sum;
|
|
LDBLE delta;
|
|
LDBLE la;
|
|
size_t number;
|
|
const char* description;
|
|
std::vector<class master*> master;
|
|
class phase* phase;
|
|
LDBLE si;
|
|
int n_gas_phase_user;
|
|
class species* s;
|
|
const char* exch_comp;
|
|
const char* pp_assemblage_comp_name;
|
|
void* pp_assemblage_comp_ptr;
|
|
const char* ss_name;
|
|
void* ss_ptr;
|
|
const char* ss_comp_name;
|
|
void* ss_comp_ptr;
|
|
int ss_comp_number;
|
|
int ss_in;
|
|
const char* surface_comp;
|
|
const char* surface_charge;
|
|
LDBLE related_moles;
|
|
class unknown* potential_unknown;
|
|
class unknown* potential_unknown1;
|
|
class unknown* potential_unknown2;
|
|
std::vector<class unknown*> comp_unknowns;
|
|
class unknown* phase_unknown;
|
|
LDBLE mass_water;
|
|
int dissolve_only;
|
|
LDBLE inert_moles;
|
|
LDBLE V_m;
|
|
LDBLE pressure;
|
|
int mb_number;
|
|
int iteration;
|
|
};
|
|
/*----------------------------------------------------------------------
|
|
* Reaction work space
|
|
*---------------------------------------------------------------------- */
|
|
class reaction_temp
|
|
{
|
|
public:
|
|
~reaction_temp() {};
|
|
reaction_temp()
|
|
{
|
|
for (size_t i = 0; i < MAX_LOG_K_INDICES; i++) logk[i] = 0;
|
|
for (size_t i = 0; i < 3; i++) dz[i] = 0;
|
|
//token.clear();
|
|
}
|
|
LDBLE logk[MAX_LOG_K_INDICES];
|
|
LDBLE dz[3];
|
|
std::vector<class rxn_token_temp> token;
|
|
};
|
|
class rxn_token_temp
|
|
{
|
|
public:
|
|
~rxn_token_temp() {};
|
|
rxn_token_temp()
|
|
{ // data for equations, aq. species or minerals
|
|
name = NULL; // pointer to a species name (formula)
|
|
z = 0; // charge on species
|
|
s = NULL;
|
|
unknown = NULL;
|
|
coef = 0; // coefficient of species name
|
|
}
|
|
const char* name;
|
|
LDBLE z;
|
|
class species* s;
|
|
class unknown* unknown;
|
|
LDBLE coef;
|
|
};
|
|
class unknown_list
|
|
{
|
|
public:
|
|
~unknown_list() {};
|
|
unknown_list()
|
|
{
|
|
unknown = NULL;
|
|
source = NULL;
|
|
gamma_source = NULL;
|
|
coef = 0;
|
|
}
|
|
class unknown* unknown;
|
|
LDBLE* source;
|
|
LDBLE* gamma_source;
|
|
LDBLE coef;
|
|
};
|
|
/* ----------------------------------------------------------------------
|
|
* Print
|
|
* ---------------------------------------------------------------------- */
|
|
class prints
|
|
{
|
|
public:
|
|
~prints() {};
|
|
prints()
|
|
{
|
|
all = 0;
|
|
initial_solutions = 0;
|
|
initial_exchangers = 0;
|
|
reactions = 0;
|
|
gas_phase = 0;
|
|
ss_assemblage = 0;
|
|
pp_assemblage = 0;
|
|
surface = 0;
|
|
exchange = 0;
|
|
kinetics = 0;
|
|
totals = 0;
|
|
eh = 0;
|
|
species = 0;
|
|
saturation_indices = 0;
|
|
irrev = 0;
|
|
mix = 0;
|
|
reaction = 0;
|
|
use = 0;
|
|
logfile = 0;
|
|
punch = 0;
|
|
status = 0;
|
|
inverse = 0;
|
|
dump = 0;
|
|
user_print = 0;
|
|
headings = 0;
|
|
user_graph = 0;
|
|
echo_input = 0;
|
|
warnings = 0;
|
|
initial_isotopes = 0;
|
|
isotope_ratios = 0;
|
|
isotope_alphas = 0;
|
|
hdf = 0;
|
|
alkalinity = 0;
|
|
}
|
|
int all;
|
|
int initial_solutions;
|
|
int initial_exchangers;
|
|
int reactions;
|
|
int gas_phase;
|
|
int ss_assemblage;
|
|
int pp_assemblage;
|
|
int surface;
|
|
int exchange;
|
|
int kinetics;
|
|
int totals;
|
|
int eh;
|
|
int species;
|
|
int saturation_indices;
|
|
int irrev;
|
|
int mix;
|
|
int reaction;
|
|
int use;
|
|
int logfile;
|
|
int punch;
|
|
int status;
|
|
int inverse;
|
|
int dump;
|
|
int user_print;
|
|
int headings;
|
|
int user_graph;
|
|
int echo_input;
|
|
int warnings;
|
|
int initial_isotopes;
|
|
int isotope_ratios;
|
|
int isotope_alphas;
|
|
int hdf;
|
|
int alkalinity;
|
|
};
|
|
/* ----------------------------------------------------------------------
|
|
* RATES
|
|
* ---------------------------------------------------------------------- */
|
|
class rate
|
|
{
|
|
public:
|
|
~rate() {};
|
|
rate()
|
|
{
|
|
name = NULL;
|
|
//std::string commands;
|
|
new_def = 0;
|
|
linebase = NULL;
|
|
varbase = NULL;
|
|
loopbase = NULL;
|
|
}
|
|
const char* name;
|
|
std::string commands;
|
|
int new_def;
|
|
void* linebase;
|
|
void* varbase;
|
|
void* loopbase;
|
|
};
|
|
/* ----------------------------------------------------------------------
|
|
* GLOBAL DECLARATIONS
|
|
* ---------------------------------------------------------------------- */
|
|
class spread_row
|
|
{
|
|
public:
|
|
~spread_row() {};
|
|
spread_row()
|
|
{
|
|
count = 0;
|
|
empty = 0, string = 0, number = 0;
|
|
//char_vector.clear();
|
|
//d_vector.clear();
|
|
//type_vector.clear();
|
|
}
|
|
size_t count;
|
|
size_t empty, string, number;
|
|
std::vector<std::string> str_vector;
|
|
std::vector<int> type_vector;
|
|
};
|
|
class defaults
|
|
{
|
|
public:
|
|
~defaults() {};
|
|
defaults()
|
|
{
|
|
temp = 25;
|
|
density = 1;
|
|
calc_density = false;
|
|
units = NULL;
|
|
redox = NULL;
|
|
ph = 7;
|
|
pe = 4;
|
|
water = 1;
|
|
//iso.clear();
|
|
pressure = 1; /* pressure in atm */
|
|
}
|
|
LDBLE temp;
|
|
LDBLE density;
|
|
bool calc_density;
|
|
const char* units;
|
|
const char* redox;
|
|
LDBLE ph;
|
|
LDBLE pe;
|
|
LDBLE water;
|
|
std::vector<class iso> iso;
|
|
LDBLE pressure;
|
|
};
|
|
class spread_sheet
|
|
{
|
|
public:
|
|
~spread_sheet() {};
|
|
spread_sheet()
|
|
{
|
|
heading = NULL;
|
|
units = NULL;
|
|
//class defaults defaults;
|
|
}
|
|
class spread_row* heading;
|
|
class spread_row* units;
|
|
std::vector<class spread_row*> rows;
|
|
class defaults defaults;
|
|
};
|
|
/* ----------------------------------------------------------------------
|
|
* ISOTOPES
|
|
* ---------------------------------------------------------------------- */
|
|
class master_isotope
|
|
{
|
|
public:
|
|
~master_isotope() {};
|
|
master_isotope()
|
|
{
|
|
name = NULL;
|
|
master = NULL;
|
|
elt = NULL;
|
|
units = NULL;
|
|
standard = 0;
|
|
ratio = 0;
|
|
moles = 0;
|
|
total_is_major = 0;
|
|
minor_isotope = 0;
|
|
}
|
|
const char* name;
|
|
class master* master;
|
|
class element* elt;
|
|
const char* units;
|
|
LDBLE standard;
|
|
LDBLE ratio;
|
|
LDBLE moles;
|
|
int total_is_major;
|
|
int minor_isotope;
|
|
};
|
|
class calculate_value
|
|
{
|
|
public:
|
|
~calculate_value() {};
|
|
calculate_value()
|
|
{
|
|
name = NULL;
|
|
value = 0;
|
|
//commands.clear();
|
|
new_def = 0;
|
|
calculated = 0;
|
|
linebase = NULL;
|
|
varbase = NULL;
|
|
loopbase = NULL;
|
|
}
|
|
const char* name;
|
|
LDBLE value;
|
|
std::string commands;
|
|
int new_def;
|
|
int calculated;
|
|
void* linebase;
|
|
void* varbase;
|
|
void* loopbase;
|
|
};
|
|
class isotope_ratio
|
|
{
|
|
public:
|
|
isotope_ratio()
|
|
{
|
|
name = NULL;
|
|
isotope_name = NULL;
|
|
ratio = 0;
|
|
converted_ratio = 0;
|
|
}
|
|
~isotope_ratio() {};
|
|
|
|
const char* name;
|
|
const char* isotope_name;
|
|
LDBLE ratio;
|
|
LDBLE converted_ratio;
|
|
};
|
|
class isotope_alpha
|
|
{
|
|
public:
|
|
isotope_alpha()
|
|
{
|
|
name = NULL;
|
|
named_logk = NULL;
|
|
value = 0;
|
|
}
|
|
~isotope_alpha() {};
|
|
const char* name;
|
|
const char* named_logk;
|
|
LDBLE value;
|
|
};
|
|
class system_species
|
|
{
|
|
public:
|
|
~system_species() {};
|
|
system_species()
|
|
{
|
|
name = NULL;
|
|
type = NULL;
|
|
moles = 0;
|
|
}
|
|
char* name;
|
|
char* type;
|
|
LDBLE moles;
|
|
};
|
|
/* tally.c ------------------------------- */
|
|
class tally_buffer
|
|
{
|
|
public:
|
|
~tally_buffer() {};
|
|
tally_buffer()
|
|
{
|
|
name = NULL;
|
|
master = NULL;
|
|
moles = 0;
|
|
gfw = 0;
|
|
}
|
|
const char* name;
|
|
class master* master;
|
|
LDBLE moles;
|
|
LDBLE gfw;
|
|
};
|
|
class tally
|
|
{
|
|
public:
|
|
~tally() {};
|
|
tally()
|
|
{
|
|
name = NULL;
|
|
type = UnKnown;
|
|
add_formula = NULL;
|
|
moles = 0;
|
|
//formula.clear();
|
|
/*
|
|
* first total is initial
|
|
* second total is final
|
|
* third total is difference (final - initial)
|
|
*/
|
|
for(size_t i = 0; i < 3; i++) total[i]= NULL;
|
|
}
|
|
const char* name;
|
|
enum entity_type type;
|
|
const char* add_formula;
|
|
LDBLE moles;
|
|
std::vector<class elt_list> formula;
|
|
/*
|
|
* first total is initial
|
|
* second total is final
|
|
* third total is difference (final - initial)
|
|
*/
|
|
class tally_buffer* total[3];
|
|
};
|
|
/* transport.c ------------------------------- */
|
|
class spec
|
|
{
|
|
public:
|
|
~spec() {};
|
|
spec()
|
|
{
|
|
// name of species
|
|
name = NULL;
|
|
// name of aqueous species in EX species
|
|
aq_name = NULL;
|
|
// type: AQ or EX
|
|
type = 0;
|
|
// activity
|
|
a = 0;
|
|
// log(concentration)
|
|
lm = 0;
|
|
// log(gamma)
|
|
lg = 0;
|
|
// concentration for AQ, equivalent fraction for EX
|
|
c = 0;
|
|
// charge number
|
|
z = 0;
|
|
// temperature corrected free water diffusion coefficient, m2/s
|
|
Dwt = 0;
|
|
// temperature factor for Dw
|
|
dw_t = 0;
|
|
// enrichment factor in ddl
|
|
erm_ddl = 0;
|
|
}
|
|
const char* name;
|
|
const char* aq_name;
|
|
int type;
|
|
LDBLE a;
|
|
LDBLE lm;
|
|
LDBLE lg;
|
|
LDBLE c;
|
|
LDBLE z;
|
|
LDBLE Dwt;
|
|
LDBLE dw_t;
|
|
LDBLE erm_ddl;
|
|
};
|
|
|
|
class sol_D
|
|
{
|
|
public:
|
|
~sol_D() {};
|
|
sol_D()
|
|
{
|
|
// number of aqueous + exchange species
|
|
count_spec = 0;
|
|
// number of exchange species
|
|
count_exch_spec = 0;
|
|
// total moles of X-, max X- in transport step in sol_D[1], tk
|
|
exch_total = 0, x_max = 0, tk_x = 0;
|
|
// (tk_x * viscos_0_25) / (298 * viscos)
|
|
viscos_f = 0;
|
|
spec = NULL;
|
|
spec_size = 0;
|
|
}
|
|
int count_spec;
|
|
int count_exch_spec;
|
|
LDBLE exch_total, x_max, tk_x;
|
|
LDBLE viscos_f;
|
|
class spec* spec;
|
|
int spec_size;
|
|
};
|
|
class J_ij
|
|
{
|
|
public:
|
|
~J_ij() {};
|
|
J_ij()
|
|
{
|
|
name = NULL;
|
|
// species change in cells i and j
|
|
tot1 = 0;
|
|
tot2 = 0;
|
|
tot_stag = 0;
|
|
charge = 0;
|
|
}
|
|
const char* name;
|
|
LDBLE tot1, tot2, tot_stag, charge;
|
|
};
|
|
class J_ij_save
|
|
{
|
|
public:
|
|
~J_ij_save() {};
|
|
J_ij_save()
|
|
{
|
|
// species change in cells i and j
|
|
flux_t = 0;
|
|
flux_c = 0;
|
|
}
|
|
double flux_t, flux_c;
|
|
};
|
|
class M_S
|
|
{
|
|
public:
|
|
~M_S() {};
|
|
M_S()
|
|
{
|
|
name = NULL;
|
|
// master species transport in cells i and j
|
|
tot1 = 0;
|
|
tot2 = 0;
|
|
tot_stag = 0;
|
|
charge = 0;
|
|
}
|
|
const char* name;
|
|
LDBLE tot1, tot2, tot_stag, charge;
|
|
};
|
|
// Pitzer definitions
|
|
typedef enum
|
|
{ TYPE_B0, TYPE_B1, TYPE_B2, TYPE_C0, TYPE_THETA, TYPE_LAMDA, TYPE_ZETA,
|
|
TYPE_PSI, TYPE_ETHETA, TYPE_ALPHAS, TYPE_MU, TYPE_ETA, TYPE_Other,
|
|
TYPE_SIT_EPSILON, TYPE_SIT_EPSILON_MU, TYPE_APHI
|
|
} pitz_param_type;
|
|
class pitz_param
|
|
{
|
|
public:
|
|
~pitz_param() {};
|
|
pitz_param()
|
|
{
|
|
for(size_t i = 0; i < 3; i++) species[i] = NULL;
|
|
for (size_t i = 0; i < 3; i++) ispec[i] = -1;
|
|
type = TYPE_Other;
|
|
p = 0;
|
|
U.b0 = 0;
|
|
for (size_t i = 0; i < 6; i++) a[i] = 0;
|
|
alpha = 0;
|
|
os_coef = 0;
|
|
for (size_t i = 0; i < 3; i++) ln_coef[i] = 0;
|
|
thetas = NULL;
|
|
}
|
|
const char* species[3];
|
|
int ispec[3];
|
|
pitz_param_type type;
|
|
LDBLE p;
|
|
union
|
|
{
|
|
LDBLE b0;
|
|
LDBLE b1;
|
|
LDBLE b2;
|
|
LDBLE c0;
|
|
LDBLE theta;
|
|
LDBLE lamda;
|
|
LDBLE zeta;
|
|
LDBLE psi;
|
|
LDBLE alphas;
|
|
LDBLE mu;
|
|
LDBLE eta;
|
|
LDBLE eps;
|
|
LDBLE eps1;
|
|
LDBLE aphi;
|
|
} U;
|
|
LDBLE a[6];
|
|
LDBLE alpha;
|
|
LDBLE os_coef;
|
|
LDBLE ln_coef[3];
|
|
class theta_param* thetas;
|
|
};
|
|
class theta_param
|
|
{
|
|
public:
|
|
~theta_param() {};
|
|
theta_param()
|
|
{
|
|
zj = 0;
|
|
zk = 0;
|
|
etheta = 0;
|
|
ethetap = 0;
|
|
}
|
|
LDBLE zj;
|
|
LDBLE zk;
|
|
LDBLE etheta;
|
|
LDBLE ethetap;
|
|
};
|
|
class const_iso
|
|
{
|
|
public:
|
|
~const_iso() {};
|
|
const_iso()
|
|
{
|
|
name = NULL;
|
|
value = 0;
|
|
uncertainty = 0;
|
|
}
|
|
const_iso(const char *n, LDBLE v, LDBLE u)
|
|
{
|
|
name = n;
|
|
value = v;
|
|
uncertainty = u;
|
|
}
|
|
const char* name;
|
|
LDBLE value;
|
|
LDBLE uncertainty;
|
|
};
|
|
|
|
#endif /* _INC_GLOBAL_STRUCTURES_H */
|