TAGGED: fluent, user-defined-functions
- 
		
			- 
March 28, 2024 at 11:06 am15753433 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 pmLuca 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 pm15753433 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.
- 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
- Guidance needed for Conjugate Heat Transfer Analysis for a 3s3p Li-ion Battery
- Issue to compile a UDF in ANSYS Fluent
- JACOBI Convergence Issue in ANSYS AQWA
- affinity not set
- Resuming SAG Mill Simulation with New Particle Batch in Rocky
- 
                        
                        4167
- 
                        
                        1487
- 
                        
                        1363
- 
                        
                        1194
- 
                        
                        1021
© 2025 Copyright ANSYS, Inc. All rights reserved.
 You are navigating away from the AIS Discovery experience
You are navigating away from the AIS Discovery experience 
               
          