problem by deleting atoms (related: liggghtscommands, atom shrink)

Submitted by CM Jiang on Thu, 09/27/2018 - 04:04

hello everyone,

I am using CFDE to simulate the combustion process of particles. I wish the particlesl shrink after heating to 350 degrees and disappear after the radius is less than 0.003. I used two ways to solve the problem, but both got ERRORS.

1.way

I write the following code in in.liggghts_run:
------------------------------------------------------------------------------------------------------------------------
variable shrinkevery equal 100
variable Temptrigger equal 350
variable rate equal 0.99
variable tresh atom f_Temp>${Temptrigger}
variable tresh atom f_Temp>350
compute rad all property/atom radius
variable dshrunk atom 2.*c_rad*(v_tresh*${rate}+(1.-v_tresh))
variable dshrunk atom 2.*c_rad*(v_tresh*0.99+(1.-v_tresh))
fix grow all adapt ${shrinkevery} atom diameter v_dshrunk
fix grow all adapt 100 atom diameter v_dshrunk

variable radiussmall atom c_rad<0.003
group Asche variable radiussmall
----------------------------------------------------------------------------------------------------------------------------
and the codeline: delete_atoms group Asche in ../CFD/Constant/liggghtsCommands
----------------------------------------------------------------------------------------------------------------------------
executeProps1
{
command
(
delete_atoms
blanks
group
blanks
Asche
);
runFirst off;
runLast off;
runEveryCouplingStep on;
}
------------------------------------------------------------------------------------------------------------------------------

In the simulation Error shows: ERROR: Compute used in variable between runs is not current. Use the update_on_run_end option for computes to avoid this. (../variable.cpp:1094) so the c_rad will not be updated during the simulation.
I added the update_on_run_end yes after compute rad all property/atom radius. The Error shows ERROR: Invalid keyword in compute property/atom command. It seems that update_on_run_end yes not suitable for this codeline.

2.Way

I write 3 codeline in ../CFD/constant/liggghtsCommand
variable radiussmall atom c_rad<0.003
group Asche variable radiussmall
delete_atoms group Asche

--------------------------------------------------------------------------------------------------------------------------------

FoamFile
{
version 2.0;
format ascii;

root "";
case "";
instance "";
local "";

class dictionary;
object liggghtsCommands;
}

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

liggghtsCommandModels
(
runLiggghts
execute
);

executeProps1
{
command
(
variable
radiussmall
atom
noBlanks
c_rad
<
number
);
scalars
(
0.003
);

runFirst off;
runLast off;
runEveryCouplingStep on;
}

executeProps2
{
command
(
group
Asche
variable
radiussmall
);
runFirst off;
runLast off;
runEveryCouplingStep on;
}

executeProps3
{
command
(
delete_atoms
blanks
group
blanks
Asche
);
runFirst off;
runLast off;
runEveryCouplingStep on;
}
-----------------------------------------------------------------------------------------------

but just the first codeline will be readed in the simulation:
-----------------------------------------------------------------------------------------------
Total # of neighbors = 500
Ave neighs/atom = 2.5
Neighbor list builds = 0
Dangerous builds = 0
Executing command: 'variable radiussmall atom c_rad<0.003000'
variable radiussmall atom c_rad<0.003000
LIGGGHTS finished
-----------------------------------------------------------------------------------------------------------

my question:
which way is the correct way to delete the atoms?
if the first way is correct: how to update the c_rad?
if the second way is correct: how to run the three executeProps on by one?

I am grateful for your help!

kind regards

Jiang

paul | Thu, 09/27/2018 - 09:01

Way 1: Read this
https://www.cfdem.com/media/DEM/docu/compute.html
compute ID group-ID style general_keywords general_values args
general_keywords = update_on_run_end
update_on_run_end value = 'yes' or 'no'
yes = compute is updated at the last step of each run command
no = compute is not updated at the end of a run
args = arguments used by a particular style

Way 2:
Read this:
https://www.cfdem.com/media/CFDEM/docu/liggghtsCommandModel_execute.html
Just add two more 'execute' to the liggghtsCommandModels list.

CM Jiang | Thu, 09/27/2018 - 10:49

Hi Paul,

Thank you for your reply!

For Way 2. i add two mor execute and it works. But there is the same Error again: "compute used in variable between runs is not current".
So it is back to the first question....
In Way 1 my code is: compute rad all property/atom radius. The Error shows : "compute used in variable between runs is not current".
If i change the code to : compute rad all property/atom radius update_on_run_end yes. The Error shows: "Invalid Keyword in compute property/atom command"
So what is the correct code for update of c_rad?

thanks a lot for your help!

Kind regards

Jiang

CM Jiang | Sat, 09/29/2018 - 05:07

Hello paul,

the code line of compute has been changed to:
compute rad all property/atom update_on_run_end yes radius.
this code line is now correct.

but in the Simulation, there is the same ERROR again:
variable radiussmall atom c_rad<0.003
group Asche variable radiussmall
ERROR: Compute used in variable between runs is not current

maybe you konw why?

best

Jiang

CM Jiang | Fri, 10/19/2018 - 20:36

hello everyone,

1. to make the c_rad current: there is an example in the group command (Atom-style variables)
compute 1 all pe/atom
compute 2 all reduce sum c_1
thermo_style custom step temp pe c_2
run 0
variable eatom atom "c_1 > -3.0"
group hienergy variable eatom
2. i have to write 3 codeline in ../CFD/constant/liggghtsCommand
variable radiussmall atom c_rad<0.003
group Asche variable radiussmall
delete_atoms group Asche
otherwise the group Asche will be empty all the time

Rachel | Tue, 07/30/2019 - 10:23

Thanks Jiang, your summary really helps. I used method 1 and it works well.

Rachel