Coder Social home page Coder Social logo

gkampolis / zfactor Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 49 KB

Calculates the gas deviation factor Z for a simple hydrocarbon gas (composed entirely of up to three compounds: methane, ethane and propane), according to Standing's correlations.

MATLAB 100.00%

zfactor's Introduction

Zfactor

Short description

Calculates Z (a factor measuring deviation from ideal behaviour, see below) for a simple hydrocarbon gas (composed entirely of up to three compounds: methane, ethane and propane), according to Standing's correlations.

Slightly Longer description

User is asked to provide composition values for C1,C2 & C3 and then Z is calculated for T(50-200F) and P(14.7 and 100-2000 psia). Main output is a plot of Z vs P for four different T. Secondary output is a table of Z values for the various P & T. Currently the table is not displayed by default, however this can be changed by removing the percent sign "%" from the last line of the script's .m file. Furthermore, loops are avoided.

The script is written in such a way to be easily modifiable (for example different ranges for pressure & temperature, or adding more compounds).

What is Z?

Z is a factor that quantifies how a real gas behaves differently that an ideal gas. It's known as the gas deviation factor or the compression factor. It's a very usefull property as it allows the generalisation of ideal gas law in thermodynamics: PV=nZRT.

It's defined as the ratio of the molar volume of a gas to the molar volume of an ideal gas at the same temperature and pressure. See more at Wikipedia.

zfactor's People

Contributors

gkampolis avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.