MCycle Defaults

Attributes

mcycle.defaults.TOLATTR

str : FlowState attribute for checking convergence of component and cycle functions. Defaults to ‘h’.

mcycle.defaults.TOLABS

double : General absolute tolerance used for convergence of component and cycle functions. Defaults to 1e-7.

mcycle.defaults.TOLREL

double : General relative tolerance used for convergence of component and cycle functions. Defaults to 1e-7.

mcycle.defaults.DIV_T

double : Increment of temperature for unitisation processes [K]; lower value = higher accuracy. Defaults to 5 K.

mcycle.defaults.DIV_X

double : Increment of quality for unitisation processes [-]; lower value = higher accuracy. Defaults to 0.1.

mcycle.defaults.MAXITER_CYCLE

int : Maximum iterations for convergence of run and size methods of Cycle objects. Defaults to 50.

mcycle.defaults.MAXITER_COMPONENT

int : Maximum iterations for convergence of run and size methods of Component objects. Defaults to 50.

mcycle.defaults.MAX_WALLS

int : Maximum number of walls for a Component (eg; heat exchangers). Defaults to 200.

mcycle.defaults.TRY_BUILD_PHASE_ENVELOPE

bool : Get CoolProp to try to build the phase envelope for FlowState mixtures during construction. If CoolProp fails to do so the _canBuildPhaseEnvelope attribute is set to False which overrides TRY_BUILD_PHASE_ENVELOPE to prevent wasting computation time on repeated failures. Defaults to True.

mcycle.defaults.GRAVITY

double : Vertical cceleration due to gravity. Defaults to 9.80665 m/s^2.

mcycle.defaults.COOLPROP_EOS

str : CoolProp Equation of State backend. Must be ‘HEOS’ or ‘REFPROP’, depending on whether RefProp backend has been configured (see using RefProp, primary backends). Defaults to ‘HEOS’.

mcycle.defaults.MPL_BACKEND

str : Matplotlib backend (see documentation). Defaults to ‘TkAgg’.

mcycle.defaults.PLOT_DIR

str : Directory to save plots in. Will be created if it doesn’t already exist. Defaults to ‘plots’.

mcycle.defaults.PLOT_DPI

int : DPI of plots (see explanation). Defaults to 600.

mcycle.defaults.PLOT_FORMAT

str : File format for plots. Must be ‘png’ or ‘jpg’. Defaults to ‘png’.

mcycle.defaults.PLOT_COLOR

list of str : List of plot colours for distinguishing plotlines. Can be set to a list of the same colour if not required. See link to tutorial for more info. Defaults to ['C0', 'C1', 'C2', 'C3', 'C4', 'C5', 'C6', 'C7', 'C8', 'C9'].

mcycle.defaults.PLOT_LINESTYLE

list : List of linestyles for distinguishing plotlines. See link to documentation for more info on defining linestyles.

mcycle.defaults.PLOT_MARKER

list of str : List of markers for distinguishing plotlines. Set to [‘’] if you do not require markers. See link to documentation for more info.

mcycle.defaults.UNITS_SEPARATOR_NUMERATOR

str : Separator style for the numerator of units; ie: ‘W.h’ compared to ‘W-h’, or ‘W h’. Defaults to '.'.

mcycle.defaults.UNITS_SEPARATOR_DENOMINATOR

str : Separator style for the denominator of units; ie: ‘J/kg.K’ compared to ‘J/kg-K’, or ‘J/kg/K’.Defaults to ‘.’.

mcycle.defaults.UNITS_FORMAT

str : Style of spacing between value and units. Must be ‘’, ‘parentheses’, ‘brackets’, ‘braces’ or ‘comma’, with or without suffix ‘-nospace’. Eg, ‘comma’ would produce 1.0, m^3/kg, ‘comma-nospace’ would produce 1.0,m^3/kg, ‘braces’ would produce 1.0 {m^3/kg}. Defaults to ‘comma’.

mcycle.defaults.PRINT_FORMAT_FLOAT

str : Format for printing floats, used with Python strings’ format() method (see documentation). Defaults to '{: .4e}'.

mcycle.defaults.RST_HEADINGS

list : Characters used for successive levels of reStructuredText headings. Defaults to [‘=’, ‘-’, ‘^’, ‘”’].

mcycle.defaults.CONFIG

Config : Default Config instance used in classes with a config attribute. When constructing, set config=None to use this default instance. This promotes sharing of a single Config instance throughout a script, as opposed to each individual component/class having its own. Defaults to None which is then set to Config() by check() during importation of MCycle.

mcycle.defaults.METHODS

dict : Dictionary of methods set to Config.methods attribute.

mcycle.defaults.DIMENSIONS

dict : Dictionary of attribute dimensions looked up by summary methods. Each dictionary value is another dictionary containing a default value under the '' key, and class-specific values where necessary. Eg, for attribute 'h', the value is the dictionary:

'h': {
     '': 'power/area-temperature',
     'GeomHxPlateFinStraight': 'length',
     'GeomHxPlateFinOffset': 'length',
     'FlowState': 'energy/mass',
     'FlowStatePoly': 'energy/mass'
 },

So if the class of the object that has called summary is FlowState the dimension returned is 'energy/mass' (enthalpy), if the object is not listed in the above dictionary the dimension returned is 'power/area-temperature' (heat transfer coefficient for heat exchangers).

Methods