DEFINE_PROFILE ---- SIGSEGV error - Multiphase
1 Attachment(s)
Hi all,
I am new to UDF programming and I am doing a UDF for heat transfer coefficient in multiphase simulation. The code compiles good, but produces a SIGSEGV error on execution. Code:
#include "udf.h" htc_gas_wall.txt Quote:
Quote:
How to solve this error.? Thanks, Senthil. |
You tell Fluent that c is a Cell, but you don't say which cell. And then you ask fluent to use the velocity on that unspecified cell. That gives problems.
It looks like you want to use the flow in the cell closest to the wall to calculate the Reynolds number, as input for the heat transfer. I forgot the physical equations, but is this what you need? I would find one of two things more logical : take the overall Reynolds number (with average velocity) or take the velocity at the wall (if you have wall slip). So I can see in which lines your code breaks, but I don't know how to fix it because I don't know which equations you are trying to implement. |
in addition to Pakk,
you should put the "computation" part of your code inside the loop of face and define adjusted cell of each face, using F_C0 macro (and you are using thread_t0, which is thread of adjusted to face cell) if you run in parallel, be careful with writing to file part. You should write to file from host read ansys fluent customization manual for details |
Thanks for your comments.
My problem is I am modelling a heat transfer coefficients for multiphase h(gas-wall) and h(solid-wall). So I choose DEFINE_PROFILE and wanted to add both coefficients in the same UDF. Because, I am able to select only one UDF in the boundary conditions. Simplified equations for heat transfer coefficients are h(gas-wall) = 1.54*Re*k/D and h(solid-wall) = D/k + [2 * sqrt(k * rho * cp / pi)]^(-1) So I got the sub threads from the mixture thread. Get the values from the adjacent cell and calculate the heat transfer coefficient. Because the velocity at the wall is zero. After your comments., I simplified the code and executed. When I execute with just mixture level threads, the UDF is working and when I use the sub_threads for the phase, It produces SIGSEGV error. Simplified UDF: Code:
#include "udf.h" Thanks, Senthil. |
In this code, you use f before you tell fluent which face it is.
Put your begin_f_loop earlier in your code, before you use f for the first time. |
Code:
#include "udf.h" But the same SIGSEGV error on execution with F_U(f,ti) and works fine with F_U(f,t). Thanks, Senthil. |
All times are GMT -4. The time now is 19:45. |