"Addforce" Fx to a group of rigid CO2, but fluid velocity vx doesn't increase

Hello everyone,

I am trying to study flow behavior of CO2 by applying body force to CO2 molecules.

I add some CO2 molecules in a ppp-boundary system. I use rigid/nvt/small to CO2. Only vy and vx comtribute to Temperature calculation, because Fx is applied to C and O atoms.

I don’t know why vx of CO2 dosen’t increase in my simualtions. I tried with united atom model of CH4 by using same strategy. Vx of CH4 increase and vx is linear with time steps, but CO2 doesn’t work.

Do I make any mistake?

compute mdtemp_co2_flow co2 temp/partial 0 1 1
fix myrigid_flow co2 rigid/nvt/small molecule mol co2mol temp 333 333 100
fix_modify myrigid_flow temp mdtemp_co2_flow
variable F index 1e-2
variable F_c equal ${F} * 12.0107
variable F_o equal ${F} * 15.9994
fix force_C_CO2 co2_c addforce ${F_c} 0 0
fix force_O_CO2 co2_o addforce ${F_o} 0 0

Some random thoughts:

  • Why not fix gravity?
  • Try adding force to just one molecule and see if it moves with respect to the others?
  • From a theory point of view I don’t quite get what you’re doing. An infinite periodic box of stuff shouldn’t show physically different behaviour just because it has some center-of-mass motion. You will only see e.g. structural changes if things in the box have collective motion relative to each other.

I don’t think that this command will work as expected for rigid fixes. They don’t look at per-atom velocities, but store the center of mass velocity and rotational velocity internally and reconstruct the rigid body atom velocities from it. In the source code there are no calls to remove_bias() and restore_bias().

Thank you for answering.

Do you have any recommendation about this problem - apply force to a group of rigid CO2 molecules to let them move(flow)?
(This simple ppp-boundary system is only used for making sure that I use correct simulaiton method and strategy. Later, I will study flow behavior of pure fluid and mixture in nanopores.)

I also tried with using rigid/nve/small and adding force to rigid CO2 molecules. This method still didn’t work. I think there might be something I don’t get for adding force to rigid molecules.

I don’t see a problem in inducing a flow with fix addforce on rigid objects.
Please check out the attached minimal input example.
data.spce (414.2 KB)
in.rigid-addforce (778 Bytes)

The corresponding thermo output from the log file is:

   Step          Temp          c_1[1]         c_1[2]         c_1[3]        v_xforce   
         0   294.2651       17.625534      17.459419      17.91262       0            
        50   293.43761      17.625534      17.459419      17.91262       0            
       100   294.3864       17.625534      17.459419      17.91262       0            
       150   296.09571      17.625534      17.459419      17.91262       0            
       200   295.395        17.625534      17.459419      17.91262       0            
       250   300.57486      17.625534      17.459419      17.91262       0            
       300   291.36222      17.625568      17.459419      17.91262       0.01         
       350   298.95108      17.625672      17.459419      17.91262       0.01         
       400   294.91241      17.625845      17.459419      17.91262       0.01         
       450   296.99081      17.626089      17.459419      17.91262       0.01         
       500   295.47186      17.626403      17.459419      17.91262       0.01         

As you can see above the added force in x-direction is switched on in step 250 and immediately the center of mass starts to drift.

@srtee

Thank you for your comments and help. I have a bug in my .in file. I just figured out my problem.

I didn’t know “fix gravity”, and I went to try with this comman. It is useful and convennient!

I use GCMC to insert co2 molecules in simulation system, because my reseach is also about adsoption behavior in nanopores. I define co2, co2_c, and co2_o group before I use GCMC command. In GCMC command, i specify co2 group, but I didn’t know that the atoms in groups co2_c and co2_o don’t updated automatically as co2 group specified in GCMC command, which means there is no atoms in the co2_c and co2_o groups. Therefore, I didn’t addforce on C and O atoms succesfully.

The reason I use ppp-boundary condition is that I want to make sure my commands and strategy in lammps file are correct. For example, if i only add body force Fx (like acceleration) in such ppp-boundary system, the velocity vx should be linear to time steps. This validate my method for “addforce” is corredt.

@akohlmey

Thank you for your help. I just figured out my problem. I have a bug in my .in file.

I use GCMC to insert co2 molecules in simulation system, because my reseach is also about adsoption behavior in nanopores. I define co2, co2_c, and co2_o group before I use GCMC command. In GCMC command, i specify co2 group, but I didn’t know that the atoms in groups co2_c and co2_o don’t updated automatically, which means there is no atoms in the co2_c and co2_o groups. Therefore, I didn’t addforce on C and O atoms succesfully. Now, I define co2_c, and co2_o group after GCMC, so “addforce” command works now.

Thank you again!