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

How can i get properties using UDF

Register Blogs Community New Posts Updated Threads Search

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   July 26, 2023, 00:26
Default How can i get properties using UDF
  #1
New Member
 
HOJUN YU
Join Date: Jul 2020
Posts: 24
Rep Power: 5
hobing is on a distinguished road
Hello I am using the Fluent V19 to analysis the propeller.

The propeller is analyzed in unsteady, and at each time step, a udf is created and used to obtain the coordinates of the various faces of the propeller surface, normal vector (x,y,z), force (x,y,z), static pressure, and area there is.

But there are some problems. Does anyone know how to achieve the above using udf? can someone help me?

Code:
..\..\src\udf.c(9): error C2040: 'x': 'real'
..\..\src\udf.c(22): error C2065: 'THREAD_WALL':
..\..\src\udf.c(27): error C2065: 'farea':
..\..\src\udf.c(27): error C2109:
..\..\src\udf.c(28): error C2223: '->storage' 
..\..\src\udf.c(32): warning C4477: 'fprintf' :
Below is my udf code.
domain = Get_Domain(3); where 3 is the boundary condition ID of the propeller.

Code:
#include "udf.h"

DEFINE_EXECUTE_AT_END(store_wall_info)
{
    Domain *domain;
    Thread *t;
    face_t f;
    real x[ND_ND];
    real x, y, z, area, pressure;
    real nx, ny, nz, fx, fy, fz;
    FILE *file;
    int time_step;

    time_step = N_TIME;

    file = fopen("wall_info.txt", "a");

    domain = Get_Domain(3);

    thread_loop_c(t, domain)
    {
        if (THREAD_TYPE(t) == THREAD_WALL)
        {
            begin_f_loop(f, t)
            {
                F_CENTROID(x, f, t);
                F_AREA(farea, f, t);
                F_P(pressure, f, t);
                F_NORMAL(nx, ny, nz, f, t);


                fprintf(file, "%e, %e, %e, %e, %e, %e, %e, %e, %e\n", x, y, z, area, pressure, nx, ny, nz, fx, fy, fz);
            }
            end_f_loop(f, t)
        }
    }

    fclose(file);
}
hobing is offline   Reply With Quote

 


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
Obtaining fluid properties using UDF UchihaMadara Fluent UDF and Scheme Programming 5 May 24, 2021 21:47
UDF phase properties separately U1990 FLUENT 3 April 13, 2021 03:37
Checking UDF material properties salumi FLUENT 0 December 2, 2016 05:57
How to show the properties in the specific zone ID using UDF (Define_adjust) sagga18 Fluent UDF and Scheme Programming 2 December 12, 2009 16:01
How to find Properties of Fluid at specific location, using UDF? pmghadge FLUENT 0 December 8, 2009 13:53


All times are GMT -4. The time now is 23:46.