move/mesh - linear/variable args

Submitted by mcsk2000 on Tue, 05/15/2018 - 00:04

hello!

I am trying to see the interaction between a structure and particles by using an external coupling with LIGGGHTS. I modeled a structure by using mesh model. So with move/mesh function, I would like to update the mesh's position and velocity from my code and receive the forces applied by particles to my code.

Is it available for LIGGGHTS to read the position and velocity from variables out of the program?
This option of "linear/variable args" seems to be suitable, but still, don't know how to feed those variables in the input file.

linear/variable args = var_Vx var_Vy var_Vz
var_Vx,var_Vy,var_Vz = variables specifying components of velocity vector (velocity units)

arnom's picture

arnom | Tue, 05/15/2018 - 15:17

If you want this coupling for every time step this can be achieved with LIGGGHTS input scripts but it might be a bit cumbersome.

Basically you would want to do a run command using the every keyword and inside this every keyword you would want to have an include command that reads in a file from your other code saying something like "variable vx equal 10.0 .... "

DCS team member & LIGGGHTS(R) core developer

richti83's picture

richti83 | Wed, 05/16/2018 - 13:50

Are we talking about file coupling or do you use liggghts as library / master for a coupled simulation ?
Do you couple DEM/FEM or DEM/MBD ?

I've written a new mesh_mover which communicates with a multibody solver and transferes forces to the MBD code and receives position, orientation and velocities from MBD solver.
See [1] and [2] to get a basic idea.
Feel free to contact me when you are interested in a cooperation.

[1] Katterfeld, A. ; Otto, H. ; Richter, C. ; Rossiter, E. ; Szczelina, P.: Coupled discrete element and multi-body system simulation for determination of the performance of primary crushers. In: CFDEM®project user meeting & workshop.
[2] https://www.tib.eu/de/suchen/id/TIBKAT%3A871968150/Softwaresystem-zur-ga...

I'm not an associate of DCS GmbH and not a core developer of LIGGGHTS®
ResearchGate | Contact

Rector Mukwiri | Mon, 08/20/2018 - 19:25

Hi, I have tried to use the linear/variable keyword and I keep getting errors. Can someone help me figure out what am doing wrong? Here is a couple of examples and the errors associated.

fix moverightmesh all move/mesh mesh rightwall linear/variable ${vx} ${vy} ${vz}

For that code, I get the error message: ERROR: Variable name 1 for fix move/mesh linear/variable does not exist (../mesh_mover.cpp:133)

fix moverightmesh all move/mesh mesh rightwall linear/variable v_vx v_vy v_vz

For this second code, I get the error message: ERROR: Variable name 2 for fix move/mesh linear/variable does not exist (../mesh_mover.cpp:134)

richti83's picture

richti83 | Mon, 08/27/2018 - 09:54

You need to define all variables without leading v_ , but using v_ in the move cmd:

variable vx equal 5*step*dt
variable vy equal 0
variable vz equal 0
fix moverightmesh all move/mesh mesh rightwall linear/variable v_vx v_vy v_vz

I'm not an associate of DCS GmbH and not a core developer of LIGGGHTS®
ResearchGate | Contact

Rector Mukwiri | Wed, 08/29/2018 - 14:33

Hi richti83,

Thanks for the response. I have tried what you suggested, but I suppose am not doing it right because am still getting the same error. Variable vx changes at every timestep based on other variables, which are themselves changing. vy and vz are both zero. So this is how am defining vx

variable vx equal v_beta*v_xdif/${dt}

In my example, there are two variables beta and xdif, which change at every time step. I have tried to change the way am defining vx a few times and I either get an error message letting me know that there is an unknown term, or I end up getting the errors I originally posted. The variations of vx below have not worked either.

variable vx equal beta*xdif/dt
variable vx equal ${beta}*${xdif}/${dt}

Any more suggestions?

richti83's picture

richti83 | Wed, 08/29/2018 - 21:52

I guess you mixed all together to a non-working situation :-).
1st: dt is a system defined thermo variable and should be stated as dt (without v_ and without ${dt})
2nd: I need all variable definitions for beta and xdif
3rd: the order is important, first define beta and xdif after that define vx and after that use v_vx in the move command.
4th only use equal style variable, you can not mix atom and equal style.
Pls post the other error as " ERROR: Variable name 1 for fix move/mesh linear/variable does not exist" only occurs when you use a not defined v_-Variable.

I'm not an associate of DCS GmbH and not a core developer of LIGGGHTS®
ResearchGate | Contact

Rector Mukwiri | Thu, 08/30/2018 - 00:36

Hi richti83,

Many thanks for the quick response. It is now working after the suggested changes. I have changed the variable name I was using for dt to deltat, which is what I use for the timestep. I also changed a line for my front wall movement from

fix movefront all move/mesh mesh frontwall linear/variable v_vconst -v_vy v_vconst

to

fix movefront all move/mesh mesh frontwall linear/variable v_vconst v_vy v_vconst

and that worked. LIGGGHTS didn't like the dt and the minus sign on in the above. I decided to put the minus sign on the variable definition. Hopefully it will now run the simulation to the end. If it fails, I will post again here. :)

Thank you so much! :)