Ansys Learning Forum › Forums › Discuss Simulation › Fluids › Simulating DPM whose droplet material properties not available in database › Reply To: Simulating DPM whose droplet material properties not available in database
January 7, 2025 at 1:57 am
not.lah.enough
Subscriber
Decided to write a UDF to calculate the total injection mass. The incomplete code is given below. The equation to calculate P_FLOW_RATE(p) is still missing since I don't know how to call the total fluid flow from the injection surface (it is supposed to be P_FLOW_RATE(p) = (total fluid flow rate in surface) * 0.08). Note that the entrained fluid flow rate is a calculated parameter and not determined from the start.
Â
#include "udf.h"
#include "surf.h"
Â
DEFINE_DPM_INJECTION_INIT(am_droplet, I)
{
int count, i;
/* real area, mw[MAX_SPE_EQNS], yi[MAX_SPE_EQNS]; */
/* MAX_SPE_EQNS is an ANSYS FLUENT constant in materials.h */
Particle* p;
cell_t cell;
Thread* cthread;
Material* mix, * sp;
Message("Initializing Injection: %s\n", I->name);
loop(p, I->p) /* Standard ANSYS FLUENT Looping Macro to get particle streams in an Injection */
{
P_FLOW_RATE(p) = ; /* dunno how to call total flow rate of fluid in the surface on which the injection occurs, flow rate unit is kg/s */
}
}
Â
Â
Â
Â