|
[Sponsors] |
Getting density, temperature, and other cell flow variables via macros in Fluent UDF |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
August 7, 2020, 17:40 |
Getting density, temperature, and other cell flow variables via macros in Fluent UDF
|
#1 |
New Member
Justin
Join Date: Aug 2020
Posts: 8
Rep Power: 6 |
Hello,
I'm writing a simple UDF using DEFINE_GRID_MOTION to model movement of a solid surface representing corrosion, based on adjacent fluid properties. Basically, I'm looping over all faces in the "interface" thread that separates the fluid and solid domains (threads), and attempting to move the nodes of each face based on the temperature, density, thermal conductivity, and specific heat values found in the adjacent fluid cell. After building and loading my UDF without errors, I was getting the following error, which crashed Fluent: Code:
999999: mpt_accept: error: accept failed: No error============================================================================== Node 0: Process 17596: Received signal SIGSEGV. ============================================================================== MPI Application rank 0 exited before MPI_Finalize() with status 2 I've determined that the issue has to do with accessing the SV_DENSITY or SV_T variables, as they both return THREAD_STORAGE(t, SV_DENSITY [or SV_T]) == NULL. I think it's because in mem.h, the C_R and C_T macros are simply defined using the C_STORAGE_R macro, whereas both the C_K_L and C_CP macros provide an option to make use of either the C_STORAGE_R macro or the THREAD_PROP macro depending on whether THREAD_STORAGE(t, ...) == NULL or not. For clarity's sake, I've tried the following: Code:
if (NNULLP(T_STORAGE_R_NV(tf,SV_KTC))) //also used SV_DENSITY, SV_T { Message("Yes"); } else { Message("No"); } Any insight would be greatly appreciated! Please let me know if you need more specific details. |
|
August 10, 2020, 02:41 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
you may try to initialize your case first, and load UDF later
__________________
best regards ****************************** press LIKE if this message was helpful |
|
August 15, 2020, 22:08 |
|
#3 |
New Member
Justin
Join Date: Aug 2020
Posts: 8
Rep Power: 6 |
Thanks! I think that was the issue. I was trying to preview the mesh motion before initializing, so there was no density or temperature for the UDF to grab!
After initializing I ran the simulation and it worked fine. |
|
Tags |
cell flow variable macros, c_r, c_t, sv_density, udf |
|
|