Skip to content

Latest commit

 

History

History
68 lines (53 loc) · 1.6 KB

README.rst

File metadata and controls

68 lines (53 loc) · 1.6 KB

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"))

Known Issues -------There is no support for aromatic compounds, supplying a SMILES string with aromatic rings in it will result in a parsing error.

Credits