@@ -63,6 +63,10 @@ cdef class ReactorBase:
63
63
def __set__ (self , name ):
64
64
self .rbase.setName(stringify(name))
65
65
66
+ def to_yaml (self ):
67
+ """ Return a YAML representation of the Reactor setup."""
68
+ return pystr(self .rbase.toYAML())
69
+
66
70
def syncState (self ):
67
71
"""
68
72
Set the state of the Reactor to match that of the associated
@@ -414,6 +418,10 @@ cdef class ReactorSurface:
414
418
if A is not None :
415
419
self .area = A
416
420
421
+ def to_yaml (self ):
422
+ """ Return a YAML representation of the ReactorSurface setup."""
423
+ return pystr(self .surface.toYAML())
424
+
417
425
def install (self , Reactor r ):
418
426
r.reactor.addSurface(self .surface)
419
427
@@ -542,6 +550,10 @@ cdef class WallBase:
542
550
def __get__ (self ):
543
551
return pystr(self .wall.type())
544
552
553
+ def to_yaml (self ):
554
+ """ Return a YAML representation of the WallBase setup."""
555
+ return pystr(self .wall.toYAML())
556
+
545
557
property left :
546
558
""" The left surface of this wall. """
547
559
def __get__ (self ):
@@ -695,6 +707,10 @@ cdef class FlowDevice:
695
707
def __get__ (self ):
696
708
return pystr(self .dev.typeStr())
697
709
710
+ def to_yaml (self ):
711
+ """ Return a YAML representation of the FlowDevice setup."""
712
+ return pystr(self .dev.toYAML())
713
+
698
714
def _install (self , ReactorBase upstream , ReactorBase downstream ):
699
715
"""
700
716
Install the device between the *upstream* (source) and *downstream*
@@ -761,11 +777,11 @@ cdef class MassFlowController(FlowDevice):
761
777
762
778
.. math:: \d ot m = \m ax( \d ot m_0* g( t) , 0. ) ,
763
779
764
- where :math:`\d ot m_0` is a constant value and :math:`g( t) ` is a function of
780
+ where :math:`\d ot m_0` is a constant value and :math:`g( t) ` is a function of
765
781
time. Both :math:`\d ot m_0` and :math:`g( t) ` can be set individually by
766
- the property `mass_flow_coeff` and the method `set_time_function`,
767
- respectively. The method `set_mass_flow_rate` combines the former
768
- into a single function. Note that if :math:`\d ot m_0* g( t) < 0`, the mass flow
782
+ the property `mass_flow_coeff` and the method `set_time_function`,
783
+ respectively. The method `set_mass_flow_rate` combines the former
784
+ into a single function. Note that if :math:`\d ot m_0* g( t) < 0`, the mass flow
769
785
rate will be set to zero, since reversal of the flow direction is not allowed.
770
786
771
787
Unlike a real mass flow controller, a MassFlowController object will
@@ -805,7 +821,7 @@ cdef class MassFlowController(FlowDevice):
805
821
Set the mass flow rate [kg/s ] through this controller to be either
806
822
a constant or an arbitrary function of time. See `Func1`.
807
823
808
- Note that depending on the argument type, this method either changes
824
+ Note that depending on the argument type, this method either changes
809
825
the property `mass_flow_coeff` or calls the `set_time_function` method.
810
826
811
827
>>> mfc. set_mass_flow_rate( 0. 3)
@@ -936,7 +952,7 @@ cdef class PressureController(FlowDevice):
936
952
937
953
.. math:: \d ot m = \d ot m_{\r m master} + K_v* f( P_1 - P_2)
938
954
939
- where :math:`f` is the arbitrary function of a single argument.
955
+ where :math:`f` is the arbitrary function of a single argument.
940
956
"""
941
957
flowdevice_type = " PressureController"
942
958
@@ -1007,6 +1023,10 @@ cdef class ReactorNet:
1007
1023
self ._reactors.append(r)
1008
1024
self .net.addReactor(deref(r.reactor))
1009
1025
1026
+ def to_yaml (self ):
1027
+ """ Return a YAML representation of the ReactorNet setup."""
1028
+ return pystr(self .net.toYAML())
1029
+
1010
1030
def advance (self , double t , pybool apply_limit = True ):
1011
1031
"""
1012
1032
Advance the state of the reactor network in time from the current time
0 commit comments