RankineBasic Class¶
-
class
mcycle.cycles.rankinebasic.
RankineBasic
(FlowState wf, Component evap, Component exp, Component cond, Component comp, double pEvap=nan, double superheat=nan, double pCond=nan, double subcool=nan, Config config=Config())¶ Bases:
mcycle.bases.cycle.Cycle
Defines all cycle components and design parameters for a basic four-stage (steam/organic) Rankine cycle.
Parameters: wf : FlowState
Working fluid.
evap : Component
Evaporator object. Must be subclass of HxBasic or HtrBasic. Any incoming flows of secondary fluids should be pre-defined.
exp : Component
Expander object. Must be subclass of ExpBasic.
cond : Component
Condenser object. Must be subclass of HxBasic or ClrBasic. Any incoming flows of secondary fluids should be pre-defined.
comp : Component
Compressor object. Must be subclass of CompBasic.
pEvap : float, optional
Evaporator vapourisation pressure [Pa].
superheat : float, optional
Evaporator superheating [K].
pCond : float, optional
Condenser vaporisation pressure [Pa].
subcool : float, optional
Condenser subcooling [K].
config : Config, optional
Cycle configuration parameters.
kwargs : optional
Arbitrary keyword arguments.
Attributes
TCond
float: Evaporation temperature of the working fluid in the compressor [K]. TEvap
float: Evaporation temperature of the working fluid in the evaporator [K]. comp
comp: mcycle.bases.component.Component cond
cond: mcycle.bases.component.Component config
Config: Cycle configuration parameters. dpComp
float: Pressure increase across the compressor [Pa]. dpExp
float: Pressure drop across the expander [Pa]. evap
evap: mcycle.bases.component.Component exp
exp: mcycle.bases.component.Component mWf
float: Alias of wf.m; mass flow rate of the working fluid [Kg/s]. name
name: unicode pCond
pCond: ‘double’ pEvap
pEvap: ‘double’ pRatioComp
float: Pressure ratio of the compressor. pRatioExp
float: Pressure ratio of the expander. pptdCond
float: Pinch-point temperature difference of condenser pptdEvap
sink4
FlowState: Heat sink when working fluid is at state4. sink50
FlowState: Heat sink when working fluid is at state50. sink51
FlowState: Heat sink when working fluid is at state51. sink6
FlowState: Heat sink when working fluid is at state6. sinkAmbient
FlowState: Alias of cond.ambient. sinkIn
FlowState: Alias of cond.flowInSf. sinkOut
FlowState: Alias of cond.flowOutSf. source1
FlowState: Heat source when working fluid is at state1. source20
FlowState: Heat source when working fluid is at state20. source21
FlowState: Heat source when working fluid is at state21. source3
FlowState: Heat source when working fluid is at state3. sourceAmbient
FlowState: Alias of evap.ambient. sourceIn
FlowState: Alias of evap.flowInSf. sourceOut
FlowState: Alias of evap.flowOutSf. state1
FlowState: Working fluid flow at compressor outlet/ evaporator inlet. state20
FlowState: Working fluid saturated liquid FlowState in evaporator. state21
FlowState: Working fluid saturated vapour FlowState in evaporator. state3
FlowState: Working fluid FlowState at evaporator outlet/expander inlet. state4
FlowState: Working fluid FlowState at expander outlet/condenser inlet. state50
FlowState: Working fluid saturated liquid FlowState in condenser. state51
FlowState: Working fluid saturated vapour FlowState in condenser. state6
FlowState: Working fluid FlowState at condenser outlet/ compressor inlet. subcool
subcool: ‘double’ superheat
superheat: ‘double’ wf
wf: mcycle.bases.flowstate.FlowState Methods
IComp
(self)float: Exergy destruction of compressor [W] ICond
(self)float: Exergy destruction of condenser [W] IEvap
(self)float: Exergy destruction of evaporator [W] IExp
(self)float: Exergy destruction of expander [W] ITotal
(self)float: Total exergy destruction of cycle [W] PIn
(self)float: Power input (from compressor) [W]. PNet
(self)float: Net power output [W]. POut
(self)float: Power output (from expander) [W]. QIn
(self)float: Heat input (from evaporator) [W]. QOut
(self)float: Heat output (from condenser) [W]. copy
(self, dict kwargs={})Return a new copy of a class object. effExergy
(self)float: Exergy efficiency effGlobal
(self)float: Global recovery efficiency effRecovery
(self)float: Exhaust heat recovery efficiency effThermal
(self)float: Cycle thermal efficiency [-] plot
(self[, graph, title, satCurve, newFig, …])Plots the key cycle FlowStates on a T-s or p-h diagram. run
(self[, component, flowState])Compute all state FlowStates from initial FlowState and given component definitions set_TCond
(self, double TCond)set_TEvap
(self, double TEvap)set_dpComp
(self, double value)set_dpExp
(self, double value)set_pRatioComp
(self, double value)set_pRatioExp
(self, double value)set_sinkAmbient
(self, FlowState obj)set_sinkIn
(self, FlowState obj)set_sinkOut
(self, FlowState obj)set_sourceAmbient
(self, FlowState obj)set_sourceIn
(self, FlowState obj)set_sourceOut
(self, FlowState obj)set_state1
(self, FlowState obj)set_state3
(self, FlowState obj)set_state4
(self, FlowState obj)set_state6
(self, FlowState obj)size
(self)Impose the design parameters on the cycle and execute .size() for each component. sizeSetup
(self, bool unitiseEvap, …)Impose the design parameters on the cycle (without executing .size() for each component). summary
(self, bool printSummary=True[, …])Returns (and prints) a summary of the component attributes/properties/flows. update
(self, dict kwargs)Update (multiple) Cycle variables using keyword arguments. -
IComp
(self) → double¶ float: Exergy destruction of compressor [W]
-
ICond
(self) → double¶ float: Exergy destruction of condenser [W]
-
IEvap
(self) → double¶ float: Exergy destruction of evaporator [W]
-
IExp
(self) → double¶ float: Exergy destruction of expander [W]
-
ITotal
(self) → double¶ float: Total exergy destruction of cycle [W]
-
PIn
(self) → double¶ float: Power input (from compressor) [W].
-
PNet
(self) -> double float: Net power output [W]. PNet = POut() - PIn()¶ float: Net power output [W]. PNet = POut() - PIn()
-
POut
(self) → double¶ float: Power output (from expander) [W].
-
QIn
(self) → double¶ float: Heat input (from evaporator) [W].
-
QOut
(self) → double¶ float: Heat output (from condenser) [W].
-
TCond
¶ float: Evaporation temperature of the working fluid in the compressor [K].
-
TEvap
¶ float: Evaporation temperature of the working fluid in the evaporator [K].
-
comp
¶ comp: mcycle.bases.component.Component
-
cond
¶ cond: mcycle.bases.component.Component
-
config
¶ Config: Cycle configuration parameters. Setter sets config object for all cycle components.
-
copy
(self, dict kwargs={})¶ Return a new copy of a class object. Kwargs (as dict) are passed to update() as a shortcut of simultaneously copying and updating.
Parameters: kwargs : dict, optional
Dictionary of attributes and their updated value.
-
dpComp
¶ float: Pressure increase across the compressor [Pa].
-
dpExp
¶ float: Pressure drop across the expander [Pa].
-
effExergy
(self) → double¶ float: Exergy efficiency
-
effGlobal
(self) → double¶ float: Global recovery efficiency
-
effRecovery
(self) → double¶ float: Exhaust heat recovery efficiency
-
effThermal
(self) → double¶ float: Cycle thermal efficiency [-] effThermal = PNet/QIn
-
evap
¶ evap: mcycle.bases.component.Component
-
exp
¶ exp: mcycle.bases.component.Component
-
mWf
¶ float: Alias of wf.m; mass flow rate of the working fluid [Kg/s].
-
name
¶ name: unicode
-
pCond
¶ pCond: ‘double’
-
pEvap
¶ pEvap: ‘double’
-
pRatioComp
¶ float: Pressure ratio of the compressor.
-
pRatioExp
¶ float: Pressure ratio of the expander.
-
plot
(self, graph=u'Ts', title=u'RankineBasic plot', satCurve=True, newFig=True, show=True, savefig=False, savefig_name=u'plot_RankineBasic', savefig_folder=u'default', savefig_format=u'default', savefig_dpi=u'default', linestyle=u'-', marker=u'.')¶ Plots the key cycle FlowStates on a T-s or p-h diagram.
Parameters: graph : str, optional
Type of graph to plot. Must be ‘Ts’ or ‘ph’. Defaults to ‘Ts’.
title : str, optional
Title to display on graph. Defaults to ‘RankineBasic plot’.
satCurve : bool, optional
Display saturation curve. Defaults to True.
newFig : bool, optional
Create new figure (else plot on existing figure). Defaults to True.
show : str, optional
Show figure in window. Defaults to True.
savefig : bool, optional
Save figure as ‘.png’ or ‘.jpg’ file in desired folder. Defaults to False.
savefig_name : str, optional
Name for saved plot file. Defaults to ‘plot_RankineBasic’.
savefig_folder : str, optional
Folder in the current working directory to save figure into. Folder is created if it does not already exist. Figure is saved as “./savefig_folder/savefig_name.savefig_format”. If None or ‘’, figure is saved directly into the current working directory. If
'default'
,mcycle.DEFAULTS.PLOT_DIR
is used. Defaults to'default'
.savefig_format : str, optional
Format of saved plot file. Must be
'png'
or'jpg'
. If'default'
,mcycle.DEFAULTS.PLOT_FORMAT
is used. Defaults to'default'
.savefig_dpi : int, optional
Dots per inch / pixels per inch of the saved image. Passed as a matplotlib.plot argument. If
'default'
,mcycle.DEFAULTS.PLOT_DPI
is used. Defaults to'default'
.linestyle : str, optional
Style of line used for working fluid plot points. Passed as a matplotlib.plot argument. Defaults to ‘-‘.
marker : str, optional
Marker style used for working fluid plot poitns. Passed as a matplotlib.plot argument. Defaults to ‘.’.
-
pptdCond
¶ float: Pinch-point temperature difference of condenser
-
run
(self, component=u'', flowState=None)¶ Compute all state FlowStates from initial FlowState and given component definitions
Parameters: flowState : FlowState, optional
An initial working fluid FlowState. Defaults to None. If None, will search components (beginning with comp) for a non None flowIn.
component: str, optional
Component for which flowState is set as flowInWf. Defaults to None.
-
set_TCond
(self, double TCond) → void¶
-
set_TEvap
(self, double TEvap) → void¶
-
set_dpComp
(self, double value) → void¶
-
set_dpExp
(self, double value) → void¶
-
set_pRatioComp
(self, double value) → void¶
-
set_pRatioExp
(self, double value) → void¶
-
set_sinkAmbient
(self, FlowState obj) → void¶
-
set_sinkIn
(self, FlowState obj) → void¶
-
set_sinkOut
(self, FlowState obj) → void¶
-
set_sourceAmbient
(self, FlowState obj) → void¶
-
set_sourceIn
(self, FlowState obj) → void¶
-
set_sourceOut
(self, FlowState obj) → void¶
-
set_state1
(self, FlowState obj) → void¶
-
set_state3
(self, FlowState obj) → void¶
-
set_state4
(self, FlowState obj) → void¶
-
set_state6
(self, FlowState obj) → void¶
-
sink4
¶ FlowState: Heat sink when working fluid is at state4. Only valid with a secondary flow as the heat sink.
-
sink50
¶ FlowState: Heat sink when working fluid is at state50. Only valid with a secondary flow as the heat sink.
-
sink51
¶ FlowState: Heat sink when working fluid is at state51. Only valid with a secondary flow as the heat sink.
-
sink6
¶ FlowState: Heat sink when working fluid is at state6. Only valid with a secondary flow as the heat sink.
-
sinkAmbient
¶ FlowState: Alias of cond.ambient. Only valid with a secondary flow as the heat sink.
-
sinkIn
¶ FlowState: Alias of cond.flowInSf. Only valid with a secondary flow as the heat sink.
-
sinkOut
¶ FlowState: Alias of cond.flowOutSf. Only valid with a secondary flow as the heat sink.
-
size
(self) → void¶ Impose the design parameters on the cycle and execute .size() for each component.
-
sizeSetup
(self, bool unitiseEvap, bool unitiseCond) → void¶ Impose the design parameters on the cycle (without executing .size() for each component).
Parameters: unitiseEvap : bool
If True, the evap.unitise() is called if possible.
unitiseCond : bool
If True, cond.unitise() is called if possible.
-
source1
¶ FlowState: Heat source when working fluid is at state1. Only valid with a secondary flow as the heat source.
-
source20
¶ FlowState: Heat source when working fluid is at state20. Only valid with a secondary flow as the heat source.
-
source21
¶ FlowState: Heat source when working fluid is at state21. Only valid with a secondary flow as the heat source.
-
source3
¶ FlowState: Heat source when working fluid is at state3. Only valid with a secondary flow as the heat source.
-
sourceAmbient
¶ FlowState: Alias of evap.ambient. Only valid with a secondary flow as the heat source.
-
sourceIn
¶ FlowState: Alias of evap.flowInSf. Only valid with a secondary flow as the heat source.
-
sourceOut
¶ FlowState: Alias of evap.flowOutSf. Only valid with a secondary flow as the heat source.
-
state1
¶ FlowState: Working fluid flow at compressor outlet/ evaporator inlet.
-
state20
¶ FlowState: Working fluid saturated liquid FlowState in evaporator.
-
state21
¶ FlowState: Working fluid saturated vapour FlowState in evaporator.
-
state3
¶ FlowState: Working fluid FlowState at evaporator outlet/expander inlet.
-
state4
¶ FlowState: Working fluid FlowState at expander outlet/condenser inlet.
-
state50
¶ FlowState: Working fluid saturated liquid FlowState in condenser.
-
state51
¶ FlowState: Working fluid saturated vapour FlowState in condenser.
-
state6
¶ FlowState: Working fluid FlowState at condenser outlet/ compressor inlet.
-
subcool
¶ subcool: ‘double’
-
summary
(self, bool printSummary=True, propertyKeys=u'all', cycleStateKeys=u'none', componentKeys=u'all', dict componentKwargs={u'flowKeys': u'none', u'propertyKeys': u'none'}, unicode name=u'', int rstHeading=0)¶ Returns (and prints) a summary of the component attributes/properties/flows.
Parameters: printSummary : bool, optional
If true, the summary string is printed as well as returned. Defaults to True.
propertyKeys : list, optional
Keys of cycle properties to be included. The following strings are also accepted as inputs:
‘all’: all properties in _properties are included,
‘none’: no properties are included.
Defaults to ‘all’.
cycleStateKeys : list, optional
Names of cycle flow states to be included. The following strings are also accepted as inputs:
‘all’: all flows are included,
‘none’: no flows are included.
Defaults to ‘none’.
componentKeys : list, optional
Names of components to be included. The following strings are also accepted as inputs:
‘all’: all components in _components are included,
‘none’: no components are included.
Defaults to ‘all’.
componentKwargs : dict, optional
Kwargs to parse to component summaries. Defaults to {“flowKeys”:’none’, “propertyKeys”:’none’}.
name : str, optional
Name of instance used in summary heading. If None, the name property of the instance is used. Defaults to None.
rstHeading : int, optional
Level of reStructuredText heading to give the summary, 0 being the top heading. Heading style taken from mcycle.DEFAULTS.RST_HEADINGS. Defaults to 0.
-
superheat
¶ superheat: ‘double’
-
update
(self, dict kwargs) → void¶ Update (multiple) Cycle variables using keyword arguments.
-
wf
¶ wf: mcycle.bases.flowstate.FlowState
-