def __init__(self, xml_phase=None, phase=None, model="", loglevel=0): """Create a transport property manager. :param xml_phase: XML phase element :param phase: :class:`.ThermoPhase` instance representing the phase that the transport properties are for :param model: String specifying transport model. If omitted or set to ``Default``, the model will be read from the input file. :param loglevel: controls the amount of diagnostic output """ # if the transport model is not specified, look for attribute # 'model' of the XML 'transport' element if model == "" or model == "Default" or model == "default": try: self.model = xml_phase.child('transport')['model'] except: self.model = "" else: self.model = model self.__tr_id = 0 self.__tr_id = _cantera.Transport(self.model, phase._phase_id, loglevel) self.trnsp = phase.nSpecies() self._phase_id = phase._phase_id # dictionary holding all installed transport managers self._models = {} self._models[self.model] = self.__tr_id
def addTransportModel(self, model, loglevel=1): """Add a new transport model. Note that if *model* is the name of an already-installed transport model, the new transport manager will take the place of the old one, which will no longer be accessible. This method does not change the active model.""" new_id = _cantera.Transport(model, self._phase_id, loglevel) self._models[model] = new_id