Skip to content
Implementation of the UNIFAC model
Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
test
unifac
.gitattributes
.gitignore
MANIFEST.in
NEWS.txt
README.rst
__init__.py
parser.out
setup.py
text_mode.py

README.rst

Usage

Run text_mode.py

Available commands:

ADD <smiles> <quantity>
<smiles> - SMILES notation of compound added <quantity> - amount (in moles) of compound
PRINT <smiles>
prints activity coefficient of <smiles>
TEMPERATURE <temp>
<temp> - temperature of the solution in K
RESET
resets the solution

Example

For equimolar mixture of water and pentanamine do:

ADD CCCCCN 1
ADD O 1
PRINT CCCCCN
> Activity coefficient for:  CCCCCN   1.0009635890593225
PRINT O
> Activity coefficient for:  O   1.4522017025416403

API

Text mode commands map directly to the methods of unifac.Facade.

Facade.add_molecule_smiles(smiles, quantity)
Adds the specified amount od compound into the mixture. Use negative quantities to remove.
Facade.getcoeff(smiles)
Returns the activity coefficient of the compound in current mixture.
Facade.set_temperature(temp)
Sets the temperature of current mixture
Facade.reset_solution()
Resets the mixture to empty state, and the temperature to 273K

Example

from unifac.facade import Facade

  f = Facade()
  print(f.__dict__)

  f.add_molecule_smiles("CCCCCN", 1.0)
  f.add_molecule_smiles("O", 1.0)
  print("Pentanamine activity coefficient: ")
  print(f.get_coeff("CCCCCN"))
  print("Water activity coefficient: ")
  print(f.get_coeff("O"))

Credits

You can’t perform that action at this time.