TAGGED: fluent, user-defined-functions
-
-
March 28, 2024 at 11:06 am
15753433
SubscriberHi everyone,
I am trying to upload a User Defined Function to Ansys and it gives me the following error:
line 18: invalid type for binary expression: int + pointer to structure.
Here is the code that I am trying use:
#include"udf.h"
DEFINE_PROPERTY(moving_wall, thread, u)
{
/* Declare variables */
float t, speed;
face_t f;
/* Get time */
t = RP_Get_Real("flow-time");
/* Calculate speed */
speed = 1.6 * sin(3.8 * t);
/* Apply speed to face */
begin_f_loop(f, thread)
{
F_PROFILE(f, thread, u) = speed;
}
end_f_loop(f, thread)
}
*PS - I am new to Ansys and coding so please dont use any shorthand explanations, if possible.
Thank you! -
April 8, 2024 at 12:50 pm
Luca B.
Forum ModeratorHi, i can try to help you. what is line 18? there is not numbering.
anyway it seems you are combining differt type of variable, can you debug and identify the wrong command line?Â
Â
Thanks
Luca
Â
-
April 8, 2024 at 4:51 pm
15753433
SubscriberHi Luca,
Â
Thank you for the response.
Â
I tried to copy and paste the code from a PDF, originally. And it didnt want to work. I eventually typed out the code over from scratch, and then it worked fine!
-
- The topic ‘User Defined Function Error – Invalid type for binary expression’ is closed to new replies.
- How do I get my hands on Ansys Rocky DEM
- Unburnt Hydrocarbons contour in ANSYS FORTE for sector mesh
- convergence issue for transonic flow
- Facing trouble regarding setting up boundary conditions for SOEC Modeling
- Point exception in erosion calculation
- Script Error Ansys
- Errors with multi-connected bodies using AQWA
-
2612
-
938
-
812
-
599
-
591
© 2025 Copyright ANSYS, Inc. All rights reserved.