Config Base Class

class mcycle.bases.config.Config(bool dpEvap=False, bool dpCond=False, bool dpFWf=True, bool dpFSf=True, bool dpAccWf=True, bool dpAccSf=True, bool dpHeadWf=True, bool dpHeadSf=True, bool dpPortWf=True, bool dpPortSf=True, double g=GRAVITY, unicode tolAttr=u'h', double tolAbs=TOLABS, double tolRel=TOLREL, double divT=5., double divX=0.1, bool evenPlatesWf=False, dict methods=METHODS, unicode name=u'Config instance')

Bases: mcycle.bases.mcabstractbase.MCAB

General configuration parameters containing parameters pertaining to Cycles and Components. It is recommended to pass the same Config object to all Components in a Cycle.

Attributes

dpEvap dpEvap: ‘bool’
dpCond dpCond: ‘bool’
dpFWf dpFWf: ‘bool’
dpFSf dpFSf: ‘bool’
dpAccWf dpAccWf: ‘bool’
dpAccSf dpAccSf: ‘bool’
dpHeadWf dpHeadWf: ‘bool’
dpHeadSf dpHeadSf: ‘bool’
dpPortWf dpPortWf: ‘bool’
dpPortSf dpPortSf: ‘bool’
g g: ‘double’
tolAttr tolAttr: unicode
tolAbs tolAbs: ‘double’
tolRel tolRel: ‘double’
divT divT: ‘double’
divX divX: ‘double’
evenPlatesWf evenPlatesWf: ‘bool’
methods methods: dict
sizeBounds_L (list of float len==2, optional) Bracket for solving lengths (particularly of HxUnits). Defaults to [1e-5, 1e2].
maxIterCycle (int, optional) Max number of iterations for convergence of cycle. Defaults to 50.
maxWalls (int, optional) Max number of walls a solution may have. Defaults to 200.

Methods

copy(self, dict kwargs={}) Return a new copy of a class object.
lookupMethod(self, unicode cls, tuple args) str: Return name of method based on the given class and kwargs.
set_method(self, unicode method, list geoms, …) Set a method to multiple geometries, transfer types, flows and phases.
summary(self, bool printSummary=True, …) Returns (and prints) a summary of FlowState properties.
update(self, dict kwargs) Update (multiple) class variables from a dictionary of keyword arguments.
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.

divT

divT: ‘double’

divX

divX: ‘double’

dpAcc

Returns True if dpAccWf and dpAccSf are True, else prints their values. Setter sets both to True or False.

dpAccSf

dpAccSf: ‘bool’

dpAccWf

dpAccWf: ‘bool’

dpCond

dpCond: ‘bool’

dpEvap

dpEvap: ‘bool’

dpF

Returns True if dpFWf and dpFSf are True, else prints their values. Setter sets both to True or False.

dpFSf

dpFSf: ‘bool’

dpFWf

dpFWf: ‘bool’

dpHead

Returns True if dpHeadWf and dpHeadSf are True, else prints their values. Setter sets both to True or False.

dpHeadSf

dpHeadSf: ‘bool’

dpHeadWf

dpHeadWf: ‘bool’

dpPort

Returns True if dpPortWf and dpPortSf are True, else prints their values. Setter sets both to True or False.

dpPortSf

dpPortSf: ‘bool’

dpPortWf

dpPortWf: ‘bool’

evenPlatesWf

evenPlatesWf: ‘bool’

g

g: ‘double’

lookupMethod(self, unicode cls, tuple args) → unicode

str: Return name of method based on the given class and kwargs.

Parameters:

cls : str

Class requiring the method. Can be a subclass of Component.

args : tuple

Additional arguments in tuple.

  • HxPlate or HxUnitPlate: kwargs must be in the form (geom, transfer, phase, flow).
methods

methods: dict

name

name: unicode

set_method(self, unicode method, list geoms, list transfers, list phases, list flows) → void

Set a method to multiple geometries, transfer types, flows and phases.

Parameters:

method : str

String of method/function name.

geoms : list of str

List of strings of geometry names that method should be set for.

transfers : list of str

List of strings of transfer types to be set for. Must be “heat” and or “friction”.

phases : list of str or str

List of strings of phases to be set for. Must be from “sp”, “liq”, “vap”, “tpEvap”, “tpCond”. The following string inputs are also accepted:

  • “all” : Equivalent to [“sp”, “liq”, “vap”, “tpEvap”, “tpCond”]
  • “all-sp” : Equivalent to [“sp”, “liq”, “vap”]
  • “all-tp” : Equivalent to [“tpEvap”, “tpCond”]

flows : list of str

List of strings of flows to be set for. Must be “wf” and or “sf”.

summary(self, bool printSummary=True, unicode name=u'', int rstHeading=0)

Returns (and prints) a summary of FlowState properties.

Parameters:

printSummary : bool, optional

If true, the summary string is printed as well as returned. Defaults to True.

name : str, optional

Name of the object, prepended to the summary heading. If None, the class name is used. Defaults to None.

tolAbs

tolAbs: ‘double’

tolAttr

tolAttr: unicode

tolRel

tolRel: ‘double’

update(self, dict kwargs) → void

Update (multiple) class variables from a dictionary of keyword arguments.

Parameters:

kwargs : dict

Dictionary of attributes and their updated value; kwargs={‘key’: value}.