-
-
August 16, 2024 at 1:47 am
kiran.purushothamakeshavan
SubscriberI get this error when I use run simulation with this UDF:
#include "udf.h"#include "dpm.h"#include#define Rho_air 1.225#define mu 0.5#define PI 3.14#define VISC 1.7894e-05 // dynamic viscosity of air#define Rho_p 1550FILE *fp1;DEFINE_DPM_DRAG(particle_drag_force, Re, p){real b1, b2, b3, b4, Cd, drag_force, A, radius, df;real shf = 1;real nf, ff;Thread* tcell = P_CELL_THREAD(p);cell_t c = P_CELL(p);real relVel[ND_3], dvtdn, fluidVel[ND_3];// Fluid velocityNV_D(fluidVel, =, C_U(c, tcell), C_V(c, tcell), C_W(c, tcell)); // Assign fluid velocity components to vector// Relative velocityNV_VV(relVel, =, fluidVel, -, P_VEL(p)); // Calculate relative velocity of flow on particle by subtracting absolute particle velocity from fluid velocitydvtdn = NV_MAG(relVel); // Calculate relative velocity magnituderadius = P_DIAM(p) / 2.0;A = PI * radius * radius;b1 = exp(2.3288 - 6.4581 * shf + 2.4456 * pow(shf, 2));b2 = 0.0964 + 0.5565 * shf;b3 = exp(4.905 - 13.8944 * shf + 18.4222 * pow(shf, 2) - 10.2599 * pow(shf, 3));b4 = exp(1.4681 + 12.2584 * shf - 20.7322 * pow(shf, 2) + 15.8855 * pow(shf, 3));Cd = (24 * (1 + b1 * pow(Re, b2)) / Re) + (b3 * Re / (b4 + Re));// Store drag force and other quantities in UDMsdf = (1 / 2) * Rho_p * A * Cd * (dvtdn * dvtdn);// Store quantities in UDMsC_UDMI(c, tcell, 0) = df; // Store drag forceC_UDMI(c, tcell, 1) = dvtdn; // Store relative velocitynf = C_P(c, tcell) * A; // Calculate some quantity 'nf'C_UDMI(c, tcell, 2) = nf; // Store 'nf'ff = mu * nf; // Calculate some quantity 'ff'C_UDMI(c, tcell, 3) = ff; // Store 'ff'C_UDMI(c, tcell, 4) = C_P(c, tcell); // Store cell pressureP_USER_REAL(p, 0) = df;P_USER_REAL(p, 1) = dvtdn;P_USER_REAL(p, 2) = nf;P_USER_REAL(p, 3) = ff;P_USER_REAL(p, 4) = C_P(c, tcell);fp1=fopen ("Impact1.txt" , "a") ;fprintf( fp1 , "%f %f %f %f %f\n", P_USER_REAL(p, 0), P_USER_REAL(p, 1), P_USER_REAL(p, 2), P_USER_REAL(p, 3), P_USER_REAL(p, 4));fclose(fp1);// Calculate drag forcedrag_force = (18 * Cd * Re) / 24; // is this taking the reynolds number of the particle or the flow?return drag_force;}Can you please tell me what this error is??Thanks,
Kiran -
October 15, 2024 at 3:09 pm
Rob
Forum ModeratorWere there any compilation warnings? I'm not going to debug code.
-
Viewing 1 reply thread
- You must be logged in to reply to this topic.
Innovation Space
Trending discussions
- air flow in and out of computer case
- Varying Bond model parameters to mimic soil particle cohesion/stiction
- Eroded Mass due to Erosion of Soil Particles by Fluids
- I am doing a corona simulation. But particles are not spreading.
- Centrifugal Fan Analysis for Determination of Characteristic Curve
- Issue to compile a UDF in ANSYS Fluent
- Guidance needed for Conjugate Heat Transfer Analysis for a 3s3p Li-ion Battery
- JACOBI Convergence Issue in ANSYS AQWA
- affinity not set
- Resuming SAG Mill Simulation with New Particle Batch in Rocky
Top Contributors
-
4167
-
1487
-
1363
-
1194
-
1021
Top Rated Tags
© 2025 Copyright ANSYS, Inc. All rights reserved.
Ansys does not support the usage of unauthorized Ansys software. Please visit www.ansys.com to obtain an official distribution.