# ACU-T: 6106 AcuSolve - EDEM Bidirectional Coupling with Mass Transfer

## Prerequisites

This tutorial introduces you to the workflow for setting up and running a basic AcuSolve-EDEM bidirectional coupling simulation with mass transfer. Prior to starting this tutorial, you should have already run through the introductory HyperWorks tutorial, ACU-T: 1000 HyperWorks UI Introduction and ACU-T: 6100 Particle Separation in a Windshifter using Altair EDEM, and have a basic understanding of HyperWorks CFD, AcuSolve, and EDEM. To run this simulation, you will need access to a licensed version of HyperWorks CFD, AcuSolve, and EDEM.

Prior to running through this tutorial, click here to download the tutorial models. Extract the files from the folder named ACU6106_EDEM_MassTransfer located in HyperWorksCFD_tutorial_inputs.zip.

## Problem Description

The problem to be solved is shown schematically in the figure below. The model consists of a box filled with hot air at a temperature of 363 K. Spray particles are injected onto a row of tablets located at the center of the box. The spray particles are modeled as solid particles in EDEM with the properties set to that of water. Although the spray particles are modeled as solid particles, their interaction with tablet particles is computed using a custom API. When a spray particle collides with a tablet particle, the volume of the spray is added to the tablet and the spray particle is removed from further calculations. The amount of volume transferred from the spray to the tablet can be monitored using a quantity called ‘VolumeAdded’. Using this quantity one can track the coating received by each particle.

By activating heat transfer and coupling with AcuSolve, this API can also be used to simulate the drying process of tablets. Using coupled heat and mass transfer, the amount of coating that has evaporated can be tracked. In this tutorial, a simple tablet coating and drying process is simulated where spray particles are injected from t=0 to t=0.25 seconds. As the spray particles interact with the tablet particles, the particles in the center receive a certain amount of coating. The spray injection is stopped at t=0.25s and the tablets are allowed to dry for the next 0.25 seconds. As the time progresses, you will observe that the coating evaporates gradually and the ‘AddedVolume’ decreases.

## Part 1 - EDEM Simulation

Start Altair EDEM from the Windows start menu by clicking Start > Altair 2022.1 > EDEM 2022.1 .

## Open the EDEM Input Deck

1. Click File > Open on the menu bar.
2. In the dialog, browse to your problem directory and open the tablet.dem file.
The geometry and the materials are loaded.

## Review the Bulk Material and Particle Shape

1. Right-click in the Creator Tree and select Expand All.
2. Under Bulk Material, click spray and verify that the properties are set as shown below.
3. Click Properties under spray. Verify that the particle radius is set to 0.0001 m.
4. Click the tablet bulk material and verify that the properties are set as shown below.
5. Click Properties under tablet and review the tablet shape.

## Set the Physics Models

1. In the Creator Tree, click Physics.
2. Set the Interaction to Particle to Particle then click Edit Contact Chain.
3. In the dialog, activate the checkbox for the spray_example plug-in model. Set the Base and Friction models as shown in the figure below and click OK.
Note: If you do not see the spray_example plug-in model, please make sure that you place the spray_example.dll (for Windows) and spray_example.so (for Linux) files in the problem directory.
4. In the Creator Tree, change the interaction to Particle to Geometry then click Edit Contact Chain.
5. In the dialog, set the same parameters as above then click OK.
6. In the Creator Tree, change the interaction to Particle Body Force then click Edit Contact Chain.
7. In the dialog, activate the checkboxes for Temperature Update and spray_example then click OK.
8. In the Creator Tree, select Temperature Update then click .
9. Set the specific heat capacity of tablet and spray to 1200 and 4000 J/kg-K, respectively, then click OK.
10. Save the model.

## Define Geometries and Factories

1. Under Geometries, click box and verify that the type is set to Virtual.
2. Right-click on box and select Add Factory.
3. Right click on New Factory 1 and select Change Factory Type.
4. Verify that the Factory Type is set to static and set the particle generation parameters as shown in the figure below. Make sure that the Material/Meta-Particle is set to tablet.
5. Under Parameters, set the Position option to cubic then click .
6. In the dialog, enter the position parameters as shown in the figure below then click OK.
This creates a row of tablet particles spaced evenly along the y-axis and located at the center of the box.
7. Similarly, click next to the Temperature setting, set the particle temperature to 350 K, then click OK.
8. Under Geometries, click spray then change the type to Virtual.
9. Right-click on spray and select Add Factory.
10. Set the particle generation parameters as shown in the figure below. Set the Material to spray.
11. Under Parameters, set the Velocity option to spray then click .
12. In the dialog, set the spray velocity parameters as shown in the figure below then click OK.
13. Similarly, click next to the Temperature setting, set the particle temperature to 350 K, then click OK.
14. Save the model.

## Define the Simulation Settings

1. Click in the top-left corner to go to the EDEM Simulator tab.
2. In the Simulator Settings tab, set the Time Integration scheme to Euler and de-activate the Auto Time Step checkbox.
3. Set the Fixed Time Step to 1e-5 s.
Note: Generally, a value of 20-40% of the Rayleigh Time Step is recommended as the time step size to ensure stability of the DEM simulation.
4. Set the Total Time to 0.5 s and the Target Save Interval to 0.01 s.
5. Set the Cell Size to 50 R min.
6. Set the Selected Engine to CPU Solver and set the Number of CPU Cores based on availability.
7. Once the simulation settings have been defined, save the model.

## Start HyperWorks CFD and Open the HyperMesh Database

1. Start HyperWorks CFD from the Windows Start menu by clicking Start > Altair <version> > HyperWorks CFD.
2. From the Home tools, Files tool group, click the Open Model tool.
The Open File dialog opens.
3. Browse to the directory where you saved the model file. Select the HyperMesh file ACU-T6106_tablet.hm and click Open.

## Validate the Geometry

The Validate tool scans through the entire model, performs checks on the surfaces and solids, and flags any defects in the geometry, such as free edges, closed shells, intersections, duplicates, and slivers.

To focus on the physics part of the simulation, this tutorial input file contains geometry which has already been validated. Observe that a blue check mark appears on the top-left corner of the Validate icon on the Geometry ribbon. This indicates that the geometry is valid, and you can go to the flow set up.

## Set Up Flow

### Set the General Simulation Parameters

1. From the Flow ribbon, click the Physics tool.
The Setup dialog opens.
2. Under the Physics models setting, select the Multiphase flow radio button.
3. Change the Multifluid type to Bidirectional EDEM Coupling.
4. Set Time step size and Final time to 0.001 and 0.5, respectively. Select Spalart-Allmaras for the Turbulence model.
5. Set the Pressure scale to Absolute.
6. Activate Heat transfer and set the Temperature scale to Absolute.
7. Set the Number of passive species to 1.
8. Click the Solver controls setting. Set the Minimum and Maximum stagger iterations to 0 and 2, respectively.
9. Close the dialog and save the model.

### Assign Material Properties

1. From the Flow ribbon, click the Material tool.
2. Verify that Air-EDEM Particle – 2way has been assigned as the material.
If not assigned, click the box geometry and select Air-EDEM Particle – 2way from the microdialog.
3. On the guide bar, click to exit the tool.

## Generate the Mesh

1. From the Mesh ribbon, click the Volume tool.
The Meshing Operations dialog opens.
2. Set the Mesh size to Average size and change the Maximum element size to 0.005.
3. Deactivate Curvature-based surface refinement then click Mesh.
4. Once the meshing process is complete, save the model.

## Define Nodal Outputs

Once the meshing is complete, you are automatically taken to the Solution ribbon.

1. From the Solution ribbon, click the Field tool.
The Field Output dialog opens.
2. Check the box for Write initial conditions.
3. Uncheck the box for Write results at time step interval
4. Check the box for Write results at time interval.
5. Set the Time step interval to 0.01.
6. Close the dialog and save the model.

## Submit the Coupled Simulation

1. Start the coupling server by clicking Coupling Server in EDEM.
Once the Coupling server is activated, the icon changes.
3. From the Solution ribbon, click the Run tool.
The Launch AcuSolve dialog opens.
4. Set the Parallel processing option to Intel MPI.
5. Set the Number of processors to 6.
6. Expand Default initial conditions, uncheck Pre-compute flow and set the velocity values to 0. Uncheck Pre-compute Turbulence.
7. Set the Temperature to 363 K.
8. Click Run to launch AcuSolve.
Once the AcuSolve run is launched, the Run Status dialog opens.
9. In the dialog, right-click on the AcuSolve run and select View log file.
If the coupling with EDEM is successful, that information is printed in the log file.
Once the simulation is complete, the summary of the run time is printed at the end of the log file.

## Post-Process the Results with EDEM

1. Once the EDEM simulation is complete, click in the top-left corner to go to the EDEM Analyst tab.
2. In the Analyst Tree, expand Display > Geometries and then select box.
3. Verify that the Display Mode is set to Filled and set the Opacity to 0.2.
4. In the Analyst Tree, click Particles.
5. Set the coloring to VolumeAdded.
6. Activate the Auto Update checkbox for both Min and Max Value.
7. Activate the Show Legend checkbox.
8. Click Apply All.
9. On the menu bar, set the time to 0 by clicking:
10. Set the View plane to Default.
11. In the Viewer window, set the Playback Speed to 0.1x and then click to play the particle flow animation.

Observe that the added volume increases in the beginning as the tablets receive the spray coating. Once the spray injection is stopped, the coating starts to dry up and the added volume decreases gradually.

## Summary

In this tutorial, you have learned how to set up and run a basic AcuSolve-EDEM bidirectional (two-way) coupling problem with mass transfer. You learned how to create particles with specific position and internal spacing and also learned how to define a spray injection. Once the simulation was completed, you processed the results to view the coating variation over time.