@@ -707,12 +707,52 @@ cdef class ArrheniusBM(KineticsModel):
707707 """
708708 self ._A.value_si *= factor
709709
710+ def to_cantera_kinetics (self ):
711+ """
712+ Converts the RMG ArrheniusBM object to a cantera BlowersMaselRate.
713+
714+ BlowersMaselRate(A, b, Ea, W) where A is in units of m^3/kmol/s,
715+ b is dimensionless, and Ea and W are in J/kmol
716+ """
717+ import cantera as ct
718+
719+ rate_units_conversion = {' 1/s' : 1 ,
720+ ' s^-1' : 1 ,
721+ ' m^3/(mol*s)' : 1000 ,
722+ ' m^6/(mol^2*s)' : 1000000 ,
723+ ' cm^3/(mol*s)' : 1000 ,
724+ ' cm^6/(mol^2*s)' : 1000000 ,
725+ ' m^3/(molecule*s)' : 1000 ,
726+ ' m^6/(molecule^2*s)' : 1000000 ,
727+ ' cm^3/(molecule*s)' : 1000 ,
728+ ' cm^6/(molecule^2*s)' : 1000000 ,
729+ }
730+
731+ if self ._T0.value_si != 1 :
732+ A = self ._A.value_si / (self ._T0.value_si) ** self ._n.value_si
733+ else :
734+ A = self ._A.value_si
735+
736+ try :
737+ A *= rate_units_conversion[self ._A.units] # convert from /mol to /kmol
738+ except KeyError :
739+ raise ValueError (f' ArrheniusBM A-factor units {self._A.units} not found among accepted '
740+ ' units for converting to Cantera BlowersMaselRate object.' )
741+
742+ b = self ._n.value_si
743+ Ea = self ._E0.value_si * 1000 # convert from J/mol to J/kmol
744+ w = self ._w0.value_si * 1000 # convert from J/mol to J/kmol
745+
746+ return ct.BlowersMaselRate(A, b, Ea, w)
747+
710748 def set_cantera_kinetics (self , ct_reaction , species_list ):
711749 """
712- Sets a cantera Reaction() object with the modified Arrhenius object
713- converted to an Arrhenius form.
750+ Accepts a cantera Reaction object and sets its rate to a Cantera BlowersMaselRate object.
714751 """
715- raise NotImplementedError (' set_cantera_kinetics() is not implemented for ArrheniusBM class kinetics.' )
752+ import cantera as ct
753+ if not isinstance (ct_reaction.rate, ct.BlowersMaselRate):
754+ raise TypeError (" ct_reaction must have a cantera BlowersMaselRate as the rate attribute" )
755+ ct_reaction.rate = self .to_cantera_kinetics()
716756
717757# ###############################################################################
718758
0 commit comments