DEM output result is always zero

Hello,
I have encountered a problem. I want to output the drag force on each particle in DEM. By studying the forums, I inserted three DES_USR_VAR in lines 206-208 of drag_gs_des0.f.


image
image

The solver is able to build, but the output result of drag force is always zero.

image

Can you tell me if the code is written incorrectly? Please give me some guide.
Looking forward to your help!
Thank you!

1 Like

Please attach your input files - main menu/submit bug report. Thanks!

Thank you, here is my input files. No bug report was generated because no errors were reported during the run. Thank you for your help and I hope you can give me some guidance!
1129.zip (15.1 KB)

When in doubt, use write statements.

Adding a line to DRAG_GS_DES0 print out the computed values:

!Output drag force   20231128 Mengyuan Wang
           DES_USR_VAR(11,NP) = D_FORCE(1)
           DES_USR_VAR(12,NP) = D_FORCE(2)
           DES_USR_VAR(13,NP) = D_FORCE(3)
           write(*,*) "D_FORCE", D_FORCE	

And when I run this - I do not see D_FORCE in the output, because this code is not being called at all!

Let’s see who calls this function:

(mfix-23.3.2)$ cd $CONDA_PREFIX/share/mfix/src
(mfix-23.3.2)$ grep -i -r drag_gs_des0

model/CMakeLists.txt:  des/drag_gs_des0.f
model/des/calc_des_2fluid.f:   USE DRAG_GS_DES0_MOD, only: DRAG_GS_GAS0
model/des/calc_drag_des.f:      use drag_gs_des0_mod, only: drag_gs_des0
model/des/calc_drag_des.f:            CASE(DES_INTERP_GARG) ; CALL DRAG_GS_DES0
model/des/drag_gs_des0.f:MODULE DRAG_GS_DES0_MOD
model/des/drag_gs_des0.f:!  Subroutine: DRAG_GS_DES0                                            C
model/des/drag_gs_des0.f:      SUBROUTINE DRAG_GS_DES0
model/des/drag_gs_des0.f:      END SUBROUTINE DRAG_GS_DES0
model/des/drag_gs_des0.f:END MODULE DRAG_GS_DES0_MOD

There’s only one place this subroutine is CALLed, and that is:

model/des/calc_drag_des.f:            CASE(DES_INTERP_GARG) ; CALL DRAG_GS_DES0

The DRAG_GS_DES0 subroutine is only used when the DES_INTERP_SCHEME is set to GARG, but you have it set to None

You need to either change the interp. scheme, or else insert your code into a different subroutine.

Hello researcher, sorry to bother you. In the above folder, I opened the terminal and typed your code. Why can’t I get the above result?


Best wishes!

Ooops, sorry, I should not have posted that git grep command. That will only work if you are an MFiX developer and have checked MFiX out from git. This does not apply for normal MFiX users. You should use plain grep, not git grep.

Also, you have to be in the MFiX source directory, not your project directory, when you do this.

You can do:

$ conda activate mfix-23.3.2
(mfix-23.3.2) cd $CONDA_PREFIX/share/mfix/src
(mfix-23.3.2) grep -i -r drag_gs_des0

The -r flag tells grep to operate recursively on all files and subdirectories.

– Charles

Hello researchers, sorry to bother you again. I opened the terminal directly on the desktop of the Linux system, followed the advice to type the command, and was pleasantly surprised to find that there was a problem. What should I do to solve it?


Best wishes!

Oops, I missed the ‘E’ in PREFIX. Should be CONDA_PREFIX not CONDA_PRFIX. (Sorry, I am typing on my phone)

Thank you for your patient answer.

Thanks for your help, I will try it!