About identifying different particle types in source code

Please select the most relevant MFiX category: Identifying different particles through the code can help you see if that’s right?
IF (USE_COHESION .AND. VAN_DER_WAALS) THEN

INTEGER :: PHASE_LL, PHASE_I
PHASE_LL = PIJK(LL,5) 
PHASE_I  = PIJK(I,5)  

IF (OVERLAP_N > 0.0d0) THEN
    
    IF (PHASE_LL == 1 .AND. PHASE_I == 1) THEN       ! solid1-solid1
        FORCE_COH = 0.000000000001d0  ! 1e-12 
    ELSE IF (PHASE_LL == 1 .AND. PHASE_I == 2) THEN  ! solid1-solid2
        FORCE_COH = 0.0000000000015d0 ! 1.5e-12 
    ELSE IF (PHASE_LL == 2 .AND. PHASE_I == 1) THEN  ! solid2-solid1
        FORCE_COH = 0.0000000000015d0 ! 1.5e-12 
    ELSE IF (PHASE_LL == 2 .AND. PHASE_I == 2) THEN  ! solid2-solid2
        FORCE_COH = 0.000000000002d0  ! 2e-12 
    ELSE
        FORCE_COH = 0.0d0  ! 
    ENDIF

Please provide a little more context. What file is this in? Are you doing this in a UDF, or are you modifying MFiX source?

[quote=“cgw, post:2, topic:6144”]
Please provide a little more context. What file is this in? Are you doing this in a UDF, or are you modifying MFiX source
[/quote]i am modifying MFIX source.This is the source of the cohesive force model in the DEM plate。I want to add interparticle forces related to moisture content in this model. Since the two types of particles have different moisture contents, I need to identify the particle types to apply different forces.

This looks reasonable to me. Note that you can write double-precision constants in Fortran with a D instead of E (D for “double”), so you can write 1d-12 instead of 0.000000000001d0