CFD–DEM simulation
CFD–DEM simulation
Phynexis couples discrete-element solids with fluid solvers based on OpenFOAM, using solver variants such as hybridCFDdem, interIBdem, and semiResolvedCFDdem. This page describes how to run bundled OpenFOAM-style cases that ship with the licensed Phynexis / CFDDEM source tree.
:::info Engine vs this website
Paths such as cfddem/examples/... refer to directories inside your engine checkout, not the Examples section of this documentation site. The site Examples are standalone Python scripts; CFD–DEM tutorials live next to OpenFOAM case files in the distribution you received.
:::
Prerequisites
- A supported OpenFOAM environment compatible with your Phynexis build (see your distributor’s release notes).
- Phynexis Python bindings available to the case scripts (typically via
pip/ wheel as in Installation, or a developer build path—see below). - Familiarity with OpenFOAM case layout (
system/,constant/,0/).
Case layout and drivers
Coupled cases use the usual OpenFOAM directory structure. DEM coupling is driven from Python (for example createDEM.py) while the fluid mesh and fields follow OpenFOAM conventions. In each case, system/fvSolution → coupling names the DEM script and callback used for that run—adjust there when you switch coupling strategies or DEM inputs.
Running bundled examples
Example cases live under the examples/ folder inside the cfddem tree of your source distribution (not under this repo). From an example directory you will typically use the provided Allwclean / Allrun scripts, for example:
./Allrun
Use ./Allrun-parallel when the case ships it for parallel mesh decomposition.
If import phynexis fails inside createDEM.py, insert the library path for your build before importing, for example:
import sys
sys.path.append("/path/to/phynexis/build/lib/")
import phynexis
Use the actual lib path from your installation or build instructions.
Water entry example (interIBdem)
Illustrative workflow (paths relative to your cfddem checkout):
-
Copy the case tree to a writable location:
cd cfddemcp -rf examples/interIBdem/water_entry local/interIBdem/ -
Run (after checking
system/fvSolution→couplingpoints at the intended DEM script):cd local/interIBdem/water_entry./Allclean./Allrun-parallel -
If execution fails, verify the Phynexis library path in
createDEM.pymatches the directory that contains your built Python modules.
Visualization
- Open
interIBdem.foamin ParaView for the fluid fields; set Case Type to Decomposed Case when working with decomposed meshes, and optionally disable Skip Zero Time. - DEM VTK sequences typically appear under
dem/(for exampleparticle_mesh_*.vtk.series). For spherical particles you can group series and map velocities with ParaView filters; for CFD–fluid interfaces, a Contour onalpha.waterat0.5is common for two-phase surfaces.
General ParaView workflows for Phynexis VTK output (particles, walls, contact tubes, rendering) are centralized in ParaView rendering.
Modifying the water-entry case
- Fluid properties —
constant/transportProperties; phase names must stay consistent withalpha.<phase>fields (for example insystem/setFieldsDict). - Mesh / geometry —
system/blockMeshDict. If a length scale is applied there, vertex coordinates are multiplied accordingly when the mesh is built. - Mesh resolution — controlled by the refinement near
simpleGradingin theblocks→hexentry; prefer nearly cubic cells when possible. - Initial volume fractions —
system/setFieldsDict. Scaling fromblockMeshDictdoes not apply here: coordinates are physical. A box entry such asbox (-0.05 -0.05 -0.15) (0.05 0.05 0.03)sets lower-front-left and upper-back-right corners. Ensurealpha.<phase>names matchtransportProperties→phases. - Time control —
system/controlDict(end time, Δt, write interval). - DEM setup — in
createDEM.py, functions such asoneSphere()adjust DEM domain size, walls, and insertion regions. Parameters namedscalemay scale the overall DEM box and insertion zone, whilep_sizeoften sets the physical particle diameter—check the function body for your case variant.
For licensing, binaries, or case packs not present in your tree, use the contact channel on About.