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

UDF error unbound variable

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 6, 2023, 17:27
Default UDF error unbound variable
  #1
New Member
 
sufiyan
Join Date: Mar 2023
Posts: 1
Rep Power: 0
mdsufiyan is on a distinguished road
#include "udf.h"
#include "math.h"
#include

static real v_prev_y = 0.0;

DEFINE_CG_MOTION(flapping, dt, vel, omega, time, dtime)
{

Thread* t;
Domain* d;
FILE* fp;


real cg[3]; real force[3]; real moment[3];


real accl_y;
real dv_y;

real ured = 10;

real mass_y = 164.02;
real eta = 0.0001;
real ro = 1.0;

real c_y = 0.154;
real k_y = 16.09;

int i;
NV_S(vel, =, 0.0);

t = DT_THREAD(dt);
d = Get_Domain(1);

for (i = 0; i < 3; i++)
{
cg[1] = DT_CG(dt)[1];

Compute_Force_And_Moment(d, t, cg, force, moment, TRUE);

force[1] += -k_y * cg[1] - c_y * vel[1];


accl_y = force[1] / mass_y;


dv_y = accl_y * dtime;


v_prev_y += dv_y;


vel[1] = v_prev_y;
}

}

--------------------------------------------------------------------------------------------------------------------------------------------------

hello everyone,
I am trying to run a udf and it gives me the error as shown below not sure y. The UDF on top works the one at the bottom dosent. I already refined my mesh again and also reduced my convergence criteria to .1 and the time step to 0.001. however this didnt help.

the case is laminar, transient and set to SIMPLE.

I really need help asap thank you.



---------------------------------------------------------------------------------------------------------------------------------------------------
#include "udf.h"
#include "math.h"
#include

static real v_prev_y = 0.0;

DEFINE_CG_MOTION(flapping, dt, vel, omega, time, dtime)
{

#if !RP_HOST

Thread *t;
Domain *d;
FILE *fp;


real cg[3]; real force[3]; real moment[3];


real accl_y;
real dv_y;

real voltage;

real ured = 10;

real mass_y = 164.02;
real eta = 0.0001;
real ro = 1.0;

real c_y = 0.154;
real k_y = 16.09;

int i;
NV_S(vel, =, 0.0);

t = DT_THREAD(dt);
d = Get_Domain(1);

for (i = 0; i < 3; i++)

{
cg[1] = DT_CG(dt)[1];

Compute_Force_And_Moment(d, t, cg, force, moment, TRUE);

force[1] += -k_y * cg[1] - c_y * vel[1];


accl_y = force[1] / mass_y;


dv_y = accl_y * dtime;


v_prev_y += dv_y;


vel[1] = v_prev_y;

voltage = ((101.3 * accl_y) + (0.13 * vel[1]) + (39.5 * vel[1] * time));


#if !RP_HOST

fp = fopen ( "data.txt", "a");

fprintf (fp, "%g %g %g %g \n ", time, cg[1], vel[1], voltage );

fclose (fp);

#endif
}

#endif

}
------------------------------------------------------------------------------------------------------------------------------------------------------
Error: eval: unbound variable
Error Object:
Registering UdfSource, ("C:/Users/gheewale/Downloads/New folder20mm/New folder/PassiveplungingUDF.cpp")
Registering Udflib, ("C:/Users/gheewale/Downloads/New folder20mm/New folder/20_files/dp0/FLU/Fluent/libudf")

Error: eval: unbound variable
Error Object:
mdsufiyan is offline   Reply With Quote

Reply

Tags
udf unbound variable


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
Unhandled variable DPM-dist mahesh248f1 FLUENT 4 July 15, 2021 11:50
Passing weber variable through UDF Ahamed CONVERGE 1 May 22, 2020 09:02
UDF error_ undeclared variable panos_metal21 Fluent UDF and Scheme Programming 6 December 19, 2019 01:44
udf for variable cp B.Hamada Fluent UDF and Scheme Programming 2 April 22, 2015 15:20
UDF: exporting a variable between two DEFINE function Carlo FLUENT 3 August 19, 2009 13:21


All times are GMT -4. The time now is 14:35.