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

UDF input parameter "unable to find rpvar"

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 4, 2019, 15:09
Default 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: 8
sergiocavaleirocosta is on a distinguished road
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)
}
Furthermore, I have defined both parameters "Bilete_temp_in" and "Bilete_dT" in the "input parameters for UDF" and when I print it I get:

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
 --------------------  --------------------  --------------------
I also write in TUI:

Code:
(rp-var-define ‘Bilete_dT 500.0 ‘real #f)
(rp-var-define ‘Bilete_temp_in 700.0 ‘real #f)
although when I initialize my case I get:

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'
And when I run I also get the error:

Code:

Error: WorkBench Error: Could not handle event: ParameterEvent
Error Object: #f
does anyone know why is this happening and how can I solve this issue?

Thank you all.
sergiocavaleirocosta is offline   Reply With Quote

Old   January 6, 2019, 23:07
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
type in fluent console following command to check, if the variable was created
Code:
(rpgetvar 'Bilete_dT)
Did you run your case in parallel regime?

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
AlexanderZ is offline   Reply With Quote

Old   March 7, 2019, 10:16
Default
  #3
New Member
 
luismsc's Avatar
 
Luis M Soria Castro
Join Date: May 2011
Location: Córdoba, Argentina
Posts: 1
Rep Power: 0
luismsc is on a distinguished road
Hi sergiocavaleirocosta,
What version of fluent are you using? Because I had a similar problem with the last version (v. 2019R1).

Regards, Luis
luismsc is offline   Reply With Quote

Old   March 15, 2019, 11:29
Default
  #4
New Member
 
Sérgio Cavaleiro Costa
Join Date: Nov 2017
Location: Lisbon, Portugal
Posts: 12
Rep Power: 8
sergiocavaleirocosta is on a distinguished road
Quote:
Originally Posted by luismsc View Post
Hi sergiocavaleirocosta,
What version of fluent are you using? Because I had a similar problem with the last version (v. 2019R1).

Regards, Luis
It's the 19.0 version.
Meanwhile, It got solved modeling both solid and fluid in the same SpaceClaim and the same meshing.
sergiocavaleirocosta is offline   Reply With Quote

Old   March 26, 2019, 07:57
Default
  #5
rfd
New Member
 
Join Date: Oct 2014
Posts: 1
Rep Power: 0
rfd is on a distinguished road
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")
rfd is offline   Reply With Quote

Reply

Tags
error, input parameters, rpvar, udf


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
Using output parameter as input parameter within the same simulation jjfm20 FLUENT 11 November 6, 2017 08:53
A UDF for mixture outlet variable derived from two other input parameters? ebtedaei FLUENT 0 July 12, 2017 02:17
Help! where to find full UDF Macros and functions kim FLUENT 6 March 5, 2014 09:01
Fluent UDF: Thru external input BS FLUENT 0 March 26, 2008 18:53
find the best inlet with udf Tuckbros FLUENT 0 May 20, 2004 12:56


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