Reverse osmosis simulation

From: Z (shenzldlut_at_yeah.net)
Date: Thu Jan 22 2015 - 05:09:24 CST

Dear all,
I want to make model about reverse osmosis in membrane, but when I use tclForce to add force to the water molecules and ions, the water flux is lees than 0. So, there is no osmotic effect in my simulation. Does my tclForce file have problem? I use the NVT ensamble in this simulation. Should I need use TclBCForce?

This is my TclForce file:
    set force1 {0 0 0.05}
    set LowerBoundary -15.6
    set UpperBoundary 15.6

    # define water names
    set watResName "water"
    set watAtomName "OH2"
    set sodResName "SOD"
    set sodAtomName "SOD"
    set claResName "CLA"
    set claAtomName "CLA"
    set waters_list {}
    set ions_list {}
    set inStream [open $allatompdb r]
    foreach line [split [read $inStream] \n] {
        set string1 [string range $line 0 3]
        set string2 [string range $line 6 10]
        set string3 [string range $line 17 20]
        set string4 [string range $line 13 15]
        set string5 [string range $line 46 53]
        set string6 [string range $line 72 75]
        set string7 [string range $line 22 25]
  
       if { ([string equal $string1 {ATOM}] || \
          [string equal $string1 {HETA}] ) && \
         [string equal $watResName $string3] &&\
         [string equal $watAtomName $string4] } {
   
        lappend waters_list "[string trim $string6]\
                [string trim $string7] $watAtomName"
               
        }
   
         if { ([string equal $string1 {ATOM}] || \
          [string equal $string1 {HETA}] ) && \
         [string equal $sodResName $string3] &&\
         [string equal $sodAtomName $string4] } {
   
        lappend ions_list "[string trim $string6]\
                [string trim $string7] $sodAtomName"
               
        }

         if { ([string equal $string1 {ATOM}] || \
              [string equal $string1 {HETA}] ) && \
             [string equal $claResName $string3] &&\
             [string equal $claAtomName $string4] } {
   
        lappend ions_list "[string trim $string6]\
                    [string trim $string7] $claAtomName"
               
    }
 }

close $inStream

# make list of indices

set waters {}
foreach atomrecord $waters_list {
    foreach {segname resid atom} $atomrecord { break }
    set atomindex [atomid $segname $resid $atom]
    lappend waters $atomindex
    addatom $atomindex
}

set ions {}
foreach atomrecord $ions_list {
    foreach {segname resid atom} $atomrecord { break }
    set atomindex [atomid $segname $resid $atom]
    lappend ions $atomindex
    addatom $atomindex
}
set waters [concat $waters]
set ions [concat $ions]

###########################################

proc calcforces {} {
    global waters ions force UpperBoundary LowerBoundary
    loadcoords coorList
    foreach i $waters {
      set z [lindex $coorList($i) 2]
      if {$z>$UpperBoundary || $z<$LowerBoundary } {
        addforce $i $force
      }
    foreach i $ions {
      set z [lindex $coorList($i) 2]
      if {$z>$UpperBoundary || $z<$LowerBoundary } {
        addforce $i $force1
      }
      }
}

}

-- 
Z
E-mail:shendlut_at_yeah.net 
2015/1/22

This archive was generated by hypermail 2.1.6 : Thu Dec 31 2015 - 23:21:34 CST