Skip to content

This application's main feature is the calculation of the density of gas mixtures, through the resolution of Peng Robinson's cubic equation of state.

License

Notifications You must be signed in to change notification settings

HidroUFF/calculadora-massa-especifica

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logo

HidroUFF Density Calculator

This application's main feature is the calculation of the density of gas mixtures, through the resolution of Peng Robinson's cubic equation of state. Currently, there are 20 substances already registered in the tool and support for adding new substances by the user. In addition, the tool has an interface in English, Portuguese and Spanish.

Version 1.3.0

How to useExecution via executable fileExecution via source codeGeneral orientationsAddition of substancesDemonstrationTechnologyDevelopmentQuotingDeveloper's Guide

How to use

To use the application, just inform the molar fraction of each substance that makes up the mixture, the temperature in ATM, and the pressure value. Pressure can be a single value or a range of values. To do so, inform the initial, final and step values between them. When performing the calculation for a range of pressure values, it is possible to generate the Isotherm graph or save the result in a .csv (comma-separated values) file. This file can be used later to generate the graph directly, without the need to perform the calculations again. To use this feature, keep the original file format, changing only numeric values if necessary.

Execution via executable file

  • Just download the Calculadora de Massa Específica HidroUFF.exe file, located in the /bin directory, and run it. No installation is required.
  • The executable file is only compatible with Windows operating system.
  • Execution via source code

    Requirements

    • Python 3.x
    • Pip

    After installing the Python language and the pip package installer, install the following dependencies through the terminal:

    • Sympy
    pip install sympy
    
    • Matplotlib
    pip install matplotlib
    
    • PyQt5
    pip install PyQt5
    

    Execution

  • Download the source code using the command: git clone https://github.com/HidroUFF/calculadora-massa-especifica
  • Make sure the requirements are installed correctly.
  • Always start the program execution via the 'main.py' file, as this is the main file.
  • Always start the execution of the commands through the root directory of this project (directory where the file 'main.py' is).
  • The file 'imagesAndFonts_rc.py' contains the images and fonts used by the interface, it is recommended not to change this file so as not to generate inconsistencies and errors.
  • There may be some differences in the interface of different operating systems.
  • General orientations

    • The sum of the molar fractions must equal 1.0.
    • Use period (.) as decimal separator.
    • Do not use thousands separator.
    • The .csv file must be separated by a semicolon (;).
    • Do not modify the header of the .csv file as it is used by the program. If modified, it can lead to errors in reading the file and generating the graph from it.
      • The keywords used in certain lines to identify each column must not have any of its letters altered.
      • File structure:
        • First key line: Composition
        • Second key line: Substance; Molar Fraction (remembering that ; separates the columns of the file)
        • Below are registered names of selected substances in the first column and the molar fraction of these substances in the second column. E.g.: CO2;1.0
        • Third key line: Temperature
        • Below will be registered some temperature value in Kelvin. E.g.: 100.0
        • Fourth key line: Density
        • Fifth key line: atm;kg/m³
        • Below are recorded pressure and density values. E.g.: 1e-08;1533.491

    Addition of new substances

    To carry out the addition of new substances, it is first necessary to follow the steps indicated in Execution via source code. After that, follow the step by step:
    • Add to the substancias.csv file, present in the /data directory, the name of the substance in Portuguese, English and Spanish. In addition, it is necessary to inform molar mass (g/mol), critical pressure (KPa), critical temperature (K) and acentric factor.
    • It is also necessary to update the kij.csv file, present in the /data directory. Kij is an interaction parameter between each pair of substance types that can be formed (where interactions of the same substance is always 0).
    • In order for the addition to be persisted, run the csvToPy.py program, which is located in the /utility directory. This utility will generate the constant.py file, in the /src directory, which will be used by the application.
    • Attention:
      • When inserting new elements in the substancias.csv file, follow the same order when adding the properties in the rows and columns of the kij.csv file, and vice versa, to maintain the integrity and functioning of the calculator .
      • Do not use special characters such as '()', '[]', '@', '#', '$' etc when naming substances.
      • You must have the 'unidecode' library installed on your computer. To perform the installation, use the command:
    pip install unidecode
    

    Technology

    Python
    • Python - version 3
    • Python libraries:
      • PyQt5
      • Sympy
      • Matplotlib

    Demonstration

    • Enter the desired composition and temperature.
    • If you want to calculate the specific mass for a single pressure, choose the Single option, enter the desired value and click on Calculate. The result will be displayed on the screen.
    • If you want to calculate the specific mass for a range of pressure values, choose the Range option, enter the initial and final value and the step between them and click on the Isotherm Graph button to obtain a graph or the Generate CSV button to save the calculation results to a CSV file extension.
    • Graph example.
    • Example CSV file.
    • It is possible to change the language through the lower left button, just click to switch between English, Spanish and Portuguese. In addition, there are three upper buttons on the right side of the interface that serve, respectively, to generate a graph of the isotherm from a CSV file previously generated by the application, consult help and obtain more information about the program.

    Development

    • Developed by:
      • Mateus Pereira de Sousa
      • Valesca Moura de Sousa
    • Advisors:
      • Felipe Pereira de Moura
      • Fernanda Gonçalves de Oliveira Passos
      • Rogério Fernandes de Lacerda
    • HidroUFF Laboratory
    • Creation date: 08/18/2020
    • Last revised: 09/14/2021
    • Any suggestions or questions about the application, communicate one of the responsible: lab.hidrouff.tce@id.uff.br

    Quoting

    If the HidroUFF Specific Mass Calculator contributed to any project or research that resulted in a publication, please cite it.

    DOI