|
[Sponsors] |
September 28, 2019, 02:25 |
Trouble with Lookup_Thread!
|
#1 |
New Member
Join Date: Sep 2019
Posts: 24
Rep Power: 7 |
Hello everyone,
I am having trouble running the following udf. Its giving me a segmentation fault, but as far as i know, there seems to be nothing wrong with it. I suspect the Lookup_Thread() is the problem... Also I am running Fluent 18.1 the udf is : #include "udf.h" /* must be at the beginning of every UDF */ #define k_B 1.3805e-23 /* Boltzman constant (j/K)*/ #define sigma 419e-12 /* molecular diameter*/ #define sigma_v 1 /* Tangential momentum accommodation coefficient*/ #define sigma_T 1 /*Thermal accommodation coefficient*/ #define pi 3.14159 /* pi number*/ #define sqrt_2 1.41421 /* sqrt(2) number */ #define len = 20e-5; FILE* slip; DEFINE_ON_DEMAND(wall_slip_velocity) { Domain* domain; double T, P, density, MU, K, landa, a_m, du_da, dT_dx, u_f, DUY, DVY, DUX, DVX, u, v; face_t f; Thread* t0; cell_t c0; double Slip_Vel; domain = Get_Domain(1); t0 = Lookup_Thread(domain, 8); slip = fopen("Slip_Velocity.out", "w"); if (slip == NULL) { Message("UDF cannot open file"); } else { begin_f_loop(f, t0) { T = C_T(c0, t0); /* temperature of the cell */ P = C_P(c0, t0); /* peressure of the cell */ density = C_R(c0, t0); /* density of the cell*/ MU = C_MU_L(c0, t0); /* laminar viscosity of the cell */ u = C_U(c0, t0); v = C_V(c0, t0); K = C_K_L(c0, t0); /* thermal conductivity of the cell */ landa = (k_B * T) / (sqrt_2 * pi * sigma * sigma * P); /* mean free path line */ DUX = C_DUDX(c0, t0); DVX = C_DVDX(c0, t0); DUY = C_DUDY(c0, t0); DVY = C_DVDY(c0, t0); Slip_Vel = (((2 - sigma_v) / sigma_v) * landa * (((DUX + DVX) * (v / sqrt(u * u + v * v))) - ((DUY + DVY) * (u / sqrt(u * u + v * v))))); fprintf(slip, "%f\n", Slip_Vel); } end_f_loop(f, t0) } } I would appreciate it if someone could help me solve this problem. Thanks in advance. NonStopEagle Last edited by NonStopEagle; September 28, 2019 at 02:28. Reason: I made a mistake in the udf |
|
September 29, 2019, 22:27 |
|
#2 | |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
Quote:
compile your code and read log. stop open new threads for same problems best regards |
||
Tags |
fluent, fluent - udf, udf code |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[waves2Foam] Having a lot of trouble for a short wavelengths | arieljeds | OpenFOAM Community Contributions | 1 | January 2, 2024 14:10 |
Trouble with rotating wall boundary condition | king1989 | OpenFOAM Running, Solving & CFD | 7 | July 29, 2016 14:44 |
Trouble with sampleDict syntax for OpenFOAM 2.3.1 | rawdoggity | OpenFOAM Post-Processing | 1 | February 1, 2015 06:24 |
[ICEM] trouble with mesh quality from ICEM in CFX Solver | escher25 | ANSYS Meshing & Geometry | 0 | February 28, 2011 08:38 |
[GAMBIT] Trouble meshing complex VOF geometry | RPJones | ANSYS Meshing & Geometry | 2 | February 14, 2011 19:54 |