GithubHelp home page GithubHelp logo

equinor / neqsim-matlab Goto Github PK

View Code? Open in Web Editor NEW
9.0 4.0 3.0 498.28 MB

NeqSim is a library for calculation of fluid behavior, phase equilibrium and process simulation. This project is the Matlab interface to NeqSim.

Home Page: https://equinor.github.io/neqsimhome/

License: Apache License 2.0

MATLAB 98.62% M 1.38%
thermodynamics oil gas gas-production thermodynamic-properties thermodynamics-models

neqsim-matlab's Introduction

NeqSim Logo

NeqSim Matlab

NeqSim Matlab is part of the NeqSim project. NeqSim Matlab is a Matlab interface to the NeqSim Java library for estimation of fluid behavior and process design.

Releases

See release folder

Getting Started

See the NeqSim Matlab Wiki for how to use NeqSim Matlab.

Initial setup

The NeqSim Matlab package is downloaded by cloning the library to your local computer (alternatively fork it to your private reprository). The following commands are dependent on a local installation of GIT.

git clone https://github.com/equinor/neqsimmatlab.git
cd neqsimmatlab

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests.

Discussion forum

Questions related to neqsim can be posted in the github discussion pages.

Versioning

NeqSim use SemVer for versioning.

Licence

NeqSim is distributed under the Apache-2.0 licence.

Acknowledgments

A number of master and PhD students at NTNU have contributed to development of NeqSim. We greatly acknowledge their contributions.

File System doc/ : Documentation for this library. example/ : Contains several examples of how EJML can be used to solve different problems or how neqsim can be modified for different applications. neqsim/ : Library source code lib/ : various labraries used for implementing NeqSim in Matlab ext/: external libraries used by NeqSim Matlab changelog.txt : History of what changed between each version. license.txt: license document

neqsim-matlab's People

Contributors

asmfstatoil avatar evensol avatar marlenelund avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

neqsim-matlab's Issues

Make new script able to run (implement new Java/Matlab methods)

The following script should be able to run:

%specify defined components
definedcomponents.names = {'water', 'methane', 'ethane', 'propane'}
definedcomponents.composition = [0.12 0.1 0.9 0.05]

%specify oil components
oilcomponents.names = {'C7', 'C8'}
oilcomponents.composition = [0.10, 0.220]
oilcomponents.molarmass = [0.10, 0.120]
oilcomponents.relativedensity = [0.7, 0.73]
oilcomponents.plusfraction = 0

% Create a neqsim fluid based on defined and oil components
fieldFluid = fluid(definedcomponents, oilcomponents);

%Initializing the process simulation
resetProcessOperations()

%Create a well stream with the field fluid and set flow, pressure and temperature
fieldWellStream = stream(fieldFluid);
fieldWellStream.setFlowRate(5.0, 'MSm3/day');
fieldWellStream.setTemperature(50.0, 'C');
fieldWellStream.setPressure(50.0, 'bara');

%Add a three phase separator taking the well stream as input. Set
%separation efficiency
wellStreamSeparator = separator(fieldWellStream);

% Set fraction of gas/oil/water to be entrained in gas/oil/water
wellStreamSeparator.setEntrainment(0.01, "", "oil", "gas");
wellStreamSeparator.setEntrainment(0.01, "", "aqueous", "gas");
% Set fraction of gas and water to be entrained in oil
wellStreamSeparator.setEntrainment(0.01, "", "gas", "oil");
wellStreamSeparator.setEntrainment(0.01, "", "aqueous", "oil");
% Set fraction of gas and oil to be entrained in aqueous
wellStreamSeparator.setEntrainment(0.01, "", "gas", "aqueous");
wellStreamSeparator.setEntrainment(0.01, "", "oil", "aqueous");

% Creating the gas, oil and water streams from the separator
separatedGasStream = stream(wellStreamSeparator.getGasOutStream());
separatedOilStream = stream(wellStreamSeparator.getOilOutStream());
separatedAqueousStream = stream(wellStreamSeparator.getWaterOutStream());

%running the process
runProcess();

deltaT = 10.0;

% Gas calculations - evaluating effect on density
%reading gas density at separation temperature and pressure
flash(separatedGasStream.getFluid(),'TP', separatedGasStream.getTemperature("C"), separatedGasStream.getPressure('bara'), "C", "bara");
gasDensityAtSeparatorConditions = separatedGasStream.getFluid().getPhase('gas').getDensity('kg/m3');
gasCompositionAtSeparatorConditions = separatedGasStream.getFluid().getPhase('gas').getComposition('molefraction');
separatedGasStream.getFluid()
%To shwo detailed results of the flash calculation, unncomment the follwong commands:
%separatedGasStream.getFluid()
%printfluid(separatedGasStream.getFluid()

%redusing temperature by a delta T and flash it at constante volume
flash(separatedGasStream.getFluid(),'TV', (separatedGasStream.getTemperature("C")-deltaT), separatedGasStream.getFluid().getVolume("m3"), "C", "m3");
gasDensityAfterTemperatureReduction = separatedGasStream.getFluid().getPhase('gas').getDensity('kg/m3');
gasCompositionAfterTemperatureReduction = separatedGasStream.getFluid().getPhase('gas').getComposition('molefraction');
pressureAfterTemperatureReduction = separatedGasStream.getFluid().getPressure('bara');
%To shwo detailed results of the flash calculation, unncomment the follwong commands:
%separatedGasStream.getFluid()
%printfluid(separatedGasStream.getFluid()
separatedGasStream.getFluid()
changeInDensity = (gasDensityAfterTemperatureReduction-gasDensityAtSeparatorConditions)/gasDensityAtSeparatorConditions*100
%print final results.....

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.