TAGGED: fluent, user-defined-functions
-
-
March 28, 2024 at 11:06 amEugene SadieSubscriber
Hi 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 pmLuca B.Forum Moderator
Hi, 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 pmEugene SadieSubscriber
Hi 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.
- Non-Intersected faces found for matching interface periodic-walls
- Unburnt Hydrocarbons contour in ANSYS FORTE for sector mesh
- Fluent fails with Intel MPI protocol on 2 nodes
- Help: About the expression of turbulent viscosity in Realizable k-e model
- Cyclone (Stairmand) simulation using RSM
- error udf
- Mass Conservation Issue in Methane Pyrolysis Shock Tube Simulation
- Script Error
- Facing trouble regarding setting up boundary conditions for SOEC Modeling
- UDF, Fluent: Access count of iterations for “Steady Statistics”
-
1416
-
599
-
591
-
565
-
366
© 2025 Copyright ANSYS, Inc. All rights reserved.