Welcome
Guest
Forum Home
Login
Register
PhreeqcUsers Discussion Forum
»
Processes
»
Reactive transport modelling
»
species_cpp.cpp with python
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: species_cpp.cpp with python (Read 3872 times)
Rumple
Frequent Contributor
Posts: 12
species_cpp.cpp with python
«
on:
04/03/26 13:36 »
Dear user,
I've recently been paying attention to the usage of GetSpeciesConcentrations and SpeciesConcentrations2Module. I realize that my previous approach of directly using GetConcentrations and SetConcentrations from SimpleAdvection.py was rather crude. I now want to improve my understanding. I would like to ask whether species_cpp.cpp has a Python version available. In the official downloadable examples, it seems only C and Fortran versions are provided.
If not, are the two statements GetSpeciesConcentrations and SpeciesConcentrations2Module still usable in Python? I might try to adapt it into a Python version myself.
Thank you for your help.
Logged
dlparkhurst
Global Moderator
Posts: 4338
Re: species_cpp.cpp with python
«
Reply #1 on:
04/03/26 14:10 »
GetConcentrations and SetConcentrations is sufficient and faster unless you are calculating multicomponent diffusion or electrodiffusion, in which case you need the "Species" versions.
There is a TestAllMethods Python script that demonstrates the use of all of the methods available in Python--GetSpeciesConcentrations and SpeciesConcentrations2Module are included in the script.
If you install the Python version of PhreeqcRM:
pip install phreeqcrm
or
conda install -c conda-forge phreeqcrm
Here are examples of of commands to obtain documentation on methods for PhreeqcRM and BMIPhreeqcRM:
help("phreeqcrm.PhreeqcRM")
help("phreeqcrm.BMIPhreeqcRM")
help("phreeqcrm.PhreeqcRM.Concentrations2Utility“)
help("phreeqcrm.BMIPhreeqcRM.add_output_vars")
You should be able to translate species_cpp.cpp to Python, but don't do it unless you are doing multicomponent diffusion.
Logged
Rumple
Frequent Contributor
Posts: 12
Re: species_cpp.cpp with python
«
Reply #2 on:
04/03/26 16:19 »
Yes, I am working on multicomponent diffusion, but I've just realized that it's possible to work with specific species. Previously, using elements was not powerful enough for my needs. Thank you for providing the command examples; I will give them a try.
Logged
Print
Pages: [
1
]
Go Up
« previous
next »
PhreeqcUsers Discussion Forum
»
Processes
»
Reactive transport modelling
»
species_cpp.cpp with python