@allanleal, regarding our conversation in the thread about constraining the H2O(g)-H2O(l) phase boundary in P-T space, I tested a few different constraint and initial condition combos:
The first three succeeded, but the last failed with the following error message:
import reaktoro as rkt
db = rkt.ThermoFunDatabase("slop98")
# initialize object to hold phases
phases = rkt.Phases(db)
# add species to aq. phase; add aq. phase to system
aqueous_phase = rkt.AqueousPhase(["H2O@"]) # aq. species
phases.add(aqueous_phase)
# add species to gas phase; add gas phase to system
gaseous_phase = rkt.GaseousPhase(["H2O"]) # gases
phases.add(gaseous_phase)
# create system
system = rkt.ChemicalSystem(phases)
# set specifications for equilibrium solver
specs = rkt.EquilibriumSpecs(system)
specs.temperature()
specs.phaseAmount("GaseousPhase")
# set constraints and calculate equilibrium state
solver = rkt.EquilibriumSolver(specs)
conditions = rkt.EquilibriumConditions(specs)
conditions.temperature(150, "C")
conditions.phaseAmount("GaseousPhase", 1e-6)
conditions.setLowerBoundPressure(1.0, "bar")
conditions.setUpperBoundPressure(100.0, "bar")
# initialize state
state = rkt.ChemicalState(system)
state.set("H2O", 1, "kg")
result = solver.solve(state, conditions)
if result.optima.succeeded is True:
print("The equilibrium calculation succeeded!")
else:
print("The equilibrium calculation failed!")
print(state)
solution = AqueousPhase(speciate("H O Na Cl Ca C Si Mg P S K Zn"))
. Please let us know how could we obtain it ?
Hello! You'll need to list the species you want as shown below:
AqueousPhase("H2O H+ OH- Na+ Cl-") # species names need to be exactly as found in the database
There is no capability at the moment to remove/exclude species with a certain oxidation state from the definition of a phase.
I'm trying to compile Reaktoro to better understands how it works, (and see if I can do a few pull requests for missing python binfdings (e.g. ElementComposition iterator)), but I run into a strange issue with the tests in ChemicalProps:
> state.setTemperature(100.0)#, 'celsius')
E TypeError: setTemperature(): incompatible function arguments. The following argument types are supported:
E 1. (self: reaktoro.reaktoro4py.ChemicalState, arg0: autodiff::detail::Real<1ul, double>) -> None
E 2. (self: reaktoro.reaktoro4py.ChemicalState, arg0: autodiff::detail::Real<1ul, double>, arg1: str) -> None
The problem is in the first argument. Where are the python overload for real
defined ?
and the main gcc is used
Is this gcc from your system, right?
-- CCache: Found ccache installed.
-- CCache: Using ccache to potentially speed up the build operation.
-- The CXX compiler identification is GNU 9.4.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /home/allan/miniconda3/envs/reaktoro/bin/x86_64-conda-linux-gnu-c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- CondaAware: Conda environment detected!
-- CondaAware: Found environment variable CONDA_PREFIX=/home/allan/miniconda3/envs/reaktoro
-- CondaAware: Setting PYTHON_EXECUTABLE=/home/allan/miniconda3/envs/reaktoro/bin/python
-- CondaAware: Set CONDA_AWARE_PREFIX=/home/allan/miniconda3/envs/reaktoro
-- CondaAware: Setting CMAKE_INSTALL_PREFIX=CONDA_AWARE_PREFIX=/home/allan/miniconda3/envs/reaktoro
-- CondaAware: Appended /home/allan/miniconda3/envs/reaktoro to CMAKE_PREFIX_PATH
-- CondaAware: Appended /home/allan/miniconda3/envs/reaktoro/include to include directories
-- CondaAware: Appended /home/allan/miniconda3/envs/reaktoro/lib to link directories
phreeqc4rkt
includes some changes in the PHREEQC source code. It will probably continue to exist for a while.
state = ChemicalState(system)
I'm getting an error in following line which used to work before:
state.temperature(25.0, "celsius")
TypeError: temperature(): incompatible function arguments. The following argument types are supported:
1. (self: reaktoro.reaktoro4py.ChemicalState, arg0: autodiff::detail::Real<1ul, double>) -> None
2. (self: reaktoro.reaktoro4py.ChemicalState, arg0: autodiff::detail::Real<1ul, double>, arg1: str) -> None
3. (self: reaktoro.reaktoro4py.ChemicalState) -> autodiff::detail::Real<1ul, double>
Is there any solution to fix this?
v2.0rc19
, wondering if this is the issue
v2.0rc19