-
-
March 23, 2021 at 3:30 pm
rmoss06
SubscriberHi,
I am trying to simulate a Electrostatic Precipitator in Fluent. I have my PM10 injection flowing through my mesh, and my last step is to create a UDF which simulates an electric force acting on the particles. I modified the magnetic force code from the Ansys UDF manual as follows, below, then I place the c file in the folder with my project files, interpret the UDF, select it from the dropdown under UDF in my PM injection, initialize and calculate. During the iteration, I get the following error: chip-exec: electric_force: wrong return type: void udf function expectednumber tracked = 19, escaped = 19
I'm very new to using UDFs so I was wondering if anyone my be able to point me in the right direction as to where I went wrong.
Thanks
/* UDF for computing the electric force on a charged particle */
#include "udf.h"
#define Q 7.0 /* particle electric charge */
#define E 3.0 /* electric field magnitude */
#define TSTART 0 /* field applied at t = tstart */
/* Calculate electric force on charged particle. */
/* velocity with electric field: Fx= q*bz*Vy, Fy= -q*bz*Vx */
DEFINE_DPM_BODY_FORCE(electric_force, p, i)
{
real bforce[ND_ND] = 0;
if (P_TIME(p) >= TSTART)
{
if (i == 0) bforce[i] = Q * E*P_VEL(p)[0];
else if (i == 1) bforce[i] = -Q * E*P_VEL(p)[1];
}
else
bforce[i] = 0.0;
/* an acceleration should be returned */
return (bforce[i] / P_MASS(p));
}
March 23, 2021 at 4:18 pmYasserSelima
Subscribertry this ..
#include "udf.h"
#define Q 7.0/* particle electric charge*/
#define E 3.0/* electric field magnitude */
#define TSTART 0/* field applied at t = tstart*/
DEFINE_DPM_BODY_FORCE(electric_force, p, i)
{
real bforce = 0;
if (P_TIME(p) >= TSTART)
{
if (i == 0) {
bforce = Q * E*P_VEL(p)[0];
} else if (i == 1) {
bforce = -Q * E*P_VEL(p)[1];
} else {
bforce = 0.0;
}
}
/* an acceleration should be returned */
return (bforce / P_MASS(p));
}
Let me know if you are still getting the same error
March 23, 2021 at 4:35 pmrmoss06
SubscriberThanks Yasser, thatÔÇÖs seemed to work. I can compile it now and apply it as a body force, the body force doesnÔÇÖt seem to be affecting my particle motion at all, but at least this is a big step forwards, appreciate it!
March 23, 2021 at 4:52 pmRob
Ansys EmployeeContinues here to work out why the particles aren't doing anything!
https://forum.ansys.com/discussion/26079/body-force-not-affecting-particle-motion#latest
Viewing 3 reply threads- You must be logged in to reply to this topic.
Ansys Innovation SpaceEarth Rescue – An Ansys Online Series
The climate crisis is here. But so is the human ingenuity to fight it. Earth Rescue reveals what visionary companies are doing today to engineer radical new ideas in the fight against climate change. Click here to watch the first episode.
Ansys Blog
Subscribe to the Ansys Blog to get great new content about the power of simulation delivered right to your email on a weekly basis. With content from Ansys experts, partners and customers you will learn about product development advances, thought leadership and trends and tips to better use Ansys tools. Sign up here.
Trending discussions- Suppress Fluent to open with GUI while performing in journal file
- Floating point exception in Fluent
- What are the differences between CFX and Fluent?
- Heat transfer coefficient
- Getting graph and tabular data from result in workbench mechanical
- The solver failed with a non-zero exit code of : 2
- Difference between K-epsilon and K-omega Turbulence Model
- Time Step Size and Courant Number
- Mesh Interfaces in ANSYS FLUENT
- error in cfd post
Top Contributors-
2524
-
2066
-
1279
-
1096
-
457
Top Rated Tags© 2023 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.
-