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

Accessing output parameter value in scheme

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 11, 2014, 13:18
Default Accessing output parameter value in scheme
  #1
New Member
 
Join Date: Apr 2013
Posts: 17
Rep Power: 13
nnvoro is on a distinguished road
Dear all,

Does anybody know if there is a way to access output parameter value in scheme file?

I create UDM in UDF which is defined for each cell of the domain. I need to use the maximum (on the domain) value of the UDM in my scheme file. For that I create output parameter in my journal file using command:

define/parameters/o-p/create/surface-integral "parameter-1" facet-max udm-2 soutlet1_3_1 ()

I want to use the value of the parameter-1 (or maximum value of the udm-2) in my scheme. For that I tried to create scheme variable having the value of the parameter-1 using command:

(rp-var-define 'press_diff (rpgetvar 'parameter-1) 'double #f)

but it didn't work. I get the message:

Error: rp-var-value: undefined variable
Error-Object: parameter-1


nnvoro
nnvoro is offline   Reply With Quote

Old   October 11, 2014, 14:53
Default
  #2
New Member
 
Join Date: Apr 2013
Posts: 17
Rep Power: 13
nnvoro is on a distinguished road
I think I might try to do that in a slightly different way which looks more complicated to me.

I will calculate average value of the udm (in my particular case max and average value are the same) in udf:

real a=0.0;
int c_count = 0;

thread_loop_c(ct,d)
{
begin_c_loop(c,ct)
{
a+=C_UDMI(c,ct,2);
c_count++;
}
end_c_loop(c,ct)
}
a = a/c_count;


And then export the value to the fluent in the udf using command:

RP_Set_Real("press_diff",a);

In the journal file I should have the command which creates and initializes variable "press_diff", this command should be executed before executing udf:

(if (not (rp-var-object 'press_diff))(rp-var-define 'press_diff 0 'double #f))
nnvoro is offline   Reply With Quote

Reply


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
Implementation of QUICK scheme Romuald Skoda Main CFD Forum 11 November 6, 2017 21:20
Use of upwind scheme for interpolation of u/v quarkz Main CFD Forum 6 August 30, 2011 04:10
Questions about data output aki_yafuji OpenFOAM Running, Solving & CFD 3 September 9, 2010 01:59
lift and drag on ship superstructures vaina74 OpenFOAM Running, Solving & CFD 3 June 8, 2010 12:30
[Other] Output Format of MetaMesh t42 OpenFOAM Meshing & Mesh Conversion 0 August 3, 2007 04:28


All times are GMT -4. The time now is 10:03.