% PhreeqcRM node generationphr_model = calllib('PhreeqcRMd', 'RM_Create', node, -1);% Set PhreeqcRM propertiesstatus = calllib('PhreeqcRMd', 'RM_SetErrorOn', phr_model, 1); %#ok<*NASGU> status = calllib('PhreeqcRMd', 'RM_SetErrorHandlerMode', phr_model, 2);status = calllib('PhreeqcRMd', 'RM_SetComponentH2O', phr_model, 1);status = calllib('PhreeqcRMd', 'RM_SetRebalanceFraction', phr_model, 0.5);status = calllib('PhreeqcRMd', 'RM_UseSolutionDensityVolume', phr_model, 0);status = calllib('PhreeqcRMd', 'RM_SetPartitionUZSolids', phr_model, 0);status = calllib('PhreeqcRMd', 'RM_SetFilePrefix', phr_model, 'react_c');% Set PhreeqcRM unitsstatus = calllib('PhreeqcRMd', 'RM_SetUnitsSolution', phr_model, 2);status = calllib('PhreeqcRMd', 'RM_SetUnitsPPassemblage', phr_model, 1);status = calllib('PhreeqcRMd', 'RM_SetUnitsExchange', phr_model, 1);status = calllib('PhreeqcRMd', 'RM_SetUnitsSurface', phr_model, 1);status = calllib('PhreeqcRMd', 'RM_SetUnitsGasPhase', phr_model, 1);status = calllib('PhreeqcRMd', 'RM_SetUnitsSSassemblage', phr_model, 1);status = calllib('PhreeqcRMd', 'RM_SetUnitsKinetics', phr_model, 1);% Set PhreeqcRM time unitsstatus = calllib('PhreeqcRMd', 'RM_SetTimeConversion', phr_model, 1); % number x represents 1 second = x timestep% Set PhreeqcRM representative volume, set a large rv when the pore volumn * saturation is lowrv = ones(node, 1, 'double');status = calllib('PhreeqcRMd', 'RM_SetRepresentativeVolume', phr_model, rv);% Set PhreeqcRM porosityporosity_index = find(strcmp(transport_data.expr, 'dl.epsilon'));por = transport_data.(['d',num2str(porosity_index)])';status = calllib('PhreeqcRMd', 'RM_SetPorosity', phr_model, por);% Set PhreeqcRM saturationsat = ones(node, 1, 'double');status = calllib('PhreeqcRMd', 'RM_SetSaturation', phr_model, sat);% Disable the detailed printing of chemical informationstatus = calllib('PhreeqcRMd', 'RM_SetPrintChemistryOn', phr_model, 0, 1, 0);% Get cell numbersnchem = calllib('PhreeqcRMd', 'RM_GetChemistryCellCount', phr_model);% Load databasestatus = calllib('PhreeqcRMd', 'RM_LoadDatabase', phr_model, 'C:\Program Files\USGS\IPhreeqcCOM 3.7.3-15968\database\phreeqc.dat');% Run initial run for each chemical zone% The initial condition for each chemical zone should be defined in 'initial.phr', before the model run.status = calllib('PhreeqcRMd', 'RM_RunFile', phr_model, 1, 1, 1, 'initial.phr');status = calllib('PhreeqcRMd', 'RM_RunString', phr_model, 1, 0, 1, 'DELETE\n -all\n');
SOLUTION 1units mmol/kgwtemp 25.0pH 7.0 chargepe 12.5 O2(g) -0.68Na 1.0K 0.2N(5) 1.2ENDEXCHANGE 1-equilibrate 1X 0.0011ENDSOLUTION 2units mmol/kgwtemp 25.0pH 7.0 chargepe 12.5 O2(g) -0.68Ca 0.6Cl 1.2ENDEXCHANGE 2-equilibrate 2X 0.0011ENDSELECTED_OUTPUT-reset FALSE-high_precision TRUEUSER_PUNCH-headings CaX2 KX NaX10 PUNCH MOL('CaX2') MOL('KX') MOL('NaX')END
Debug Assertion Failed! C:\my_directory\PhreeqcRMd.dllC:\phreeqcrm_source\phreeqcrm-3.7.3-15968-hotfix\src\IPhreeqcPhast\IPreeqc\IPhreeqc.cppLine: 369Expression: (null)
int IPhreeqc::GetSelectedOutputCount(void)const{ ASSERT(this->PhreeqcPtr->SelectedOutput_map.size() == this->SelectedOutputMap.size()); return (int) this->PhreeqcPtr->SelectedOutput_map.size();}
status = calllib('PhreeqcRMd', 'RM_RunString', phr_model, 1, 0, 1, 'DELETE\n -all\n');
tatus = calllib('PhreeqcRMd', 'RM_RunString', phr_model, 1, 0, 1, 'DELETE; -all');
status = calllib('PhreeqcRMd', 'RM_RunString', phr_model, 1, 0, 1, ['DELETE' newline '-all' newline]);