Skip to main content

Tools for launching EES calculation and retrieving results from python

Project description

EES connector

EES connector is a tools developed by the SERG research group of the University of Florence for launching EES calculation and retrieving results from python.

The beta version can be downloaded using PIP:

pip install EES_connector

Once the installation has been completed the user can import the tool and initialize the connector itself.

from EESConnect import EESConnector

with EESConnector() as ees:

    # insert your code here

Two important aspects to keep in mind for the initialization:

  • Please use the with statement during the initialization as shown above

  • A file-dialog will appear the first time that the connector is imported asking the user to select the EES executable path (usually it's "C:\EES32\ees.exe"). Once the executable path has been selected, the program keep it in memory in order to avoid new appearance of the file-dialog. The stored executable can be modified calling the following function:

from EESConnect import EESConnector

EESConnector.modify_ees_executable_path()

Finally, you can ask the program to launch EES calculation using the following command:
from EESConnect import EESConnector
from tkinter import filedialog
import tkinter as tk

#select the ees file path
root = tk.Tk()
root.withdraw()
ees_file_path = filedialog.askopenfilename()

with EESConnector() as ees:
    
    ees.ees_file_path = ees_file_path
    result = ees.calculate(["air_ha", 110, 1013.25])
    print(result[1])

Multiple call are possible passing a dictionaty in the ees.calculate() function in order to speed up the calculation process (the program is loaded on the RAM only once):

from EESConnect import EESConnector
from tkinter import filedialog
import tkinter as tk

#select the ees file path
root = tk.Tk()
root.withdraw()
ees_file_path = filedialog.askopenfilename()

with EESConnector() as ees:
    
    ees.ees_file_path = ees_file_path
    result = ees.calculate({

            "air_ha":   ["air_ha", 300, 1013.25],
            "R22":      ["R22", 300, 1013.25],
            "R236fa":   ["R236fa", 300, 1013.25],
            "R134a":    ["R134a", 300, 1013.25]

        })
    
    print(result["R22"][1])
    print(result["R236fa"][1])

Please notice that the EES file has to be configured properly in order to work.
Here's an example, that works with the python code described above:

$UnitSystem SI K kPa kJ 
$Import 'ees_input.dat' F$ T P

h=enthalpy(F$; T=T; P=P)
s=entropy(F$; T=T; P=P)

$Export 'ees_output.dat' h s

An explaination on how to set EES properly can be found here. Two important things had to be noted:

  • The input defined in the EES file must be consistent with the list provided to the calculation function as an input

  • The input and output file in the EES code must be called "ees_input.dat" and "ees_output.dat" respectively!



-------------------------- !!! THIS IS A BETA VERSION !!! --------------------------

please report any bug or problems in the installation to pietro.ungar@unifi.it
for further information visit: https://tinyurl.com/SERG-3ETool

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

EES_connector-0.1.2.tar.gz (19.4 kB view details)

Uploaded Source

File details

Details for the file EES_connector-0.1.2.tar.gz.

File metadata

  • Download URL: EES_connector-0.1.2.tar.gz
  • Upload date:
  • Size: 19.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.12

File hashes

Hashes for EES_connector-0.1.2.tar.gz
Algorithm Hash digest
SHA256 57a54d3762c14cca2491e52ab1a757ec63d13761385f9cc462334691d0acd392
MD5 b3ff21af71e7f54b0ceb9bbebdd21898
BLAKE2b-256 58cf2b9abd9670c7abb1f7909b66596580c5a20cf3c0eece553ccca871797ef2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page