|
[Sponsors] |
User Defined Function Error - Invalid type for binary expression |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
March 28, 2024, 06:30 |
User Defined Function Error - Invalid type for binary expression
|
#1 |
New Member
Eugene Sadie
Join Date: Mar 2024
Posts: 2
Rep Power: 0 |
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! |
|
March 29, 2024, 07:54 |
Fix
|
#2 |
New Member
Eugene Sadie
Join Date: Mar 2024
Posts: 2
Rep Power: 0 |
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... |
|
Tags |
user defined function |
|
|
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 03:23 |
Openfoam Turbulent Car Simulation | meganrw | OpenFOAM Running, Solving & CFD | 0 | July 5, 2021 16:50 |
rSF: p divergence in combustor (wt negative value) | zonda | OpenFOAM Pre-Processing | 4 | April 10, 2018 07:59 |
Divergent temperature in chtMultiRegion(Simple)Foam | akrasemann | OpenFOAM Running, Solving & CFD | 13 | March 24, 2014 03:54 |
Error during initialization of "rhoSimpleFoam" | kornickel | OpenFOAM Running, Solving & CFD | 8 | September 17, 2013 06:37 |