|
[Sponsors] |
January 4, 2019, 16:09 |
UDF input parameter "unable to find rpvar"
|
#1 |
New Member
Sérgio Cavaleiro Costa
Join Date: Nov 2017
Location: Lisbon, Portugal
Posts: 12
Rep Power: 9 |
Hi folks,
I am trying to create a temperature wall boundary condition that varies in the x-axis. To achieve this, I have programmed the UDF: Code:
#include "udf.h" DEFINE_PROFILE(temp_wall, t, i) { real x[ND_ND]; /* This will hold the position vector */ face_t f; /* Index for each face on the boundary */ real x0=0.1; real x1=0.9; real dx = (x1-x0); real T0=RP_Get_Float("Bilete_temp_in"); real T1=T0 + RP_Get_Float("Bilete_dT"); /* Loop over all faces of the boundary */ Thread *th; begin_f_loop(f,t) { F_CENTROID(x, f, t); /* Get the Global coordinates of the face*/ /* Calculate the temperature and assign to boundary */ F_PROFILE(f,t,i) = (T1-T0)/dx * x[0] + T0; } end_f_loop(f,t) } Code:
Input parameters available in udf side: -------------------- -------------------- -------------------- parameter-name current-value id-to-be-used-in-udf -------------------- -------------------- -------------------- "Bilete_dT" 105.73 real-16 "Bilete_temp_in" 616. real-15 -------------------- -------------------- -------------------- Code:
(rp-var-define ‘Bilete_dT 500.0 ‘real #f) (rp-var-define ‘Bilete_temp_in 700.0 ‘real #f) Code:
Hybrid initialization is done. 0: unable to find rpvar 'Bilete_dT' 1: unable to find rpvar 'Bilete_dT' 2: unable to find rpvar 'Bilete_dT' 3: unable to find rpvar 'Bilete_dT' 4: unable to find rpvar 'Bilete_dT' 5: unable to find rpvar 'Bilete_dT' 0: unable to find rpvar 'Bilete_temp_in' 1: unable to find rpvar 'Bilete_temp_in' 2: unable to find rpvar 'Bilete_temp_in' 3: unable to find rpvar 'Bilete_temp_in' 4: unable to find rpvar 'Bilete_temp_in' 5: unable to find rpvar 'Bilete_temp_in' Code:
Error: WorkBench Error: Could not handle event: ParameterEvent Error Object: #f Thank you all. |
|
January 7, 2019, 00:07 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
type in fluent console following command to check, if the variable was created
Code:
(rpgetvar 'Bilete_dT) For parallel computation things become more complicated, you should read rpvar variable on HOST, than transfer it's value to NODES. For more information about it read Ansys Fluent Customization manual, Parallel Considerations chapter best regards |
|
March 7, 2019, 11:16 |
|
#3 |
New Member
Luis M Soria Castro
Join Date: May 2011
Location: Córdoba, Argentina
Posts: 1
Rep Power: 0 |
Hi sergiocavaleirocosta,
What version of fluent are you using? Because I had a similar problem with the last version (v. 2019R1). Regards, Luis |
|
March 15, 2019, 12:29 |
|
#4 | |
New Member
Sérgio Cavaleiro Costa
Join Date: Nov 2017
Location: Lisbon, Portugal
Posts: 12
Rep Power: 9 |
Quote:
Meanwhile, It got solved modeling both solid and fluid in the same SpaceClaim and the same meshing. |
||
March 26, 2019, 08:57 |
|
#5 |
New Member
Join Date: Oct 2014
Posts: 1
Rep Power: 0 |
I had similar problem. Try define in scheme variable as real (not double) example: (make-new-rpvar 'x_var 12.563 'real) and don't use capital letter in UDF RP functions example: RP_Get_Float("Bilete_temp_in")->RP_Get_Float("bilete_temp_in")
|
|
Tags |
error, input parameters, rpvar, udf |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Using output parameter as input parameter within the same simulation | jjfm20 | FLUENT | 11 | November 6, 2017 09:53 |
A UDF for mixture outlet variable derived from two other input parameters? | ebtedaei | FLUENT | 0 | July 12, 2017 03:17 |
Help! where to find full UDF Macros and functions | kim | FLUENT | 6 | March 5, 2014 10:01 |
Fluent UDF: Thru external input | BS | FLUENT | 0 | March 26, 2008 19:53 |
find the best inlet with udf | Tuckbros | FLUENT | 0 | May 20, 2004 13:56 |