파이썬으로 EES 만들기 (Make your own EES using python)steemCreated with Sketch.

in #python7 years ago (edited)

EES는 Engineering Equation Solver 라는 프로그램으로 주로 열역학과 관련된 계산을 하는 사람들이 주로 사용합니당. 간단한 코딩으로 손쉽게 열역학 계산을 할 수 있기 때문에 싸이클 시뮬레이션을 해보기도 좋고 plot 기능과 무엇보다 아주 강력한 refprop이 달려있어서 각종 물질의 물성치를 아주 쉽게 구할 수 있습니다.

EES is Engineering Equation Solver, which is widely used for engineers in thermodynamics. you can make simple code to solve equations easily like thermodynamic cycle(Rankine... etc) and EES has beautiful plot library and powerful refprop library for getting thermodynamic properties.

아주 좋은 프로그램이지만 당연히 무료가 아니죠, 유료에요. ㅠ.ㅠ 하지만 파이썬으로 EES를 비슷하게 흉내낼 수 있습니다.

Of cause, this awesome application isn't free. sad... but you can rip off EES using python.

일단 아나콘다를 다운 받아야 합니다. 아나콘다는 파이썬 패키지 중 하나로 파이썬에 공학 계산에 필요한 라이브러리를 이것저것 모아뒀기 때문에 하나하나 다운 받아서 설치 할 필요 없어서 정말 편합니다.

The first step is downloading anaconda python. it's a kind of python package for engineering. the best thing is that installing is super easy. download and execute the setup file. it's so comfy.

다운은 아래 주소에서 받을 수 있습니다. 각자의 OS에 따라 맞는 것을 선택하고, 파이썬 버전은 2.7과 3.4 중에 하나를 골라야하는데 저는 그냥 2.7을 쓰기로 했습니다. 별로 중요한 문제는 아닌거 같았거든요.
https://www.continuum.io/downloads

you can get the setup file from the following url. you have four options for your OS and versions of Python, 2.7 and 3.4. I selected 2.7 but I think it's not so important.

설치 한 이후에는 물성치 계산을 위한 Coolprop 라이브러리를 설치해야 합니다. 무료 Refprop이라고 보면 됩니다. 저걸로 Rankine cycle 해석도 해봤는데 적당히 쓰기 좋았습니다. 설치할 때는 pip를 이용해야 합니다. 설치하는 방법은 cmd 콘솔창에서 'pip install CoolProp' 이라고 치면 알아서 다운 받아서 설치가 됩니다.

after installing process is done, you have to install Coolprop library for calculating thermodynamic properties. Coolprop is a free version of Refprop. I used it to analyze Rankine cycle, and it was decent. Type the command 'pip install CoolProp' in cmd prompt (if you have windows)

물성치를 사용법은 아래와 같습니다.
you can use Coolprop as following.

import CoolProp.CoolProp as CP
fluid = 'Water'
pressure_at_critical_point = CP.PropsSI(fluid,'pcrit')
vL = 1/CP.PropsSI('D','P',1e5,'Q',0,fluid)
vG = 1/CP.PropsSI('D','P',1e5,'Q',1,fluid)

그래프 그릴땐 다음과 같이.
for plotting graphs,

from CoolProp.Plots import PropertyPlot
plot = PropertyPlot('HEOS::Water', 'TS')
plot.calc_isolines()
plot.show()

water-ts.png

짜잔~
ta da~

Sort:  

파이썬으로 저런 프로그램도 개발이 가능하군요! 요즘 파이썬으로 빅데이터 크롤링 하는걸 공부하고 있었는데 신기하네요!!

Coin Marketplace

STEEM 0.20
TRX 0.12
JST 0.028
BTC 64294.34
ETH 3494.87
USDT 1.00
SBD 2.54