|
[Sponsors] |
June 6, 2018, 11:59 |
pass reference values to UDF
|
#1 |
New Member
DS
Join Date: May 2016
Posts: 28
Rep Power: 10 |
Good morning,
I need to pass the reference values from fluent scheme to udf. In particular I setted the reference values using Code:
report/reference-values/compute/pressure-inlet thank you very much Best Regards Denis |
|
June 6, 2018, 23:58 |
|
#2 |
New Member
Ngo Bao Chung
Join Date: Sep 2012
Posts: 14
Rep Power: 14 |
Hello Denis,
There are few ways to do that. My normally way is to use input parametric for udf. You can set up them in User define > Parameters > More > UDF > Select. In select parameter table, you can create your variable by choosing New Parameter. In here you can set its value and reference name. Click Ok when you finish an back to the "Use input Parameter for UDF" table, click "Define" to add your new variable, and then press Print to check your value. The Parameter should be called in UDF by RP_Get_Parameter("real-n"), where "real-n" is the ID of the variable you created (can check by Print) Another way is to follow the steps here: https://www.computationalfluiddynami...sys-workbench/ I hope you find it useful. Regards, Chung. |
|
June 7, 2018, 05:52 |
Reference values
|
#3 |
New Member
DS
Join Date: May 2016
Posts: 28
Rep Power: 10 |
Thank you really much for your answer and help. I'm sorry for another question. From your method I don't understand how to associate to some parameter the Reference values which fluent compute from some surface.
Or better: I would like to read from my udf the Reference values Area, Density, Length, Velocity, Temperature which are calculated automatically from some surface by Fluent. Thank you really really much and I'm sorry for disturb Best Regards Denis |
|
June 7, 2018, 06:10 |
|
#4 | |
New Member
Ngo Bao Chung
Join Date: Sep 2012
Posts: 14
Rep Power: 14 |
Quote:
For that purpose, it really depends on your specific requirements. I assume you want to update reference values after each iteration, so you can use DEFINE_EXCUTE_AT_END function to calculate your parameters then pass back to your profile, source, property or any other function, just like a C program. Regards, Chung. |
||
June 7, 2018, 06:52 |
Reference values
|
#5 |
New Member
DS
Join Date: May 2016
Posts: 28
Rep Power: 10 |
Thank you really really much again.
My purpose is to use that parameters to find dimensionless force and moment coefficients. For that I would read all the parameter calculated by the command Code:
report/reference-values/compute/pressure-inlet Many many thanks Best Regars Denis |
|
June 8, 2018, 11:25 |
|
#6 |
Senior Member
Join Date: Sep 2017
Posts: 246
Rep Power: 12 |
Hi Denis,
I'm familiar with the Reference Length, Area etc, as set in Reference Values. One way to deal with these is to set Length=1.0m, Area=1.0m2, viscosity=1.0Pa.s, and so on, and then you can almost forget that they exist. (You might want more sensible values in some variables: Temperature and Ratio of Specific Heats.) I think you will find that those reference values are available as RP variables, so in a UDF you should be able to access them via something like this: Code:
real ref_pressure; ref_pressure = RP_Get_Real("reference-pressure") Code:
real ref_pressure,ref_length,ref_density,ref_area; #if !RP_NODE ref_pressure = RP_Get_Real("reference-pressure") ref_length = RP_Get_Real("reference-length") ref_density = RP_Get_Real("reference-density") ref_area = RP_Get_Real("reference-area") #endif host_to_node_real_4(ref_pressure,ref_length,ref_density,ref_area); Code:
if(RP_Variable_Exists_P("varname") ... I'm not at all familiar with the parameters returned by the TUI command that you mentioned. Please can you explain how/where they are used? By the way, you are correct in not assuming write-access even when a variable is available in a UDF. Good luck! Ed |
|
Tags |
reference values udf |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
wmake problems during custom utility compilation | palazi88 | OpenFOAM Programming & Development | 11 | August 13, 2018 21:52 |
Simulation of a single bubble with a VOF-method | Suzzn | CFX | 21 | January 29, 2018 01:58 |
Ansys CFX problem: unexpected very high temperatures in premix laminar combustion | faizan_habib7 | CFX | 4 | February 1, 2016 18:00 |
WallHeatFlux and chtMultiregion | m_f | OpenFOAM Post-Processing | 13 | March 16, 2015 11:16 |
OpenFOAM on MinGW crosscompiler hosted on Linux | allenzhao | OpenFOAM Installation | 127 | January 30, 2009 20:08 |