-
-
April 19, 2024 at 10:57 am
Paul Richter
SubscriberHello,
i am doing a transient simulation with a DPM Injection.
I want the injection not to be constant but to be a function of the simulation time (for example t^2).
I think that the only way to implement that is with a UDF, i came up with this Code, but it is not working at all:
#include "udf.h"
DEFINE_DPM_SOURCE(dpm_mass_flow, c, t, initialize, p)
{
real time = CURRENT_TIME;
real mass_flow_rate;mass_flow_rate = time * time;
return mass_flow_rate;
}My questions are:
1) Is there an easier way to achieve a total flow rate of t^2
2) If not do you know a better option for a UDF Code?
Thanks in advance
-
April 19, 2024 at 12:05 pm
Rob
Forum ModeratorHave a look at DEFINE_DPM_INJECTION_INIT
-
April 19, 2024 at 12:15 pm
Paul Richter
SubscriberDear Rob,
first of all thanks for your reply!
Yes i came up with this too, i made the Code:
#include "udf.h"
DEFINE_DPM_INJECTION_INIT(init,I)
{
Particle *p;
real time = CURRENT_TIME;
real P_FLOW_RATE;
// Einstellung der Partikelmasse
P_FLOW_RATE(p) = time * time;
}But i get the Error "P_FLOW_RATE: no function prototype"
-
April 19, 2024 at 12:22 pm
Rob
Forum ModeratorWhich manual are you reading?
-
April 19, 2024 at 12:27 pm
Paul Richter
SubscriberANSYS FLUENT 12.0 UDF - edit Rob to comply with copyright
-
April 19, 2024 at 1:16 pm
Rob
Forum ModeratorThat'll explain it. Use the documentation that comes with the software (click on Help). You're using the old form of the macro.
-
- The topic ‘DPM Particle Injection Total Flow Rate as a function of time’ is closed to new replies.
-
3492
-
1057
-
1051
-
965
-
942
© 2025 Copyright ANSYS, Inc. All rights reserved.