Problems setting particle temperatures in packedBedTemp

Submitted by Evan.J on Sun, 07/29/2018 - 10:00

Hello, I am working on CFDEM with heat transfer by modifying the cfdemSolverPisoScalar/packedBedTemp tutorial.

I have noticed at least three other posts which seem to express the same problems - none of which are answered. This seems like basic heat transfer functionality, so hopefully the DCS computing team can set the record straight. Three related posts:

https://www.cfdem.com/forums/documentation-fix-couplecfdconvection-coupl...
https://www.cfdem.com/forums/cfdem-coupling-0
https://www.cfdem.com/forums/piso-scalar-solver-packed-bed)

In the cfdemSolverPisoScalar/packedBedTemp "in.liggghts_run" file, the particle temperatures are reset back to 600 at every DEM timestep with the commands:
region total block INF INF INF INF INF INF units box
set region total property/atom Temp 600.

Now, some strange things happen when I try to modify this:

A) If I want to run the same simulation but with a steady particle temperature of 300, I change the temperature in 4 places:
in in.liggghts_init:
fix heattransfer all heat/gran initial_temperature 300.
in in.liggghts_run:
fix cfd3 all couple/cfd/convection T0 300
fix heattransfer all heat/gran initial_temperature 300.
set region total property/atom Temp 300.

So 600 is not specified anywhere. However, upon running the simulation the temp is still set to 600! I can see this in the dump file as well as in the log file. In log.liggghts, I see the following (cut from near the beginning). It shows that the first time the set command is given it uses 300, but the next time (and every time thereafter) it uses 600.0000 - see the two bolded lines. Why does it keep setting the temperature to 600 instead of 300?

Total # of neighbors = 5684
Ave neighs/atom = 5.65572
Neighbor list builds = 0
Dangerous builds = 0
region total block INF INF INF INF INF INF units box
set region total property/atom Temp 300.

1005 settings made for property/atom

# apply nve integration to all particles that are inserted as single particles
fix integr all nve/sphere

# output settings, include total thermal energy
compute rke all erotate/sphere
thermo_style custom step atoms ke c_rke f_heattransfer vol
thermo 1000
thermo_modify lost ignore norm no
compute_modify thermo_temp dynamic yes
WARNING: Changing thermo_temp compute object. This object is deprecated and will be removed in the future. (../compute.cpp:161)

dump dmp all custom/vtk 20000 ../DEM/post/dump*.liggghts_run.vtk id type x y z ix iy iz vx vy vz fx fy fz omegax omegay omegaz radius f_Temp[0] f_heatFlux[0]

run 0
Setting up run at Sun Jul 29 09:39:28 2018

Memory usage per processor = 9.13486 Mbytes
Step Atoms KinEng rke heattran Volume
150001 1005 2.3338009e-06 5.06343e-06 420.23671 0.011
Loop time of 2.14577e-06 on 2 procs for 0 steps with 1005 atoms, finish time Sun Jul 29 09:39:28 2018

Pair time (%) = 0 (0)
Neigh time (%) = 0 (0)
Comm time (%) = 0 (0)
Outpt time (%) = 0 (0)
Other time (%) = 2.14577e-06 (100)

Nlocal: 502.5 ave 547 max 458 min
Histogram: 1 0 0 0 0 0 0 0 0 1
Nghost: 32 ave 34 max 30 min
Histogram: 1 0 0 0 0 0 0 0 0 1
Neighs: 2842 ave 3107 max 2577 min
Histogram: 1 0 0 0 0 0 0 0 0 1

Total # of neighbors = 5684
Ave neighs/atom = 5.65572
Neighbor list builds = 0
Dangerous builds = 0
run 500
Setting up run at Sun Jul 29 09:39:28 2018

Memory usage per processor = 9.13486 Mbytes
Step Atoms KinEng rke heattran Volume
150001 1005 2.3338009e-06 5.06343e-06 420.23671 0.011
CFD Coupling established at step 150100
CFD Coupling established at step 150200
CFD Coupling established at step 150300
CFD Coupling established at step 150400
CFD Coupling established at step 150500
150501 1005 2.4508543e-06 5.7530481e-06 420.23671 0.011
Loop time of 2.00462 on 2 procs for 500 steps with 1005 atoms, finish time Sun Jul 29 09:39:30 2018

Pair time (%) = 0.099398 (4.95846)
Neigh time (%) = 0 (0)
Comm time (%) = 0.21965 (10.9572)
Outpt time (%) = 3.61204e-05 (0.00180186)
Other time (%) = 1.68553 (84.0825)

Nlocal: 502.5 ave 547 max 458 min
Histogram: 1 0 0 0 0 0 0 0 0 1
Nghost: 32 ave 34 max 30 min
Histogram: 1 0 0 0 0 0 0 0 0 1
Neighs: 2842 ave 3107 max 2577 min
Histogram: 1 0 0 0 0 0 0 0 0 1

Total # of neighbors = 5684
Ave neighs/atom = 5.65572
Neighbor list builds = 0
Dangerous builds = 0
set region total property/atom Temp 600.000000

1005 settings made for property/atom
run 500

B) I actually do not want to reset the particle temperatures at every time step - I want the temperatures to change based on conduction, fluid temperature, etc. I would assume all I have to do is comment out (from in.liggghts_run):

#region total block INF INF INF INF INF INF units box
#set region total property/atom Temp 300.

But when I do, I get the error:

Executing command: 'set region total property/atom Temp 600.000000 '
set region total property/atom Temp 600.000000
ERROR: Set region ID does not exist (../set.cpp:722)

It's saying the region does not exist, but I'm not actually giving any 'set' command at all! So why does this error happen, and how can I let the particle temperatures change over time?

It seems these two are directly related - a command is being issued to set the temperature to 600.0000 for some reason, but I do not know where or why.

A short follow-up question:
What is the difference between heat/gran and heat/gran/conduction? The documentation page lists both but doesn't say if there is any difference between the two.

Thank you for the help and information!

Evan.J | Mon, 07/30/2018 - 09:10

Thanks for the tip!

I see - the file called liggghtsCommands is found in the CFD/constant folder, and it resets the temperature specified there. Or, by commenting out the "execute" line it does not reset the particle temperatures (I'm not sure if that stops other things from executing though).

This is a little confusing though - what does the 'set' line in in.liggghts_run actually do?
set region total property/atom Temp 600.
Intuitively it seems that this is where the temperature is reset to 600, but it's not. It seems this 'set' command doesn't actually set the temperature, so why is it included in the tutorial .in file, or what could it be used for?

Thanks!

Daniel Queteschiner | Wed, 08/01/2018 - 12:19

Well, what actually happens for a coupled run is that at first the LIGGGHTS input script is parsed and commands that have an immediate effect like the set command are executed immediately. Other commands are just prepared for doing their work during the simulation (like the fix gravity or fix nve/sphere commands). After this initial parsing and setup of the LIGGGHTS side, CFDEMcoupling is the driving code behind the scenes.

This means that the set command in the LIGGGHTS input script for the coupled run should actually be executed (exactly) once when the parser comes across it. For the rest of the simulation this command needs to be issued from the CFDEMcoupling side since the LIGGGHTS input script has no influence on the simulation anymore (the initial settings are still active though!).