% (inp.lineno(), tokens[1]), ValueError) def check_config(self): """ Check sanity of current configuration. """ super(BCInt1, self).check_config() if self.intdir1 not in ('I', 'J', 'K'): self.raise_exception('intdir1 (%s) must be I, J, or K.' \ % self.intdir1, ValueError) if self.intdir2 not in ('I', 'J', 'K'): self.raise_exception('intdir2 (%s) must be I, J, or K.' \ % self.intdir2, ValueError) def write(self, out, count, input_ref): """ Write BC `count` to stream `out`. `input_ref` provides an :class:`Input` object for reference conditions. """ out.write('\n') super(BCInt1, self).write(out, count, input_ref) out.write(' INTDIR1 INTDIR2\n') out.write(' %s %s\n' % (self.intdir1, self.intdir2)) out.write(' ISHFTDR DSHIFT\n') out.write(' %d %r\n' % (self.ishftdr, self.dshift)) register('BCINT1', BCInt1)
""" super(BCIntM, self).write(out, count, input_ref) out.write(' NBLINT2\n') out.write(' %d\n' % len(self._send)) out.write(' NBLDAT LFACE2 LDIR2 L2LIM M2LIM1 M2LIM2 N2LIM1 N2LIM2\n') for blkdef in self._send: blkdef.write(out) out.write(' NBLINT1\n') out.write(' %d\n' % len(self._recv)) out.write(' LBLK1RR LFACE1 LDIR1 L1LIM M1LIM1 M1LIM2 N1LIM1 N1LIM2\n') for blkdef in self._recv: blkdef.write(out) register('BCINTM', BCIntM) class BCIntM_send(Container): """ :class:`BCIntM` sending block definition. """ nbldat = Int(low=1, desc='Sending block.') lface2 = Str(desc='Grid plane (I, J, or K).') ldir2 = Str(desc='Direction into flowfield (P or M).') l2lim = Int(low=1, desc='Grid index of surface.') m2lim1 = Int(low=1, desc='Initial 1st coord index.') m2lim2 = Int(low=1, desc='Initial 2nd coord index.') n2lim1 = Int(low=1, desc='Final 1st coord index.') n2lim2 = Int(low=1, desc='Final 2nd coord index.') def read(self, inp):
ValueError) def write(self, out, count, input_ref): """ Write BC `count` to stream `out`. `input_ref` provides an :class:`Input` object for reference conditions. """ super(BCPRM, self).write(out, count, input_ref) out.write(' NRRDAT\n') out.write(' %d\n' % len(self._recv)) out.write(' LBLOCK1B LFACE1B LDIR1B L1LIMB M1LIM1B M1LIM2B N1LIM1B N1LIM2B\n') for blkdef in self._recv: blkdef.write(out) register('BCPRM', BCPRM) class BCPRM_recv(Container): """ :class:`BCPRM` receiving block definition. """ lblock1b = Int(low=1, desc='Receiving block.') lface1b = Str(desc='Grid plane (I, J, or K).') ldir1b = Str(desc='Direction into flowfield (P or M).') l1limb = Int(low=1, desc='Grid index of surface.') m1lim1b = Int(low=1, desc='Initial 1st coord index.') m1lim2b = Int(low=1, desc='Initial 2nd coord index.') n1lim1b = Int(low=1, desc='Final 1st coord index.') n1lim2b = Int(low=1, desc='Final 2nd coord index.') def read(self, inp):
tokens = 7 out.write(' PTOT TTOT') if tokens > 2: out.write(' AKIN') if tokens > 3: out.write(' ARIN') if tokens > 4: out.write(' THETA') out.write(' PHI') out.write(' EMDOT') if tokens > 6: out.write(' PRELAX') out.write('\n') out.write(' %r %r' \ % (self.ptot / input_ref.pref, self.ttot / input_ref.tref)) if tokens > 2: out.write(' %r' % self.akin) if tokens > 3: out.write(' %r' % self.arin) if tokens > 4: out.write(' %r %r %r' % (self.theta, self.phi, self.emdot)) if tokens > 6: out.write(' %r' % self.prelax) out.write('\n') register('INLETG', InletG) register('INL2DG', InletG)
out.write('\n') super(BCPRR, self).write(out, count, input_ref) out.write(' THPER\n') out.write(' %r\n' % self.thper) out.write(' NBCPRR\n') out.write(' %d\n' % len(self._send)) out.write( ' LBLOCK2B LFACE2B LDIR2B L2LIMB M2LIM1B M2LIM2B N2LIM1B N2LIM2B\n' ) for blkdef in self._send: blkdef.write(out) register('BCPRR', BCPRR) class BCPRR_send(Container): """ :class:`BCPRR` sending block definition. """ lblock2b = Int(low=1, desc='Sending block.') lface2b = Str(desc='Grid plane (I, J, or K).') ldir2b = Str(desc='Direction into flowfield (P or M).') l2limb = Int(low=1, desc='Grid index of surface.') m2lim1b = Int(low=1, desc='Initial 1st coord index.') m2lim2b = Int(low=1, desc='Initial 2nd coord index.') n2lim1b = Int(low=1, desc='Final 1st coord index.') n2lim2b = Int(low=1, desc='Final 2nd coord index.') def read(self, inp):
out.write(' PTOT TTOT') if tokens > 2: out.write(' AKIN') if tokens > 3: out.write(' ARIN') if tokens > 4: out.write(' THETA') out.write(' PHI') out.write(' EMDOT') if tokens > 6: out.write(' PRELAX') out.write('\n') out.write(' %r %r' \ % (self.ptot / input_ref.pref, self.ttot / input_ref.tref)) if tokens > 2: out.write(' %r' % self.akin) if tokens > 3: out.write(' %r' % self.arin) if tokens > 4: out.write(' %r %r %r' % (self.theta, self.phi, self.emdot)) if tokens > 6: out.write(' %r' % self.prelax) out.write('\n') register('INLETG', InletG) register('INL2DG', InletG)
Write BC `count` to stream `out`. `input_ref` provides an :class:`Input` object for reference conditions. """ out.write('\n') super(BCPRR, self).write(out, count, input_ref) out.write(' THPER\n') out.write(' %r\n' % self.thper) out.write(' NBCPRR\n') out.write(' %d\n' % len(self._send)) out.write(' LBLOCK2B LFACE2B LDIR2B L2LIMB M2LIM1B M2LIM2B N2LIM1B N2LIM2B\n') for blkdef in self._send: blkdef.write(out) register('BCPRR', BCPRR) class BCPRR_send(Container): """ :class:`BCPRR` sending block definition. """ lblock2b = Int(low=1, desc='Sending block.') lface2b = Str(desc='Grid plane (I, J, or K).') ldir2b = Str(desc='Direction into flowfield (P or M).') l2limb = Int(low=1, desc='Grid index of surface.') m2lim1b = Int(low=1, desc='Initial 1st coord index.') m2lim2b = Int(low=1, desc='Initial 2nd coord index.') n2lim1b = Int(low=1, desc='Final 1st coord index.') n2lim2b = Int(low=1, desc='Final 2nd coord index.') def read(self, inp):
try: self.rpmwall = float(tokens[1]) except ValueError: self.raise_exception('line %d: rpmwall (%s) must be a number.' \ % (inp.lineno(), tokens[0]), ValueError) try: self.twall = float(tokens[2]) * input_ref.tref except ValueError: self.raise_exception('line %d: twall (%s) must be a number.' \ % (inp.lineno(), tokens[0]), ValueError) def write(self, out, count, input_ref): """ Write BC `count` to stream `out`. `input_ref` provides an :class:`Input` object for reference conditions. """ if input_ref is None: self._logger.warning('Using default reference values.') input_ref = INPUT out.write('\n') super(EndTTA, self).write(out, count, input_ref) out.write(' NTREAT RPMWALL TWALL\n') out.write(' %d %r %r\n' \ % (self.ntreat, self.rpmwall, self.twall / input_ref.tref)) register('ENDTTA', EndTTA)
except ValueError: self.raise_exception('line %d: %s (%s) must be an integer.' \ % (inp.lineno(), attr, tokens[i]), ValueError) setattr(self, attr, value) def check_config(self): """ Check sanity of current configuration. """ #TODO: check indices against mesh dimensions, etc. super(Kill, self).check_config() if self.lend <= self.lstart: self.raise_exception('lend (%d) must be > lstart (%d).' \ % (self.lend, self.lstart), ValueError) def write(self, out, count, input_ref): """ Write BC `count` to stream `out`. `input_ref` provides an :class:`Input` object for reference conditions. """ out.write('\n') super(Kill, self).write(out, count, input_ref) out.write(' LSTART LEND\n') out.write(' %d %d\n' % (self.lstart, self.lend)) register('KILL', Kill) register('KIL2D', Kill)
Write BC `count` to stream `out`. `input_ref` provides an :class:`Input` object for reference conditions. """ if input_ref is None: self._logger.warning('Using default reference values.') input_ref = INPUT out.write('\n') super(InletA, self).write(out, count, input_ref) out.write(' PTOT TTOT ALPHA') if self.akin > 0: out.write(' AKIN') if self.arin > 0: out.write(' ARIN') out.write('\n') out.write(' %r %r %r' \ % (self.ptot / input_ref.pref, self.ttot / input_ref.tref, self.alpha)) if self.akin > 0: out.write(' %r' % self.akin) if self.arin > 0: out.write(' %r' % self.arin) out.write('\n') register('INLETA', InletA) register('INL2DA', InletA)
out.write(' %s' % self.ldir1) out.write(' %s' % self.ldir2) out.write(' %s' % self.lspec1) out.write(' %s' % self.lspec2) out.write('%4d' % self.l1lim) out.write('%4d' % self.l2lim) out.write('%4d' % self.m1lim1) out.write('%4d' % self.m1lim2) out.write('%4d' % self.n1lim1) out.write('%4d' % self.n1lim2) out.write('%4d' % self.m2lim1) out.write('%4d' % self.m2lim2) out.write('%4d' % self.n2lim1) out.write('%4d' % self.n2lim2) out.write(' # BC %d\n' % count) register('EXITP', BC) register('EXT2DP', BC) register('EXITN', BC) register('INLETN', BC) register('NPSS', BC) register('PATCH', BC) register('PINT', BC) register('PROBE', BC) register('SSIN', BC) register('SS2DIN', BC) register('TRAF', BC)
inp.readline() tokens = inp.readline().split() if len(tokens) != 5: self.raise_exception('line %d: expecting 5 fields, got %d.' \ % (inp.lineno(), len(tokens)), ValueError) for i, attr in enumerate(('ro', 'u', 'v', 'w', 'ttot')): try: value = float(tokens[i]) except ValueError: self.raise_exception('line %d: %s (%s) must be a number.' \ % (inp.lineno(), attr, tokens[i]), ValueError) setattr(self, attr, value) def write(self, out, count, input_ref): """ Write BC `count` to stream `out`. `input_ref` provides an :class:`Input` object for reference conditions. """ out.write('\n') super(Fixed, self).write(out, count, input_ref) out.write(' RO U V W TTOT\n') out.write(' %r %r %r %r %r\n' \ % (self.ro, self.u, self.v, self.w, self.ttot)) register('FIXED', Fixed)
inp.readline() tokens = inp.readline().split() if len(tokens) != 1: self.raise_exception('line %d: expecting 1 field, got %d.' \ % (inp.lineno(), len(tokens)), ValueError) self.filename = tokens[0] def check_config(self): """ Check sanity of current configuration. """ super(BDatIn, self).check_config() if not self.filename: self.raise_exception('filename must be specified.', ValueError) def write(self, out, count, input_ref): """ Write BC `count` to stream `out`. `input_ref` provides an :class:`Input` object for reference conditions. """ out.write('\n') super(BDatIn, self).write(out, count, input_ref) out.write(' FILENAME\n') out.write(' %s\n' % self.filename) register('BDATIN', BDatIn) register('BDATOU', BDatIn)
else: self.emdot = 0. self.prelax = 0. def write(self, out, count, input_ref): """ Write BC `count` to stream `out`. `input_ref` provides an :class:`Input` object for reference conditions. """ if input_ref is None: self._logger.warning('Using default reference values.') input_ref = INPUT out.write('\n') super(ExitG, self).write(out, count, input_ref) if self.emdot: out.write(' PEXIT EMDOT PRELAX\n') out.write(' %r %r %r\n' \ % (self.pexit / input_ref.pref, self.emdot, self.prelax)) else: out.write(' PEXIT\n') out.write(' %r\n' % (self.pexit / input_ref.pref)) register('EXITG', ExitG) register('EXT2DG', ExitG) register('EXITT', ExitG) register('EXT2DT', ExitG) register('EXITX', ExitG)
self.emdot = 0. self.prelax = 0. def write(self, out, count, input_ref): """ Write BC `count` to stream `out`. `input_ref` provides an :class:`Input` object for reference conditions. """ if input_ref is None: self._logger.warning('Using default reference values.') input_ref = INPUT out.write('\n') super(ExitG, self).write(out, count, input_ref) if self.emdot: out.write(' PEXIT EMDOT PRELAX\n') out.write(' %r %r %r\n' \ % (self.pexit / input_ref.pref, self.emdot, self.prelax)) else: out.write(' PEXIT\n') out.write(' %r\n' % (self.pexit / input_ref.pref)) register('EXITG', ExitG) register('EXT2DG', ExitG) register('EXITT', ExitG) register('EXT2DT', ExitG) register('EXITX', ExitG)
def write(self, out, count, input_ref): """ Write BC `count` to stream `out`. `input_ref` provides an :class:`Input` object for reference conditions. """ out.write('\n') super(MBCAvg, self).write(out, count, input_ref) out.write(' NSEGS\n') out.write(' %d\n' % len(self._segs)) out.write(' LBLOCK2B LFACE2B LDIR2B L2LIMB M2LIM1B M2LIM2B N2LIM1B N2LIM2B\n') for seg in self._segs: seg.write(out) register('MBCAVG', MBCAvg) class MBCAvg_seg(Container): """ :class:`MBCAvg` segment data. """ lblock2b = Int(low=1, desc='Sending block.') lface2b = Str(desc='Grid plane (I, J, or K).') ldir2b = Str(desc='Direction into flowfield (P or M).') l2limb = Int(low=1, desc='Grid index of surface.') m2lim1b = Int(low=1, desc='Initial 1st coord index.') m2lim2b = Int(low=1, desc='Initial 2nd coord index.') n2lim1b = Int(low=1, desc='Final 1st coord index.') n2lim2b = Int(low=1, desc='Final 2nd coord index.') def read(self, inp):
""" if input_ref is None: self._logger.warning('Using default reference values.') input_ref = INPUT out.write('\n') super(InletR, self).write(out, count, input_ref) out.write(' NDATA\n') out.write(' %d\n' % len(self._data)) out.write(' AXIAL PTOT TTOT BETAX BETAT\n') for data in self._data: data.write(out, input_ref) register('INLETR', InletR) register('INL2DR', InletR) class InletR_data(Container): """ Inflow data for :class:`InletR`. """ axial = Float(units='ft', iotype='in', desc='Axial coordinate.') ptot = Float(units='lbf/ft**2', low=0., exclude_low=True, iotype='in', desc='Total pressure.') ttot = Float(units='degR', low=0., exclude_low=True,
inp.readline() tokens = inp.readline().split() if len(tokens) != 2: self.raise_exception('line %d: expecting 2 fields, got %d.' \ % (inp.lineno(), len(tokens)), ValueError) for i, attr in enumerate(('rpmwall', 'twall')): try: value = float(tokens[i]) except ValueError: self.raise_exception('line %d: %s (%s) must be a number.' \ % (inp.lineno(), attr, tokens[i]), ValueError) setattr(self, attr, value) def write(self, out, count, input_ref): """ Write BC `count` to stream `out`. `input_ref` provides an :class:`Input` object for reference conditions. """ out.write('\n') super(SSVI, self).write(out, count, input_ref) out.write(' RPMWALL TWALL\n') out.write(' %r %r\n' % (self.rpmwall, self.twall)) register('SSVI', SSVI) register('SS2DVI', SSVI)
self.interval = int(tokens[0]) except ValueError: self.raise_exception('line %d: interval (%s) must be an integer.' \ % (inp.lineno(), tokens[0]), ValueError) inp.readline() self.command = inp.readline().strip() def check_config(self): """ Check sanity of current configuration. """ super(System, self).check_config() if not self.command: self.raise_exception('command must be specified.', ValueError) def write(self, out, count, input_ref): """ Write BC `count` to stream `out`. `input_ref` provides an :class:`Input` object for reference conditions. """ out.write('\n') super(System, self).write(out, count, input_ref) out.write(' INTERVAL\n') out.write(' %d\n' % self.interval) out.write(' COMMAND\n') out.write('%s\n' % self.command) register('SYSTEM', System)
% (inp.lineno(), tokens[0]), ValueError) try: self.rpmwall = float(tokens[1]) except ValueError: self.raise_exception('line %d: rpmwall (%s) must be a number.' \ % (inp.lineno(), tokens[0]), ValueError) try: self.twall = float(tokens[2]) * input_ref.tref except ValueError: self.raise_exception('line %d: twall (%s) must be a number.' \ % (inp.lineno(), tokens[0]), ValueError) def write(self, out, count, input_ref): """ Write BC `count` to stream `out`. `input_ref` provides an :class:`Input` object for reference conditions. """ if input_ref is None: self._logger.warning('Using default reference values.') input_ref = INPUT out.write('\n') super(EndTTA, self).write(out, count, input_ref) out.write(' NTREAT RPMWALL TWALL\n') out.write(' %d %r %r\n' \ % (self.ntreat, self.rpmwall, self.twall / input_ref.tref)) register('ENDTTA', EndTTA)
for i, attr in enumerate(('emdot', 'ttot')): try: value = float(tokens[i]) except ValueError: self.raise_exception('line %d: %s (%s) must be a number.' \ % (inp.lineno(), attr, tokens[i]), ValueError) setattr(self, attr, value) self.ttot *= input_ref.tref def write(self, out, count, input_ref): """ Write BC `count` to stream `out`. `input_ref` provides an :class:`Input` object for reference conditions. """ if input_ref is None: self._logger.warning('Using default reference values.') input_ref = INPUT out.write('\n') super(InletM, self).write(out, count, input_ref) out.write(' EMDOT TTOT\n') out.write(' %r %r\n' % (self.emdot, self.ttot / input_ref.tref)) register('INLETM', InletM) register('INL2DM', InletM)
def check_config(self): """ Check sanity of current configuration. """ super(BCInt1, self).check_config() if self.intdir1 not in ('I', 'J', 'K'): self.raise_exception('intdir1 (%s) must be I, J, or K.' \ % self.intdir1, ValueError) if self.intdir2 not in ('I', 'J', 'K'): self.raise_exception('intdir2 (%s) must be I, J, or K.' \ % self.intdir2, ValueError) def write(self, out, count, input_ref): """ Write BC `count` to stream `out`. `input_ref` provides an :class:`Input` object for reference conditions. """ out.write('\n') super(BCInt1, self).write(out, count, input_ref) out.write(' INTDIR1 INTDIR2\n') out.write(' %s %s\n' % (self.intdir1, self.intdir2)) out.write(' ISHFTDR DSHIFT\n') out.write(' %d %r\n' % (self.ishftdr, self.dshift)) register('BCINT1', BCInt1)
`input_ref` provides an :class:`Input` object for reference conditions. """ if input_ref is None: self._logger.warning('Using default reference values.') input_ref = INPUT out.write('\n') super(InletT, self).write(out, count, input_ref) out.write(' NDATA\n') out.write(' %d\n' % len(self._data)) out.write(' RAD PTOT TTOT BETAX BETAT (CHI)\n') for data in self._data: data.write(out, input_ref) register('INLETT', InletT) register('INL2DT', InletT) register('INLETX', InletT) class InletT_data(Container): """ Inflow data for :class:`InletT`. """ rad = Float(units='ft', low=0., iotype='in', desc='Radial coordinate.') ptot = Float(units='lbf/ft**2', low=0., exclude_low=True, iotype='in', desc='Total pressure.') ttot = Float(units='degR', low=0., exclude_low=True, iotype='in', desc='Total temperature.') betax = Float(units='deg', iotype='in', desc='Axial flow angle.') betat = Float(units='deg', iotype='in', desc='Circumferential flow angle.') chi = Float(low=0., iotype='in',
inp.readline() tokens = inp.readline().split() if len(tokens) != 1: self.raise_exception('line %d: expecting 1 field, got %d.' \ % (inp.lineno(), len(tokens)), ValueError) for i, attr in enumerate(('global_id',)): try: value = int(tokens[i]) except ValueError: self.raise_exception('line %d: %s (%s) must be an integer.' \ % (inp.lineno(), attr, tokens[i]), ValueError) setattr(self, attr, value) def write(self, out, count, input_ref): """ Write BC `count` to stream `out`. `input_ref` provides an :class:`Input` object for reference conditions. """ out.write('\n') super(VCE, self).write(out, count, input_ref) out.write(' GLOBAL ID\n') out.write(' %d\n' % self.global_id) register('VCE', VCE)
out.write(" %s" % self.ldir1) out.write(" %s" % self.ldir2) out.write(" %s" % self.lspec1) out.write(" %s" % self.lspec2) out.write("%4d" % self.l1lim) out.write("%4d" % self.l2lim) out.write("%4d" % self.m1lim1) out.write("%4d" % self.m1lim2) out.write("%4d" % self.n1lim1) out.write("%4d" % self.n1lim2) out.write("%4d" % self.m2lim1) out.write("%4d" % self.m2lim2) out.write("%4d" % self.n2lim1) out.write("%4d" % self.n2lim2) out.write(" # BC %d\n" % count) register("EXITP", BC) register("EXT2DP", BC) register("EXITN", BC) register("INLETN", BC) register("NPSS", BC) register("PATCH", BC) register("PINT", BC) register("PROBE", BC) register("SSIN", BC) register("SS2DIN", BC) register("TRAF", BC)
Write BC `count` to stream `out`. `input_ref` provides an :class:`Input` object for reference conditions. """ out.write('\n') super(MBCAvg, self).write(out, count, input_ref) out.write(' NSEGS\n') out.write(' %d\n' % len(self._segs)) out.write( ' LBLOCK2B LFACE2B LDIR2B L2LIMB M2LIM1B M2LIM2B N2LIM1B N2LIM2B\n' ) for seg in self._segs: seg.write(out) register('MBCAVG', MBCAvg) class MBCAvg_seg(Container): """ :class:`MBCAvg` segment data. """ lblock2b = Int(low=1, desc='Sending block.') lface2b = Str(desc='Grid plane (I, J, or K).') ldir2b = Str(desc='Direction into flowfield (P or M).') l2limb = Int(low=1, desc='Grid index of surface.') m2lim1b = Int(low=1, desc='Initial 1st coord index.') m2lim2b = Int(low=1, desc='Initial 2nd coord index.') n2lim1b = Int(low=1, desc='Final 1st coord index.') n2lim2b = Int(low=1, desc='Final 2nd coord index.') def read(self, inp):
super(BCIntM, self).write(out, count, input_ref) out.write(' NBLINT2\n') out.write(' %d\n' % len(self._send)) out.write(' NBLDAT LFACE2 LDIR2 L2LIM M2LIM1 M2LIM2 N2LIM1 N2LIM2\n') for blkdef in self._send: blkdef.write(out) out.write(' NBLINT1\n') out.write(' %d\n' % len(self._recv)) out.write(' LBLK1RR LFACE1 LDIR1 L1LIM M1LIM1 M1LIM2 N1LIM1 N1LIM2\n') for blkdef in self._recv: blkdef.write(out) register('BCINTM', BCIntM) class BCIntM_send(Container): """ :class:`BCIntM` sending block definition. """ nbldat = Int(low=1, desc='Sending block.') lface2 = Str(desc='Grid plane (I, J, or K).') ldir2 = Str(desc='Direction into flowfield (P or M).') l2lim = Int(low=1, desc='Grid index of surface.') m2lim1 = Int(low=1, desc='Initial 1st coord index.') m2lim2 = Int(low=1, desc='Initial 2nd coord index.') n2lim1 = Int(low=1, desc='Final 1st coord index.') n2lim2 = Int(low=1, desc='Final 2nd coord index.') def read(self, inp):
out.write('\n') super(Free, self).write(out, count, input_ref) tokens = 4 if self.akin > 0: tokens = 5 if self.arin > 0: tokens = 6 out.write(' PTOT TTOT EMINF ALPHA') if tokens > 4: out.write(' AKIN') if tokens > 5: out.write(' ARIN') out.write('\n') out.write(' %r %r %r %r' \ % (self.ptot / input_ref.pref, self.ttot / input_ref.tref, self.eminf, self.alpha)) if tokens > 4: out.write(' %r' % self.akin) if tokens > 5: out.write(' %r' % self.arin) out.write('\n') register('FREE', Free) register('FRE2D', Free)
value = float(tokens[i]) except ValueError: self.raise_exception('line %d: %s (%s) must be a number.' \ % (inp.lineno(), attr, tokens[i]), ValueError) setattr(self, attr, value) self.ptot *= input_ref.pref self.ttot *= input_ref.tref def write(self, out, count, input_ref): """ Write BC `count` to stream `out`. `input_ref` provides an :class:`Input` object for reference conditions. """ if input_ref is None: self._logger.warning('Using default reference values.') input_ref = INPUT out.write('\n') super(LamSS, self).write(out, count, input_ref) out.write(' PTOT TTOT RPMWALL TWALL ARATIO\n') out.write(' %r %r %r %r %r\n' \ % (self.ptot / input_ref.pref, self.ttot / input_ref.tref, self.rpmwall, self.twall, self.aratio)) register('LAMSS', LamSS) register('LAM2DS', LamSS)
""" if input_ref is None: self._logger.warning('Using default reference values.') input_ref = INPUT out.write('\n') super(InletT, self).write(out, count, input_ref) out.write(' NDATA\n') out.write(' %d\n' % len(self._data)) out.write(' RAD PTOT TTOT BETAX BETAT (CHI)\n') for data in self._data: data.write(out, input_ref) register('INLETT', InletT) register('INL2DT', InletT) register('INLETX', InletT) class InletT_data(Container): """ Inflow data for :class:`InletT`. """ rad = Float(units='ft', low=0., iotype='in', desc='Radial coordinate.') ptot = Float(units='lbf/ft**2', low=0., exclude_low=True, iotype='in', desc='Total pressure.') ttot = Float(units='degR', low=0.,