PhreeqcUsers Discussion Forum

Please email phreeqcusers at gmail.com with your name and affiliation to request an account.
Welcome Guest
 

  • Forum Home
  • Login
  • Register

  • PhreeqcUsers Discussion Forum »
  • Processes »
  • Reactive transport modelling »
  • Problem in creating two reaction modules at the same time
« previous next »
  • Print
Pages: [1]   Go Down

Author Topic: Problem in creating two reaction modules at the same time  (Read 10881 times)

sharmilan

  • Top Contributor
  • Posts: 45
Problem in creating two reaction modules at the same time
« on: 24/09/24 15:59 »
Dear PHREEQC experts,

I am using the MATLAB program coupled with PHREEQC_RM. I attempted to create two reaction modules using the RM_Create function, but it generates the same ID number for both, causing them to merge. Could you please advise me on how to create two separate reaction modules with different IDs?

ID = calllib('PhreeqcRMd', 'RM_Create', no_node, no_thre);

Thank you for your guidance.

Thank you
S.Sharmilan.
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4336
Re: Problem in creating two reaction modules at the same time
« Reply #1 on: 24/09/24 20:24 »
I struggle with Matlab because I have never used it beyond the minimum. However, I made this file

Code: [Select]
clear;
clc;
node = 5;

% Set the path for phreeqcRMd.dll, RM_interface_C.h, and database.
RM_lib_path = 'C:\GitPrograms\phreeqcrm-bmi\_build_openmp_vs\INSTALL\lib\PhreeqcRMd.dll';
RM_header_path = 'C:\GitPrograms\phreeqcrm-bmi\_build_openmp_vs\INSTALL\include\RM_interface_C.h';
RM_lib_path = 'C:\GitPrograms\phreeqcrm-bmi\_build_openmp_vs\INSTALL\bin\PhreeqcRMd.dll';
RM_header_path = 'C:\GitPrograms\phreeqcrm-bmi\_build_openmp_vs\INSTALL\include\RM_interface_C.h';
Database_path = 'C:\GitPrograms\phreeqcrm-bmi\_build_openmp_vs\INSTALL\database\phreeqc.dat';

if ~libisloaded('PhreeqcRMd')
    loadlibrary(RM_lib_path, RM_header_path);
end

phr_model = calllib('PhreeqcRMd', 'RM_Create', node, -1);
phr_model2 = calllib('PhreeqcRMd', 'RM_Create', node, -1);
disp(phr_model)
disp(phr_model2)

disp 'We are done'

Which produced this output

Code: [Select]
     3

     4

We are done
>>

The ids are different.

Logged

  • Print
Pages: [1]   Go Up
« previous next »
  • PhreeqcUsers Discussion Forum »
  • Processes »
  • Reactive transport modelling »
  • Problem in creating two reaction modules at the same time
 

  • SMF 2.0.19 | SMF © 2021, Simple Machines | Terms and Policies
  • XHTML
  • RSS
  • WAP2