Error in computation of rate of dilation

Dear Experts,
I want to compute the rate of dilation of solid phase in MFiX Dem using the formular “Dilation rate = ∂u/∂x+∂v/∂y+∂w/∂z
∂u/∂x = (u(x+Δx)-u(x))/Δx”.
I am thinking that implementing this should follow the basic step of finding the ratio of the difference between current and previous velocities to the difference between current and previous particles positions. I followed this step to implement this in the des_granular_temperature.f, but I get access violation error when I try to run the case after compilation.
one_2024-01-11T202954.328921.zip (75.5 MB)

158 !-----------------------------Ugo-----------------------------------------
159         RD_x(IJK,M) = RD_x(IJK,M) + &
160            ((DES_VEL_NEW(LL,1)-DES_VEL_OLD(LL,1))/(DES_POS_NEW(LL,1)-DES_POS_OLD(LL,1)))

The error message indicates that the error is on line 160.

The debugger tells us that DES_VEL_OLD is not allocated.

(gdb) print discretelement::des_vel_new 
$1 = ((0, <repeats 200 times>, ...) ...)
(gdb) whatis 
type = real(kind=8), allocatable (4096,3)
(gdb) print discretelement::des_vel_old
$2 = <not allocated>
(gdb) whatis
type = real(kind=8), allocatable (:,:)

Thank you for your reply.
I observed that the Euler integration method does not allocate old values of velocity and position. So I am now trying to use the Adams-Bashforth. I also modified the code and it now compiles. But the simulation stops immediately I start it.
one_2024-01-25T065828.669626.zip (87.3 MB)

Running your case on Linux I get this nice popup:

Unfortunately, on the Windows platform there is no message. Debugging on Windows is always a bit less convenient than on Linux. I will try to figure out why there is no message, but I can’t guarantee anything… Is there a chance you can get your hands on a Linux system for this project?

Thank you for your quick response. There was a typo on my part on that line. The simulation is now running.
I work on only windows for now. I will try to see if I can get Linux as well.
If you are able to figure out why I did not get the error message on windows, please inform me. Thank you.

I note that if you build the windows solver in “batch” mode (enable “developer mode” under Settings in the main menu, or run build_mfixsolver --batch) then the “Fortran runtime error” is displayed. I am not sure why this fails with the “interactive” mode solver, but hope to fix this in a future release.

In fact it is not necessary to build the solver in “batch” mode. It is only necessary to run it ouside of the MFiX GUI. In your case,

(mfix-23.4) C:\tmp\one_2024-01-25>mfixsolver.bat  -c -f One.mfx

results in

At line 284 of file C:\tmp\one_2024-01-25\allocate_arrays.f
Fortran runtime error: Attempting to allocate already allocated variable 'rod_x'

I’m not sure why this message is not appearing when starting the job is started in the GUI.

1 Like

Okay. Thanks for providing alternate ways to compile. Now I know to use other ways of compilation when I encounter such problems in the future. Thank you!