Overview
Attached is the source code for the Spray Heat Conduction with regular particles and Temperature Update, using version 3.3 of the EDEM API.
The source code consists of:
- CPU API code updated to version 3.3.
 - CUDA API code supplied as SprayConduction_v3_3_0.cu.
 
This model is a combined Contact Model and Particle Body Force model designed for temperature updates during particle-spray interactions.
The API implements:
- Equilibrium temperature calculation: When a spray particle impacts a solid particle, the equilibrium temperature T_eq is computed as:
 
    
        
            
    
Where m_s, c_s, T_s are mass, heat capacity, and temperature of the spray particle, and  m_p. c_p, T_p are those of the solid particle.
- Instantaneous temperature update: The solid particle temperature is updated immediately within a single time step based on the heat exchanged with the spray.
 - Both CPU and GPU (CUDA) implementations are provided and can be used interchangeably depending on hardware availability.
 
Usage Notes
✅ Spray definition
- The spray particle type must be named exactly "spray" (all lowercase).
 
✅ Physics setup
- The SprayConduction model must be defined under particle-particle physics and positioned above the SprayCoating model.
- This ensures the spray particle participates in heat conduction before it is removed by SprayCoating.
 
 - The SprayConduction model must also be included in particle body forces physics to handle temperature updates of solid particles.
 - Note: This model differs from TemperatureUpdate physics, which is intended for heat exchange between non-spray particles.
 
✅ Preferences file
- Particle names and their heat capacities must be defined in a text file named sprayConduction_prefs.txt located in the same directory as the library.
 
Build & Run
- The CPU API code should be compiled into a shared library (.dll, .so, or equivalent).
 - When running a simulation, if the .cu file is located in the same directory as the library, GPU acceleration will be enabled; otherwise, the model will run on the CPU only.
 
Pre-Requisite
For information about compiling EDEM API Models, please see:
    
        https://community.altair.com/csm?id=kb_article_view&sysparm_article=KB0037690
    
or the EDEM Help:
    
        https://2022.help.altair.com/2022.2/EDEM/Programming_Guide.htm
    
More EDEM and EDEM API Tutorials can be found here:
    
        https://community.altair.com/community?id=community_blog&sys_id=5e7dc459979de950e3b0361e6253afae
    
Sample Case
    
        
            
    
This sample case demonstrates the SprayConduction API applied to a simple setup involving:
- One solid particle with an initial temperature of 360 K.
 - Three spray particles are aligned along the same path, each with an initial temperature of 273 K.
 
As each spray particle impacts the solid particle:
- The solid particle’s temperature is updated instantly to the computed equilibrium temperature based on the mass and heat capacity of the solid and spray particles at that moment.
 - The spray particle is removed after contributing to the heat exchange.
 
This case illustrates the model’s ability to perform sequential temperature updates as multiple sprays impact the particle.