-
-
May 8, 2023 at 8:55 am
Gloria
SubscriberHello! I am building a UDF and at some point, I need to use the property of a cell adjacent to the wall/another cell. For that purpose, I use macros THREAD_T(t) and F_C0(f, t). Then, I need to define a face, but warning C4700 appears after compiling the UDF and Fluent closes after hitting calculate. The warning points out that local variable ‘f’ is used without being initialised.
Here it is the section of my UDF that is causing me problems:
DEFINE_DPM_SOURCE(udf_source, c, t, S, strength, tp)
{
(…)
real C1;
int i;
Domain *domain;
Thread *tg, *t0;
cell_t cell;
face_t f;
domain = Get_Domain(1);
tg = Lookup_Thread(domain, 7); // ID wall = 7
begin_c_loop(cell, tg)
{
cell = F_C0(f, tg);
t0 = THREAD_T0(tg);
C1 = C_YI(cell, tg, 0);
}
end_c_loop(cell, tg)
(…)
}
I am aware that the are some restrictions on answering UDF questions, but I would appreciate any hint anybody can give me about this. How can I initialise 'f'? Am I approaching it in the right way? Thank you!
-
May 9, 2023 at 10:38 am
Rob
Ansys EmployeeFace thread isn't passed by the macro (no f in the macro), so I wonder if https://ansyshelp.ansys.com/account/Secured?returnurl=/Views/Secured/corp/v231/en/flu_udf/flu_udf_GenPurposeLoopingMacros.html%23flu_udf_sec_thread_loop_f is what you'll need.
-
- You must be logged in to reply to this topic.

Boost Ansys Fluent Simulations with AWS
Computational Fluid Dynamics (CFD) helps engineers design products in which the flow of fluid components is a significant challenge. These different use cases often require large complex models to solve on a traditional workstation. Click here to join this event to learn how to leverage Ansys Fluids on the cloud, thanks to Ansys Gateway powered by AWS.

Earth Rescue – An Ansys Online Series
The climate crisis is here. But so is the human ingenuity to fight it. Earth Rescue reveals what visionary companies are doing today to engineer radical new ideas in the fight against climate change. Click here to watch the first episode.

Ansys Blog
Subscribe to the Ansys Blog to get great new content about the power of simulation delivered right to your email on a weekly basis. With content from Ansys experts, partners and customers you will learn about product development advances, thought leadership and trends and tips to better use Ansys tools. Sign up here.
- Suppress Fluent to open with GUI while performing in journal file
- Floating point exception in Fluent
- What are the differences between CFX and Fluent?
- Heat transfer coefficient
- Getting graph and tabular data from result in workbench mechanical
- Difference between K-epsilon and K-omega Turbulence Model
- The solver failed with a non-zero exit code of : 2
- Time Step Size and Courant Number
- Mesh Interfaces in ANSYS FLUENT
- error: Received signal SIGSEGV
-
5414
-
3389
-
2471
-
1310
-
1022
© 2023 Copyright ANSYS, Inc. All rights reserved.