|
[Sponsors] |
March 24, 2022, 16:51 |
I'm having problems with my UDF code
|
#1 |
New Member
Sergio Andres Correa Zea
Join Date: Feb 2022
Posts: 2
Rep Power: 0 |
I'm having problems with my UDF code and I'm getting an error saying "non-integer subscript expression: function returning void". The error appears in this line "C_UDMI(c,t,q_ads) = (C_UDSI_M1(c,t,q_ads))+(0.15)dt((C_UDSI_M1(c,t,ads ))-(C_UDSI_M1(c,t,q_ads)));"
Code:
DEFINE_ADJUST(q_ads, domain) { Thread *t; cell_t c; real dt; thread_loop_c (t,domain) { begin_c_loop (c,t) { dt = RP_Get_Real("physical-time-step"); C_UDMI(c,t,q_ads) = (C_UDSI_M1(c,t,q_ads))+(0.15)dt((C_UDSI_M1(c,t,ads))-(C_UDSI_M1(c,t,q_ads))); /*Este seria el LDF que esta de la forma dn/dt=k(n*-n) pero como se necesita para varias iteraciones quedaria Ni= N(i-1) + k(N*_(i-1)-N_(i-1))(t_(i)-t_(i-1)) El valor de K es igual a K= 0.15 (1/s)*/ /*El termino 0.9 es el dato en equilibrio y el dato de C_UDSI_M1(c,t,q_ads) es el dato que varia en el tiempo averiguar en UDF la concentraciأłn molar!!!*/ } end_c_loop (c,t) } } |
|
March 31, 2022, 23:45 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
Code:
#include "udf.h" DEFINE_ADJUST(q_ads2, domain) { Thread *t; cell_t c; real dt; dt = RP_Get_Real("physical-time-step"); thread_loop_c (t,domain) { begin_c_loop (c,t) { C_UDMI(c,t,0) = (C_UDSI_M1(c,t,0))+(0.15)*dt*((C_UDSI_M1(c,t,1))-(C_UDSI_M1(c,t,0))); /*Este seria el LDF que esta de la forma dn/dt=k(n*-n) pero como se necesita para varias iteraciones quedaria Ni= N(i-1) + k(N*_(i-1)-N_(i-1))(t_(i)-t_(i-1)) El valor de K es igual a K= 0.15 (1/s)*/ /*El termino 0.9 es el dato en equilibrio y el dato de C_UDSI_M1(c,t,0) es el dato que varia en el tiempo averiguar en UDF la concentraciأłn molar!!!*/ } end_c_loop (c,t) } } q_ads and ads are just names to make it readable, but inside they are integers
__________________
best regards ****************************** press LIKE if this message was helpful |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
vibration UDF problems | jingguo | Fluent UDF and Scheme Programming | 3 | September 14, 2017 03:27 |
[FLUENT] Loading UDF function problems | Faggio11 | FLUENT | 0 | August 9, 2016 07:33 |
Problems in the UDF for DPM erosion | Messi | Fluent UDF and Scheme Programming | 0 | January 23, 2014 06:29 |
UDF code for concentration distribution | szw_china | Fluent UDF and Scheme Programming | 0 | July 22, 2012 22:35 |
UDF code | yahya_azizi | Fluent UDF and Scheme Programming | 1 | July 16, 2012 11:50 |