|
[Sponsors] |
February 6, 2004, 09:16 |
UDF get the variables of specified B.C
|
#1 |
Guest
Posts: n/a
|
Hi, I want to know how to use UDF macro to get the values of coordinates and variables of the mesh nodes in the specified B.C.? for example,I want to get all the mesh nodes' coordinats & Static Pressure of some boundary faces,How to get and export them?thanks.
|
|
February 6, 2004, 14:31 |
Re: UDF get the variables of specified B.C
|
#2 |
Guest
Posts: n/a
|
This is actually pretty simple. There should be alot of helpful information in the Fluent 6 UDF manual. What is it that you want to do with these variables, print them to screen? If so you probably want something like this: DEFINE_PROFILE(coord_press, t, i)
{ fact_t f; begin_f_loop(f, t) { real x[ND_ND]; F_CENTROID(x, f, t); printf("\nface=%d, x-coord=%g, y-coord=%g, press=%g", f, x[0], x[1], C_P(f,t)); } I haven't compiled or tested it, I did it on the fly, so there are probably a couple of mistakes, but you will probably want to customize it yourself depending on what you are trying to do with the UDF |
|
February 6, 2004, 14:32 |
Re: UDF get the variables of specified B.C
|
#3 |
Guest
Posts: n/a
|
Sorry, you will need an end_f_loop(c,t) in there as well.
|
|
February 6, 2004, 22:05 |
Re: UDF get the variables of specified B.C
|
#4 |
Guest
Posts: n/a
|
thank you Andrew.I am not very familiar with the UDF. I need the nodes's coordinates and variables,not the centroid,so whether the macro should be F_P(f,t)? But F_P(f,t) can not return the nodes' coordinates. How to solve this problem? And I want to export the nodes' coordinates & variables to a data file. I have used a UDF to define the B.C. profile,and whether this TWO UDFs should be writted in one file or two seperated files,and if the latter, how to compile them?thank u.
|
|
February 8, 2004, 23:15 |
Re: UDF get the variables of specified B.C
|
#5 |
Guest
Posts: n/a
|
Hi,
F_P(f, t) shows static pressure of a specified face . Node coordintes are defined as NODE_X() and NODE_Y(), NODE_Z() , but there are just coordinate not any values on nodes in Fluent ,so nobody can get static pressure and temperature etc via UDF. (I think that when you select the Node-Based solver in Fluent , maybe you can get it). The only thing you can get the node value of pressure ,you have to use a default export function(i.e. File-Export-Profile). This export data becomes node value. Thank you -- FJ |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF to record FLUENT Solver variables... | mariachi | Fluent UDF and Scheme Programming | 11 | September 24, 2019 01:07 |
UDF to record FLUENT solver variables... | mariachi | FLUENT | 1 | February 3, 2010 23:18 |
Urgent! Help on UDF to set B.C. of 3rd type | Ray Hong | FLUENT | 0 | December 28, 2005 20:35 |
UDF variables F1, y / problem with UDF | Fabian | FLUENT | 6 | June 2, 2003 11:22 |
About UDF of Inlet and Periodic B.C. | JI Lucheng | FLUENT | 2 | December 28, 2001 20:18 |