def run(test=False): # Setup the empty cubic box with bx_size = 60 sst = system.System() sst.dim = system.Dimension(dx=bx_size, dy=bx_size, dz=bx_size, center=[bx_size / 2, bx_size / 2, bx_size / 2]) sst.forcefield = 'trappe/amber' molec = system.read_lammps('c2h4.lmps') molec.forcefield = 'trappe/amber' cs = cassandra.Cassandra(sst) npt_props = cs.read_input('props.inp') npt_props['Pressure_Info'] = 25 # Simulated pressure in bars npt_props['Start_Type'] = {'start_type': 'make_config', 'species': 300} npt_props['Run_Type'] = {'type': 'equilibration', 'steps': [1000, 100]} npt_props['Simulation_Length_Info'] = {'run': 10000} npt_props['Property_Info'] = { 'prop1': 'energy_total', 'prop2': 'volume', 'prop3': 'mass_density' } cs.add_simulation('NPT', species=molec, is_rigid=True, out_folder='results', **npt_props) cs.run() lmps.check_lmps_attr(cs.system) cs.system.write_lammps('final_conf.lmps')
def run(test=False): # Setup the box with acetelene molecules on the regular grid sst = system.System() bx_size = 30 sst.dim = system.Dimension(dx=bx_size, dy=bx_size, dz=bx_size, center=[bx_size / 2, bx_size / 2, bx_size / 2]) sst.forcefield = 'trappe/amber' molec = system.read_lammps('c2h4.lmps') molec.forcefield = 'trappe/amber' cs = cassandra.Cassandra(sst) nvt_props = cs.read_input('props.inp') nvt_props['Temperature_Info'] = 400 nvt_props['Start_Type'] = {'start_type': 'make_config', 'species': 300} nvt_props['Simulation_Length_Info'] = {'run': 300000} nvt_props['Property_Info'] = { 'prop1': 'energy_total', 'prop2': 'pressure', 'prop3': 'mass_density' } cs.add_nvt(species=molec, is_rigid=True, out_folder='results', **nvt_props) cs.run() lmps.check_lmps_attr(cs.system) cs.system.write_lammps('final_conf.lmps')
def run(test=False): # In order to run CASSANDRA GCMC one need to create the CASSANDRA object sst = system.System() sst.dim = system.Dimension(dx=40, dy=40, dz=45, center=[0, 0, 0]) sst.forcefield = 'trappe/amber' lmps.check_lmps_attr(sst) css = cassandra.Cassandra(sst) # Read the CASSANDRA .inp parameters file -- common way to setup simulations. # Any of the read properties can be modified here afterwards my_gcmc_props = css.read_input('props.inp') # The prefix for the all files that will be created by this run my_gcmc_props['Run_Name'] = 'gas_adsorb' # Set the gas (gas system) to be purged in a box specie1 = system.read_lammps('co2.lmps') specie2 = system.read_lammps('ch4.lmps') specie3 = system.read_lammps('m-xylene.lmps') for s in [specie1, specie2, specie3]: s.forcefield = 'trappe/amber' css.add_gcmc(species=[specie1, specie2, specie3], is_rigid=[True, False, True], max_ins=[2000, 1000, 500], chem_pot=[-27.34, -29.34, -24.59], out_folder='gas_adsorb_results', **my_gcmc_props) css.run() for pt in css.system.particle_types: pt.elem = pt.real_elem css.system.write_lammps('gas_adsorb.lmps') css.system.write_xyz('gas_adsorb.xyz')