{"action":"created","issue":{"url":"https://api.github.com/repos/CoolProp/CoolProp/issues/351","labels_url":"https://api.github.com/repos/CoolProp/CoolProp/issues/351/labels{/name}","comments_url":"https://api.github.com/repos/CoolProp/CoolProp/issues/351/comments","events_url":"https://api.github.com/repos/CoolProp/CoolProp/issues/351/events","html_url":"https://github.com/CoolProp/CoolProp/issues/351","id":52092128,"number":351,"title":"draw_process disappeared and problems in draw_isolines","user":{"login":"pdewallef","id":10206458,"avatar_url":"https://avatars.githubusercontent.com/u/10206458?v=3","gravatar_id":"","url":"https://api.github.com/users/pdewallef","html_url":"https://github.com/pdewallef","followers_url":"https://api.github.com/users/pdewallef/followers","following_url":"https://api.github.com/users/pdewallef/following{/other_user}","gists_url":"https://api.github.com/users/pdewallef/gists{/gist_id}","starred_url":"https://api.github.com/users/pdewallef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pdewallef/subscriptions","organizations_url":"https://api.github.com/users/pdewallef/orgs","repos_url":"https://api.github.com/users/pdewallef/repos","events_url":"https://api.github.com/users/pdewallef/events{/privacy}","received_events_url":"https://api.github.com/users/pdewallef/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":26,"created_at":"2014-12-16T09:51:51Z","updated_at":"2015-07-07T21:02:07Z","closed_at":null,"body":"It seems that the function draw_process disappeared from CoolProp release 5. In CoolProp 4 it used to be a part of PropsPlot but it is no longer present. Moreover, I noticed some issues in using draw_isolines in T-s property plot. Isobaric curves are flat.`\r\n\r\nI supply below my code and the resulting chart.\r\n\r\n    from CoolProp.CoolProp import PropsSI\r\n    from CoolProp.Plots import PropsPlot\r\n    import matplotlib.pylab as pl\r\n    from numpy import *\r\n    %matplotlib inline\r\n\r\n    eta_e_s = 0.88\r\n    eta_p_s = 0.5\r\n    T_max = 550 + 273.15\r\n    p_max = 13000.e3 \r\n    p_cd = 5.e3\r\n\r\n    def SimpleRankineCycle(T3, p3, p1, epsilon_e, epsilon_p, fluid='water'):\r\n       h1 = PropsSI('H', 'P', p1, 'Q', 0., fluid)\r\n       s1 = PropsSI('S', 'P', p1, 'Q', 0., fluid)\r\n       T1 = PropsSI('T', 'P', p1, 'Q', 0., fluid)\r\n\r\n       p2 = p3\r\n       h2 = h1 + (PropsSI('H', 'P', p2, 'S', s1, fluid) - h1) / epsilon_p\r\n       s2 = PropsSI('S', 'H', h2, 'P', p2, fluid)\r\n       T2 = PropsSI('T', 'H', h2, 'P', p2, fluid)\r\n\r\n       h3 = PropsSI('H', 'P', p3, 'T', T3, fluid)\r\n       s3 = PropsSI('S', 'H', h3, 'P', p3, fluid)\r\n\r\n       p4 = p1\r\n       h4 = h3 - epsilon_e * (h3 - PropsSI('H', 'P', p4, 'S', s3, fluid))\r\n       s4 = PropsSI('S', 'H', h4, 'P', p4, fluid)\r\n       T4 = PropsSI('T', 'H', h4, 'P', p4, fluid)\r\n\r\n       w_net = h3 - h4\r\n       q_boiler = h3 - h2\r\n       eta_c = w_net / q_boiler\r\n\r\n       Ts = PropsPlot(fluid, 'Ts')\r\n       Ts.draw_isolines('P', [p1, p3], num=10)\r\n       Ts.set_axis_limits([0., 12., 200., 900.])\r\n\r\n      ax = Ts.axis\r\n      ax.text(s1/1000, T1,' 1', fontsize=10, rotation=0, color='r')\r\n      ax.text(s2/1000, T2,' 2', fontsize=10, rotation=0, color='r')\r\n      ax.text(s3/1000, T3,' 3', fontsize=10, rotation=0, color='r')\r\n      ax.text(s4/1000, T4,' 4', fontsize=10, rotation=0, color='r')\r\n      ax.text(8., 850., \"Efficiency: %.1f%%\" %(eta_c*100.))\r\n      ax.text(8., 800., \"Net work: %d kJ/kg\" %(w_net/1000))\r\n      ax.text(8., 750., \"Heat input: %d kJ/kg\" %(q_boiler/1000))\r\n      return Ts\r\n\r\n    Ts = SimpleRankineCycle(T_max, p_max, p_cd, eta_e_s, eta_p_s, fluid=\"water\")\r\n\r\n![chart](https://cloud.githubusercontent.com/assets/10206458/5451550/6e58504e-8511-11e4-91a5-2c065c4c3292.png)\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/CoolProp/CoolProp/issues/comments/119339694","html_url":"https://github.com/CoolProp/CoolProp/issues/351#issuecomment-119339694","issue_url":"https://api.github.com/repos/CoolProp/CoolProp/issues/351","id":119339694,"user":{"login":"mayersre","id":8641143,"avatar_url":"https://avatars.githubusercontent.com/u/8641143?v=3","gravatar_id":"","url":"https://api.github.com/users/mayersre","html_url":"https://github.com/mayersre","followers_url":"https://api.github.com/users/mayersre/followers","following_url":"https://api.github.com/users/mayersre/following{/other_user}","gists_url":"https://api.github.com/users/mayersre/gists{/gist_id}","starred_url":"https://api.github.com/users/mayersre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mayersre/subscriptions","organizations_url":"https://api.github.com/users/mayersre/orgs","repos_url":"https://api.github.com/users/mayersre/repos","events_url":"https://api.github.com/users/mayersre/events{/privacy}","received_events_url":"https://api.github.com/users/mayersre/received_events","type":"User","site_admin":false},"created_at":"2015-07-07T21:02:07Z","updated_at":"2015-07-07T21:02:07Z","body":"I can not contribute my last code as it belongs to the school. But this is in general how I structure it : \r\n- create a class c1 for the type of diagram\r\n- create an inside class for the lines and labels data, so it can be stored and loaded\r\n- inside create a method m1 for each line, it only draws one line and labels it\r\n- inside create a method m2 to calculate the amount of lines of one type and plot them using m1\r\n\r\nExample just fragments of code or declarations :\r\n\r\nclass diagram_p_h:\r\n    #\r\n    def __init__(self,\r\n         ref=None,          # Refrigerant name for backend e.G. REFPROP::Propane\r\n         refname=None,      # Refrigerant name for Title   e.G. R-290\r\n         title=u'Nice Log p h Diagram for %s \\n',\r\n         pmin=50000,        # Y-Axis lowest value in Pascal\r\n         pmax=None,         # Y-Axis highest value in Pascal\r\n         hmin=None,         # X-Axis lowest value in J/kg\r\n         hmax=None,         \r\n         smin=None,         # Entropy\r\n         smax=None,\r\n         Tmin=173.15,       # Temperature\r\n         Tmax=493.15,\r\n         Ttrip=None,        # override automatic, Sometimes neccessary for mixtures\r\n         PlotFogArea=False, # Isochoric and Isentropic lines for q=0 to 1\r\n         s_distance=None,   # distance from one isentropic line to the next in J/(kgK)\r\n         t_distance=10,     # distance from one isothermal line to the next defaults to 10°C None=automatic\r\n         isothermals=None,  # numpy array with values for all isothermal lines, disables automatic\r\n         qualities=None,    # numpy array with values for all quality lines, disables automatic\r\n         isentropics=None,  # numpy array with values for all isentropic lines, disables automatic\r\n         #\r\n         size_x=14,         # Figure size in inches\r\n         size_y=10,         #\r\n         yticks=None,       # ticks to use on the pressure axis, None=automatic\r\n         legende=True,      # display legend\r\n         top=0.94,          # Borders of figure in plot\r\n         bottom=0.08,\r\n         left=0.06,\r\n         right=0.96,\r\n         #\r\n         data=None,         # class of calculated data, no calculation, plot from data\r\n\r\n         **kwargs):\r\n        \r\n        # Now define colors, \r\n        self.h_color='DarkCyan' # b\r\n        self.t_color='r' # r\r\n        self.d_color='SeaGreen' # g\r\n        self.x_color='k' # k\r\n        self.p_color='brown'\r\n        self.s_color='blue'\r\n        self.cp_color='MediumPurple'\r\n        self.BubbleLine_color='MediumVioletRed'\r\n        self.DewLine_color='DarkBlue'\r\n        #ticks ...  \r\n        ticks[water]=([0.007,0.008,0.01,0.015,0.02,0.03,0.04,0.05,0.06,0.07,0.08,0.1,0.15,0.2,0.3,0.4,0.5,0.6,0.7,0.8,1.0,1.5,2,3,4,5,6,7,8,10,15,20,30,40,50,60,70,80,100,150,200,250,300,350])\r\n        ticks[p45]= ...\r\n        # then grid ...\r\n        # place axis ticks and labels and titles\r\n        # add Methods to load/save data, png, ps, svg, add Logos\r\n        # Determine Critical point and Triple point, iterate a close value for plotting in case of failure\r\n        # set reference state\r\n                \r\n    def Plot_saturation_lines(self):\r\n        #\r\n    def Plot_Isothermal_Line(self, #plots just one line\r\n                       Temperature, \r\n                       Color='r', \r\n                       Linewidth=0.5,\r\n                       Label=True,\r\n                       Commadigits=2):\r\n        \r\n    def Plot_isothermal_lines(self):\r\n        # calculates amount of lines and calls Plot_Isothermal_Line for each\r\n        \r\n    def Plot_Isentrope(self,\r\n                       Entropy,\r\n                       Color='b',\r\n                       Linewidth=0.5,\r\n                       Label='s={0:.2f}'): # Label can not only be true or false ...\r\n    \r\n    def Plot_isentropic_lines(self):\r\n        #\r\n        minorsteps=self.s_distance*self.kJ # thin lines\r\n        majorsteps=5.0*minorsteps          # thick labeled lines\r\n        #\r\n        # Find a start and end for Isentropic lines, I try around critical point and lower right corner of diagram\r\n        s_top    = round((PropsSI('S','T',self.Tcrit,'Q',1,self.ref))/100,0)*100.0\r\n        s_bottom = round((PropsSI('S','P',self.pmin,'H',self.hmax,self.ref))/100,0)*100.0\r\n        #\r\n        isentropics=np.arange(s_top,s_bottom,minorsteps)*1.0 # make it floats\r\n        #\r\n        for iv in range(len(isentropics)):\r\n            if ( (isentropics[iv]% (majorsteps-0.00001)) < minorsteps ) :\r\n                Linewidth=0.5\r\n            else :\r\n                Linewidth=0.25  \r\n\r\nFinally I format the labels usually down to 4 relevant digits depending on the size of\r\nmy value to have not unneccessary long values and avoid exponential notation.\r\n\r\n                if (specific_volume < 0.01) :\r\n                    vlabel='v={0:.6f}'\r\n                elif (specific_volume >= 0.01) and (specific_volume <= 0.1 ):\r\n                    vlabel='v={0:.5f}'\r\n                elif (specific_volume >= 0.1) and (specific_volume < 10 ):\r\n                    vlabel='v={0:.4f}'\r\n                elif (specific_volume >= 10) :\r\n                    vlabel='v={0:.2f}'\r\n                elif (specific_volume >= 100) :\r\n                    vlabel='v={0:.1f}'\r\n\r\nI hope this helps or inspires a little"}}