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

RP_Get_List_Ref_Real exists?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 4, 2018, 12:12
Default RP_Get_List_Ref_Real exists?
  #1
New Member
 
DS
Join Date: May 2016
Posts: 28
Rep Power: 10
denis.sanga@hotmail.it is on a distinguished road
Goodmorning,
I'm writing an UDF where I need to read and modify the value store in a rp real list created as follow:

Code:
(make-new-rpvar 'average_list '() 'real-list) 
(rpsetvar 'average_list ())
(rpsetvar 'average_list (list-add(rpgetvar 'average_list) 1.1))
(rpsetvar 'average_list (list-add(rpgetvar 'average_list) 2.2))
(rpsetvar 'average_list (list-add(rpgetvar 'average_list) 3.3))
(rpgetvar 'average_list )
I tried to use
Code:
RP_Get_List_Ref_Real("average_list",0)
and
Code:
RP_Set_List_Ref_Real("average_list",0)
, but doesn't work.
Can someone help me to solve this problem?
Thank you really much
Best regards
Denis
denis.sanga@hotmail.it is offline   Reply With Quote

Old   May 5, 2018, 19:40
Default
  #2
Senior Member
 
Join Date: Sep 2017
Posts: 246
Rep Power: 12
obscureed is on a distinguished road
Hi Denis,

Please could you post the UDF code that does not work?

We know from the Fluent header file var.h that the function you mentioned should exist -- here it is (unless it has changed in recent versions):
Code:
FLUENT_EXPORT double RP_Get_List_Ref_Float(char *s, int n);
While we're in var.h, here are some useful functions:
Code:
FLUENT_EXPORT cxboolean RP_Variable_Exists_P(char *s);
FLUENT_EXPORT int RP_Get_List_Length(char *s);
FLUENT_EXPORT void RP_Set_List_of_Float(char *s, double *a, int length);
So I'm expecting something like:
Code:
#include "udf.h"
DEFINE_ON_DEMAND(read0)
{
  double value0;
  value0 = RP_Get_List_Ref_Float("average_list",0);
  Message0("value0 from average_list = %16.8g\n",value0);
}
DEFINE_ON_DEMAND(set4)
{
  double my_array[] = {0.,111.,222.,333.};
  int len_my_array;
  len_my_array = sizeof(my_array)/sizeof(my_array[0]);
  RP_Set_List_of_Float("average_list",my_array,len_my_array);
}
Sorry, I've written this without checking that it works.
Good luck!
Ed
obscureed is offline   Reply With Quote

Reply

Tags
rp_get_list_ref_real


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
Cell_Function_Values: No post-processing value exists. jypark FLUENT 4 November 18, 2020 03:40
Cell_Function_Values: No post-processing value exists lixinjun Main CFD Forum 0 December 13, 2016 23:44
The CFX Setup case file no longer exists. Continuing in an initial state. ced30 CFX 1 November 13, 2015 13:00
[GAMBIT] ERROR: The key, 0XAF8A, already exists in this HashTool fluent-user ANSYS Meshing & Geometry 2 February 11, 2013 20:17
exists minimum grid size for Ansys calculation? sooh2121 ANSYS 2 March 7, 2012 11:34


All times are GMT -4. The time now is 15:55.