I want to calculate viscosity in a couette flow, for which I require Pxy.
From what I read in the manual Lammps does that for us. But its my understanding
that it calculates that for an instant of time. Hence I require to average over time.
I am using the ave/correlate to average it:
variable pxy equal pxy
.
fix 6 all ave/correlate 1 50000 50000 v_pxy type auto file pres_fb.dat
.
thermo_style custom step temp etotal c_mobile_thermo v_pxy
but I am getting the following error:
ERROR: Thermo keyword in variable requires thermo to use/init press
when checked in manual it says:
"Thermo keyword in variable requires thermo to use/init press
You are using a thermo keyword in a variable that requires pressure to be calculated, but your thermo
output does not use it. Add it to your thermo output"
I am unable to figure out what is it that I am doing wrong.
Also find at the end the complete code.
Thank you.
BR/Joseph
# 3-d LJ flow simulation
units lj
dimension 3
boundary p s p
atom_style atomic
neighbor 0.3 bin
neigh_modify delay 1
# create geometry
region fluid block 0 11.95 1.5 26.07 0.0 7.22 units box
region btm_wall block 0 11.95 0 1.5 0.0 7.22 units box
region top_wall block 0 11.95 26.07 28.0 0.0 7.22 units box
region simulation_box union 3 btm_wall fluid top_wall units box
create_box 3 simulation_box
lattice fcc 0.81 orient x 1 1 -2 orient y 1 1 1 orient z 1 -1 0
create_atoms 1 region fluid units box
lattice fcc 0.81 orient x -1 1 0 orient y 1 1 1 orient z 1 1 -2
create_atoms 2 region btm_wall units box
lattice fcc 0.81 orient x -1 1 0 orient y 1 1 1 orient z 1 1 -2
create_atoms 3 region top_wall units box
mass 1 1.0
mass 2 1.0
mass 3 1.0
# LJ potentials
pair_style lj/cut 2.2
pair_coeff * * 1.0 1.0
pair_coeff 1 2*3 0.1 1.0
pair_modify shift yes
# define groups
region 1 block INF INF INF 1.5 INF INF units box
group lower region 1
region 2 block INF INF 26.07 INF INF INF units box
group upper region 2
group boundary union lower upper
group flow subtract all boundary
set group lower type 2
set group upper type 3
# initial velocities
#compute mobile flow temp
#velocity flow create 1.10 482748 temp mobile units box
#fix 1 all nve
# thermostating
compute mobile_thermo all temp/partial 0 0 1
fix 2 all langevin 1.10 1.10 1.0 699483
fix 1 all nve
fix_modify 2 temp mobile_thermo
thermo_modify temp mobile_thermo
# Couette flow
velocity lower set 0.0 0.0 0.0 units box
velocity upper set 1.0 0.0 0.0 units box
fix 3 boundary setforce 0.0 0.0 0.0
variable pxy equal pxy
fix 5 flow ave/spatial 1 500000 500000 x center 11.95 z center 7.22 y 1.5 1.02375 vx region fluid file vel_fb.profile units box
fix 6 all ave/correlate 1 50000 50000 v_pxy type auto file pres_fb.dat
# Run
timestep 0.005
thermo 5000
thermo_style custom step temp etotal c_mobile_thermo v_pxy
run 1000000