-
Notifications
You must be signed in to change notification settings - Fork 6
11_Example_Input_Scripts
11 Example Input Scripts
This section contains a variety of example Ambuild input scripts, each of which involves the growth of a polymer from methane building blocks. There is one example of each of the growBlocks, joinBlocks, and zipBlocks scripts, in which the polymer is built solely from methane fragments, with no solvent, catalyst, or influence from other reagents (Sections 11.1-11.3, Figures 7-9, respectively). Then, to demonstrate the adaptability of the Ambuild code in modelling amorphous, hyper-crosslinked polymer networks, another example is included, in which the methane polymer is firstly assembled using a growBlocks script (Figure 10), whilst solvated with toluene, before being desolvated (Figure 11) and worked-up (Section 11.4, Figure 12), which can be adapted to best mimic the experimental synthesis.
11.1 Example growBlocks Input Script
#!/usr/bin/env python3
#Our imports
from ambuild import ab_cell
#Cell Dimensions
boxDim=[30,30,30]
#Create the Cell
paramsDir='./params'
mycell = ab_cell.Cell(boxDim, atomMargin=0.1, bondMargin=0.5, bondAngleMargin=5, paramsDir=paramsDir )
#Add Fragments to the Library
mycell.libraryAddFragment( filename='./blocks/ch4.car', fragmentType='Me' )
#Specify Bonding Rules
mycell.addBondType( 'Me:a-Me:a' )
#Seed the Cell with the Building Blocks in the Library
mycell.seed( 1, fragmentType='Me' )
for i in range(100):
mycell.growBlocks(4, cellEndGroups='Me:a', libraryEndGroups='Me:a', maxTries=500)
mycell.optimiseGeometry(quiet=True)
mycell.dump()
mycell.runMD(doDihedral=True, rCut=10, mdCycles=1000000, T=55.0)
11.2 Example joinBlocks Input Script
11.3 Example zipBlocks Input Script
11.4 Example Artificial Synthesis Procedure
Firstly, the polymer is assembled from methane fragments using a growBlocks script, whilst solvated with toluene (Figure 10):
Secondly, the toluene solvent fragments are removed slowly over a large number of steps, optimising the geometry and running MD simulations between steps (Figure 11), which simulates the experimental desolvation process:
Finally, the resulting polymer network is worked-up using hydrogen fragments (Figure 12), mimicking the acidic or aqueous workup that the experimental polymer will be subjected to. This ensures that all of the potentially undesired endGroups present are replaced with hydrogen atoms, thus revealing the final, desired, polymer network structure:
11.5 Example Statistical Sampling Script