@@ -614,6 +614,25 @@ def initialize(self, **kwargs):
614
614
615
615
# Initialize reaction model
616
616
617
+ # Also always add in a few bath gases (since RMG-Java does)
618
+ for label , smiles in [('Ar' , '[Ar]' ), ('He' , '[He]' ), ('Ne' , '[Ne]' ), ('N2' , 'N#N' )]:
619
+ molecule = Molecule ().from_smiles (smiles )
620
+ spec , is_new = self .reaction_model .make_new_species (molecule , label = label , reactive = False )
621
+ if is_new :
622
+ self .initial_species .append (spec )
623
+
624
+ for spec in self .initial_species :
625
+ submit (spec , self .solvent )
626
+
627
+ # Add nonreactive species (e.g. bath gases) to core first
628
+ # This is necessary so that the PDep algorithm can identify the bath gas
629
+ for spec in self .initial_species :
630
+ if not spec .reactive :
631
+ self .reaction_model .enlarge (spec )
632
+ for spec in self .initial_species :
633
+ if spec .reactive :
634
+ self .reaction_model .enlarge (spec )
635
+
617
636
# Seed mechanisms: add species and reactions from seed mechanism
618
637
# DON'T generate any more reactions for the seed species at this time
619
638
for seed_mechanism in self .seed_mechanisms :
@@ -624,13 +643,6 @@ def initialize(self, **kwargs):
624
643
for library , option in self .reaction_libraries :
625
644
self .reaction_model .add_reaction_library_to_edge (library )
626
645
627
- # Also always add in a few bath gases (since RMG-Java does)
628
- for label , smiles in [("Ar" , "[Ar]" ), ("He" , "[He]" ), ("Ne" , "[Ne]" ), ("N2" , "N#N" )]:
629
- molecule = Molecule ().from_smiles (smiles )
630
- spec , is_new = self .reaction_model .make_new_species (molecule , label = label , reactive = False )
631
- if is_new :
632
- self .initial_species .append (spec )
633
-
634
646
# Perform species constraints and forbidden species checks on input species
635
647
for spec in self .initial_species :
636
648
if self .database .forbidden_structures .is_molecule_forbidden (spec .molecule [0 ]):
@@ -690,15 +702,6 @@ def initialize(self, **kwargs):
690
702
spec .get_liquid_volumetric_mass_transfer_coefficient_data ()
691
703
spec .get_henry_law_constant_data ()
692
704
693
- # Add nonreactive species (e.g. bath gases) to core first
694
- # This is necessary so that the PDep algorithm can identify the bath gas
695
- for spec in self .initial_species :
696
- if not spec .reactive :
697
- self .reaction_model .enlarge (spec )
698
- for spec in self .initial_species :
699
- if spec .reactive :
700
- self .reaction_model .enlarge (spec )
701
-
702
705
# chatelak: store constant SPC indices in the reactor attributes if any constant SPC provided in the input file
703
706
# advantages to write it here: this is run only once (as species indexes does not change over the generation)
704
707
if self .solvent is not None :
0 commit comments