CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

User Defined Function Error - Invalid type for binary expression

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 28, 2024, 05:30
Default User Defined Function Error - Invalid type for binary expression
  #1
New Member
 
Eugene Sadie
Join Date: Mar 2024
Posts: 2
Rep Power: 0
EugeneS is on a distinguished road
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!
EugeneS is offline   Reply With Quote

Old   March 29, 2024, 06:54
Default Fix
  #2
New Member
 
Eugene Sadie
Join Date: Mar 2024
Posts: 2
Rep Power: 0
EugeneS is on a distinguished road
Not exactly sure how, but I managed to fix the problem.

The code that didnt want to work was copied from a PDF.

I typed the code over from scratch in text pad and it worked fine when I imported it into Ansys...
EugeneS is offline   Reply With Quote

Reply

Tags
user defined function


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
convergence problem of steady 2D film cooling calculation using chtMultiRegionFoam ruanyg968tf OpenFOAM Running, Solving & CFD 1 April 10, 2024 02:23
Openfoam Turbulent Car Simulation meganrw OpenFOAM Running, Solving & CFD 0 July 5, 2021 15:50
rSF: p divergence in combustor (wt negative value) zonda OpenFOAM Pre-Processing 4 April 10, 2018 06:59
Divergent temperature in chtMultiRegion(Simple)Foam akrasemann OpenFOAM Running, Solving & CFD 13 March 24, 2014 02:54
Error during initialization of "rhoSimpleFoam" kornickel OpenFOAM Running, Solving & CFD 8 September 17, 2013 05:37


All times are GMT -4. The time now is 16:17.