Setup Guide: resolvedDiffuseInterfaceLAMMPSFoam#

This guide walks through the necessary input parameters and procedures to set up a simulation case for the resolvedDiffuseInterfaceLAMMPSFoam solver.

A coupled CFD-DEM case in WashOpenFOAM generally requires setting up standard OpenFOAM directories (0/, constant/, system/) alongside a DEM script to drive WASHLIGGGHTS.

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. Must be present when using 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.

  • pDivFree: A pseudo-pressure field required if using Immersed Boundary (IB) models (e.g., immersedBoundaryExplicit or immersedBoundarySemiImplicit) to enforce a divergence-free fluid velocity.

  • alpha.solid: The solid volume fraction field mapped from DEM particles.

  • Us.solid: The solid velocity field mapped from DEM particles.

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 how the solid particles interact with the fluid (e.g., Immersed Boundary or Volume Penalisation) and whether to use the Immersed Free Surface (IFS) method for dynamic contact angles.

phases (solid);

// Select the solid interaction model (e.g., immersedBoundaryExplicit, volumePenalisationImplicit)
solidInteractionModel   "immersedBoundaryExplicit";

immersedBoundaryExplicitCoeffs
{}

// Configure the Immersed Free Surface (IFS) method for wettability
immersedFreeSurface
{
    useIFS               true;

    // Advancing, receding, and static contact angles (in degrees)
    thetaIFSAdv          60;
    thetaIFSRec          60;
    thetaIFS0            60;

    uThetaIFS            1e-4; // Dynamic contact angle relaxation velocity

    // Pseudo-time step for IFS transport (typically ~10% of cell size)
    deltaTau             deltaTau [ 0 1 0 0 0 0 0 ] 1.67e-6;

    // Artificial diffusion and anti-diffusion for numerical stability
    DDiffusion           1;
    nDiffusion           2;
    DAntiDiffusion       1;
    nAntiDiffusion       2;
    TOL                  1e-6;
}

5. CFD-DEM Coupling (constant/kinematicCloudProperties)#

This file dictates the sub-models responsible for mapping fields, 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              hyperbolicTangent;
    hyperbolicTangentCoeffs
    {
        thicknessParameter   0.075; // Interface thickness parameter delta
    }

    // Forces to apply to the particles
    interactionModels
    {
        dragResolved;
        buoyancyResolved;
        capillaryResolved;
    }
}

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 application to resolvedDiffuseInterfaceLAMMPSFoam. Define deltaT, startTime, and endTime.

  • ``system/fvSchemes``: Ensure appropriate schemes for the phase-field advection. Typically, MULES or a TVD scheme (like vanLeer or limitedLinear) is used for div(phi,alpha).

  • ``system/fvSolution``: Configure solvers for p (e.g., GAMG or PCG), U (e.g., PBiCGStab), and alpha.water/psi. If using an Immersed Boundary method, ensure pDivFree is also configured with a symmetric solver (like PCG).

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:

resolvedDiffuseInterfaceLAMMPSFoam

Or, for parallel execution:

mpirun -np <num_cores> resolvedDiffuseInterfaceLAMMPSFoam -parallel