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

How to read variable values on a surface

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 1, 2019, 06:31
Default How to read variable values on a surface
  #1
Member
 
Mattia
Join Date: Mar 2018
Posts: 45
Rep Power: 8
Comi is on a distinguished road
Good morning everyone, my project requires me to create a UDF that can read a variable value on a surface and then use that value in order to calculate another variable on a second surface. That must be done at each iteration. I understand that I can define the value of a variable by using Define_Profile or DEFINE_ADJUST, but I don't know how to read the value of the first variable in order to use it in my equation.

I hope my request is clear.

Thanks for the help
Comi is offline   Reply With Quote

Old   April 2, 2019, 01:22
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
Read Ansys Fluent Customization manual
find there "User-Defined Memory (UDM) Macros" chapter

if you want to read/write on each iteration you may use DEFINE_ADJUST macro or DEFINE_EXECUTE_AT_END macro, which execute your code before and after iteration respectively.

If you've defined the variable it means you've used F_UDMI for that. To get this value you need to make loop over all face/threads and read this value

best regards
AlexanderZ is offline   Reply With Quote

Old   April 3, 2019, 08:52
Default
  #3
Member
 
Mattia
Join Date: Mar 2018
Posts: 45
Rep Power: 8
Comi is on a distinguished road
Thakns, my idea was to read the value, in this case the temperature of the input and of the output and then use them to modify the flow on the input at each iteration. Do you think that for the last task I should use DEFINE_ADJUST or DEFINE_PROFILE?
Because with the latter it happened this during the calculation:
"libudf has wrong type: 1 != 12"
Comi is offline   Reply With Quote

Old   April 3, 2019, 22:33
Default
  #4
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
1.Read Ansys Fluent Customization manual

2.show your udf

best regards
AlexanderZ 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
CFX 11.0 "Vector Variable Normal” Does not Rotate with Domain? User Surface Moving jrl4444 CFX 4 November 14, 2013 18:46
FvPatchFields - read and write values in a patch vitors OpenFOAM Programming & Development 0 December 11, 2012 14:47
[Gmsh] boundaries with gmshToFoam‏ ouafa OpenFOAM Meshing & Mesh Conversion 7 May 21, 2010 13:43
Values at certain distance around surface? hornig FLUENT 0 August 14, 2009 07:16
CFX4.3 -build analysis form Chie Min CFX 5 July 13, 2001 00:19


All times are GMT -4. The time now is 02:19.