Comments (2)
Hi.
I think the error is due to the component names. See available components in this file:
https://github.com/equinor/neqsim/blob/master/src/main/resources/neqsim_component_names.txt
Try to run the following code:
from neqsim.thermo import fluid,fluid_df,TPflash,printFrame
import pandas as pd
gas = {"methane": 95, "nitrogen": 1, "CO2": 0.2, "ethane": 1, "propane": 0.6, "n-butane": 0.3, "n-pentane": 0.08, "n-hexane": 0.4, "oxygen": 0.05}
fluid = fluid('srk')
for key in gas.keys():
fluid.addComponent(key, gas[key], "mol/sec")
fluid.setTemperature(320.0, 'K')
fluid.setPressure(10.0, 'bara')
TPflash(fluid)
printFrame(fluid)
#Alternative way of creating the fluid
naturalgas = {'ComponentName': ["nitrogen", "CO2", "methane", "ethane", "propane", "i-butane", "n-butane", "i-pentane", "n-pentane", "n-hexane"],
'MolarComposition[-]': [0.34, 0.84, 90.4, 5.199, 2.06, 0.36, 0.55, 0.14, 0.097, 0.014]
}
naturalgasdf = pd.DataFrame(naturalgas)
naturalgasFluid = fluid_df(naturalgasdf)
naturalgasFluid.setTemperature(320.0, 'K')
naturalgasFluid.setPressure(10.0, 'bara')
TPflash(naturalgasFluid)
printFrame(naturalgasFluid)
from neqsim-python.
Thank you very much for the reply. Indeed, I think it was also not correct before, but as I did not get a feedback from neqsim, I did not noticed that something was wrong.
I guess the fact that I am now getting an error message is because of the new Java bridge since v. 2.3.0. Thanks for that, it is useful to get feedback from the tool.
And thanks for the alternative method to create a fluid.
from neqsim-python.
Related Issues (16)
- src folder does not play nice with pip install -e
- error: AttributeError: module 'neqsim' has no attribute 'thermodynamicOperations' HOT 1
- configure codespace / devcontainer.json
- Java error: UnsupportedClassVersionError HOT 2
- Add hydrate temperature analyzer
- One should note that the class path can only be set prior starting the JVM
- Issue with ammonia in pipe function HOT 2
- update neqsim version
- version 2.5.0
- python neqsim calcproperties gives error in new package version HOT 1
- fix if dataframe has only pseudo components
- Support python 3.12 HOT 1
- Propose to rename repo to neqsim-python HOT 2
- ERROR neqsim.thermo.phase.PhaseEos - Failed to solve for molarVolume within the iteration limit. HOT 2
- Pandas support HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from neqsim-python.