Coupling Lammps and OpenFOAM

Submitted by nandiga1 on Mon, 01/28/2013 - 19:44

Hello,

Using Lammps, I have understood the dynamics of a chain of beads which are connected to each other, considering the interaction potential between the beads (Lennard-Jones potential + Nonlinear spring potential).
Further, I have developed solvers to implement the ion transport using continuum based models in OpenFOAM. Now, I would like to couple both these solvers.

For instance, for each time step, the position of the beads obtained from the Lammps simulation have to be read to update the space dependent permittivity in my continuum based framework. After solving the transport in OpenFOAM, I have to calculate the new position of the bead in the next time step. The process is repeated for N time steps.

I had come across this site which has implemented similar techniques. Please let me know which tutorial should I follow, to get a good understanding and help me solve the above problem.

Thanks for the help.

Regards
Vishal

alice's picture

alice | Tue, 01/29/2013 - 09:46

Hello Vishal,
CFDEMcoupling is a software carries out the coupling between LIGGGHTS and CFD-solvers, based on OpenFOAM. The tutorial cases coming with CFDEMcoupling are all coupled, and tailored for being computed with the solvers provided (unreolved CFD-DEM, resolved CFD-DEM, ...).
If you would like to incorporate your own solvers into CFDEMcoupling, it would be the easiest to have a look at an existing solvers and adjust yours in such a way that it fits into the framework...
Cheers,
Alice

nandiga1 | Fri, 02/01/2013 - 05:10

Hi,

1. I was able to install cfdem packages along with LIGGGHTS and OpenFOAM 2.1.x. I had no issues during the installation.

2. I was able to run the cfdemSolverIB tutorial. However, I had the following errors running the EurgentestMPI.

Reading momentum exchange field Ksl

Reading voidfraction field voidfraction = (Vgas/Vparticle)

Creating dummy density field rho

Reading particle velocity field Us

Reading/calculating face flux field phi

Selecting incompressible transport model Newtonian
Selecting turbulence model type RASModel
Selecting RAS turbulence model laminar

Reading g
Selecting locateModel engine
Selecting dataExchangeModel twoWayMPI
Starting up LIGGGHTS for first time execution
Executing input script '../DEM/in.liggghts_resume'
LIGGGHTS (Version LIGGGHTS-PUBLIC 2.2.4, compiled 2013-01-28-17:26:41 by cmn based on LAMMPS 20 Apr 2012)
Reading restart file ...
WARNING: Restart file version does not match LIGGGHTS version (read_restart.cpp:470)
--> restart file = Version LIGGGHTS-MASTER 2.0.3plusplus, compiled 2012-07-31-11:05:59 by cfdem based on LAMMPS 20 Apr 2012
--> LIGGGHTS = Version LIGGGHTS-PUBLIC 2.2.4, compiled 2013-01-28-17:26:41 by cmn based on LAMMPS 20 Apr 2012
WARNING: Restart file used different # of processors (read_restart.cpp:517)
WARNING: Restart file used different 3d processor grid (read_restart.cpp:530)
orthogonal box = (-0.015 -0.015 -0.001) to (0.015 0.015 0.0554)
2 by 2 by 2 MPI processor grid
ERROR: Invalid improper style (force.cpp:479)
--------------------------------------------------------------------------
mpirun noticed that the job aborted, but has no info as to the process
that caused that situation.
--------------------------------------------------------------------------
~
............................................................................................................................................................

Please let me know what the improper style error meant.

3. I had tried running the fillcylinder example and encountered the following errors.

LIGGGHTS (Version LIGGGHTS-PUBLIC 2.2.4, compiled 2013-01-28-17:47:44 by cmn based on LAMMPS 20 Apr 2012)
Created orthogonal box = (-0.015 -0.015 -0.001) to (0.015 0.015 0.0554)
1 by 1 by 1 MPI processor grid
ERROR: Illegal pair_style gran command, illegal keyword (pair_gran_hooke_history.cpp:511)
starting LIGGGHTS memory optimized parallel post processing
chunksize: 8 --> 8 files are processed per chunk. If you run out of memory reduce chunksize.
Working with 4 processes...
calculating chunks 1 - 1 of 1
aborting due to errors: [Errno 2] No such file or directory: 'dump.liggghts_init'
~

Please let me know why the pair_style command gives an error. Should I change any commands in the LIGGGHTS input file ? Also, I would like to know if there is any documentation on the tutorial and on the coupling between the two packages, viz, OpenFOAM and LIGGGHTS to understand the code structure. Kindly let me know.

Thanks for the help.

Regards,
Vishal

Vishal Nandigana

cgoniva's picture

cgoniva | Thu, 02/07/2013 - 10:45

this was a LIGGGHTS-CFDEMcoupling version problem being fixed with the latest versions of both codes.
(see forum post: Error in running tutorial)

Cheers,
Chris