Sinusoidal input of particles into model

I have a simple DEM model of particles falling into a rectangular container, where the particles fall at a constant rate. I want to change this so the particle input rate varies sinusoidally around a mean value. Is this possible to do in mfix?

1 Like

You should modify the PI_FACTOR(BCV_I) or the DEM_MI_TIME(BCV_I)
since the injection time of the particles is calculated as below.
! Update the time for seeding the next particle.
DEM_MI_TIME(BCV_I) = S_TIME + PI_FACTOR(BCV_I)*lDTSOLID

Thank you for your response.
I am struggling to find where to modify the numbers you suggested in mfix. Can you provide more information on where to find these?

The initialization routine computing how many particles to inject each timestep is in SUBROUTINE SET_BC_DEM_MI inside des/set_bc_dem_mi.f. If you spend time around here, you will understand the mechanism on how many particles to be injected each timestep is computed. i.e., PI_COUNT, PI_FACTOR, etc. However, this method assumes constant injection rate since these values are computed at the beginning of the simulation and assumed to be constant throughout simulation.

If you want to modify the injection rate, the actual injection is performed inside the subroutine MASS_INFLOW_DEM in des/mass_inflow_dem.f. You can adjust the varying inflow rate of particles in two ways by playing with either:

  1. PI_COUNT - i.e. Number of particles injected for each time step (or)
  2. as Yupeng said, by adjusting how frequently the particles are injected by modifying PI_FACTOR

Both can be done inside des/mass_inflow_dem.f.

You can hard code the changes in the above file or you can do your “modified” computations of PI_COUNT or PI_FACTOR inside des/usr1_des.f which is a user defined function to include user requests like yours.

Thank you for your response.
I understand what yourself and Yupeng are saying about how the inflow of particles is calculated and what controls this.

My question still remains, that I cannot find where to modify either the pi_count of pi_factor. You mention they are in SUBROUTINE SET_BC_DEM_MI, but is this in one of the tabs within mfix or do these have to be coded in directly? I have tried to search for these terms directly in mfix but still have no success. I am new to mfix and have only used the basics so far.

Which OS do you use? Are you downloading the mfix source files or are you doing a direct install using anaconda environment?

I am using Mac OS 10.1. I downloaded anaconda, and installed Mfix using the instructions on the download page.

I just want to make sure I am being clear with my question: can you give me a set of instructions on how to locate where to change the PI_count and PI_factor in mfix?

@onlyjus @YupengXu : I use code through terminal and I am not an expert in direct install methods which I think above user has done. Can you help @sgcgrif3 with finding above files in case of direct install?

To install mfix I used the following instructions:

So you should copy the fortran files you want to modify into the project directory, then compile the solver. The make scripts will prefer to use the files in the project directory. This way you can leave the original source files untouched.

To do this in the GUI, use the built in editor :slight_smile:

  1. Click the “editor” mode
  2. search for “usr1”
  3. select the “usr1_des.f”
  4. copy the “usr1_des.f” to the project directory
  5. make your changes to the source code
  6. compile
  7. run the model

2 Likes

Thank you, the screenshot was very helpful and now i understand how to modify files.

Above I was told I needed to modify PI_COUNT and PI_FACTOR in order to change the input rate of particles and that this could be done inside usr1_des.f which I can now access.

I can copy this file to make changes, however I do not understand why you have circled IMPLICIT NONE in the screenshot, or where exactly I modify the numbers to what I want. Please could anybody provide any more information?

Sorry, just add whatever code you want under IMPLICIT NONE