Setup Guide: unresolvedDiffuseInterfaceLAMMPSFoam#
This guide walks through the necessary input parameters and procedures to set up a simulation case for the unresolvedDiffuseInterfaceLAMMPSFoam solver.
A coupled unresolved CFD-DEM case in WashOpenFOAM requires setting up standard OpenFOAM directories (0/, constant/, system/) alongside a DEM script to drive WASHLIGGGHTS. The unresolved (mesoscopic) approach uses volume-averaged equations and appropriate drag models rather than directly resolving the particle boundaries.
1. Directory Structure#
A typical simulation case directory is structured as follows:
case_directory/
├── 0/
│ ├── U
│ ├── Us.solid
│ ├── p_rgh
│ ├── alpha.water
│ ├── alpha.solid
│ ├── pDivFree
│ └── psi
├── constant/
│ ├── transportProperties
│ ├── solidProperties
│ ├── kinematicCloudProperties
│ ├── g
│ └── polyMesh/
├── system/
│ ├── controlDict
│ ├── fvSchemes
│ ├── fvSolution
│ ├── setFieldsDict
│ └── blockMeshDict
└── LAMMPS/
└── in.lammpsInputScript
2. Initial Fields (0/)#
The 0/ directory defines the initial boundary conditions and fields for the simulation.
alpha.water: The phase fraction field (order parameter). Initializes the fluid-fluid interface. Bounded between 0 and 1.psi: The chemical potential field required for the diffuse interface method. Can typically be initialized to a uniform value of 0.U: The mixture fluid velocity vector field.p_rgh: The pseudo-hydrostatic pressure field.alpha.solid: The solid volume fraction field mapped from DEM particles.Us.solid: The solid velocity field mapped from DEM particles.pDivFree: A pseudo-pressure field sometimes required to enforce a divergence-free fluid velocity.
3. Fluid Properties (constant/transportProperties)#
This file defines the physical properties of the two immiscible fluid phases, surface tension, and diffuse interface parameters.
phases (water air);
water
{
transportModel Newtonian;
nu nu [ 0 2 -1 0 0 0 0 ] 1e-06;
rho rho [ 1 -3 0 0 0 0 0 ] 1000;
}
air
{
transportModel Newtonian;
nu nu [ 0 2 -1 0 0 0 0 ] 1.5e-5;
rho rho [ 1 -3 0 0 0 0 0 ] 1.2;
}
sigma sigma [ 1 0 -2 0 0 0 0 ] 0.072; // Surface tension coefficient
diffuseInterface
{
epsilon epsilon [ 0 1 0 0 0 0 0 ] 1e-05; // Interface thickness
M M [ 0 2 -1 0 0 0 0 ] 2e-5; // Mobility coefficient
}
4. Solid Interaction Settings (constant/solidProperties)#
This dictionary configures the unresolved drag model governing the momentum exchange between the fluid and sub-grid particles.
phases (solid);
// Select the unresolved drag model (e.g., GidaspowImplicit, BeetstraExplicit)
solidInteractionModel "GidaspowImplicit";
GidaspowImplicitCoeffs
{}
5. CFD-DEM Coupling (constant/kinematicCloudProperties)#
This file dictates the sub-models responsible for mapping fields (coarse-graining), exchanging data via MPI, calculating fluid-particle forces, and triggering the DEM solver.
// Name of the LAMMPS input script
lammpsInputScript "in.lammpsInputScript";
subModels
{
couplingControlModel standardControl;
standardControlCoeffs
{
couplingInterval 2; // Number of DEM steps between data exchange
}
LAMMPSCommandModels
{
runLAMMPS;
writeRestartLAMMPS;
}
dataExchangeModel MPIExchange;
MPIExchangeCoeffs
{
useMPISharedMemory true;
MPISHMParticle2Fluid true;
MPISHMFluid2Particle true;
}
searchModel standardSearch;
standardSearchCoeffs
{
useTreeSearch true;
}
// Mapping model for the solid volume fraction and velocity
locateModel diffusionBasedCoarseGrain;
diffusionBasedCoarseGrainCoeffs
{
Ds Ds [ 0 1 0 0 0 0 0 ] 1.8e-03; // Coarse-graining width
nSubCycles 10;
}
// Unresolved forces to apply to the particles
interactionModels
{
drag;
pressureGradient;
}
}
6. DEM Setup (LAMMPS/in.lammpsInputScript)#
The DEM script is executed by WASHLIGGGHTS and defines particle generation, material properties (Young’s modulus, Poisson ratio, friction), and gravity.
The coupling interval time step \(\Delta t_{\text{coupling}}\) is determined by the DEM time step and the coupling interval:
\(\Delta t_{\text{coupling}} = \Delta t_{\text{DEM}} \times N_c\), where \(N_c\) is specified as couplingInterval.
It is recommended that \(\Delta t_{\text{coupling}}\) is in the comparable order with \(\Delta t_{\text{CFD}}\) for stability and accuracy.
Example snippet:
atom_style sphere
atom_modify map array
boundary f f f
newton off
communicate single vel yes
units si
# ... (Define materials, regions, particle generation) ...
# The fix coupling command is necessary for the particles to receive the fluid forces.
# More details about fix coupling can be found in the WASHLIGGGHTS manual page.
fix cfd_coupling all coupling
timestep 0.00005
# Run the DEM simulation. The run command length will be overridden by the coupling scheme,
# but a run command is required to initialize the fix.
run 1
7. Numerical Controls (system/)#
``system/controlDict``: Set
applicationtounresolvedDiffuseInterfaceLAMMPSFoam. DefinedeltaT,startTime, andendTime.``system/fvSchemes``: Ensure appropriate schemes for the phase-field advection. Typically, MULES or a TVD scheme (like
vanLeerorlimitedLinear) is used fordiv(phi,alpha).``system/fvSolution``: Configure solvers for
p(e.g., GAMG or PCG),U(e.g., PBiCGStab), andalpha.water/psi.
8. Running the Simulation#
After setting up the mesh (e.g., using blockMesh) and initializing the phase fields (e.g., using setFields), run the simulation simply by executing:
unresolvedDiffuseInterfaceLAMMPSFoam
Or, for parallel execution:
mpirun -np <num_cores> unresolvedDiffuseInterfaceLAMMPSFoam -parallel