Tagged: #fluent-#cfd-#ansys, udf
-
-
January 15, 2023 at 10:50 pm
ehsan.sadeghi
SubscriberI have the following UDF for changing BC for a UDS in every iteration until it reaches a desired condition. Basically what I want to do is check C_UDSI values of UDS0 on inlet faces and if its value is equal to E_peek assign C_UDSI of UDS1 to q. I am using adjust function to get the values of q and store it in UDMI to later use it in F_PROFILE.
I am not sure if the way that I have implmented this UDF is correct, cause when I hook it and run the simulation, Fluent gives error. The UDF gets compiled without any error. I appreciate if you can give me some hints to know where is the problem in my code.
Thanks
DEFINE_ADJUST (UDF_adjust, d)
{
/*Domain definition variables */
Thread *t;
cell_t c;
face_t f;
/*q_density tracking variables*/
real q_star=0;
real q;
real w = 0.1;
real E_peek = (3E6*1.0) + (9E4/(sqrt(1.0/0.1)));
/* Do nothing if gradient isn't allocated yet. */
if (! Data_Valid_P())
return;
thread_loop_f(t,d)
{
begin_f_loop(c,t)
{
if (fabs(F_UDMI(f,t,3)-E_peek) <= 0.001)
{
q = F_UDSI(c, t, 1);
}
else
{
q_star = F_UDSI(c, t, 1)*(F_UDMI(f,t,3)/E_peek);
q = w*q_star+(1.0-w)*F_UDSI(c, t, 1);
}
}
end_f_loop(c,t)
}
} -
January 16, 2023 at 3:52 pm
Rob
Ansys EmployeeWhat error are you getting?
-
January 16, 2023 at 8:44 pm
ehsan.sadeghi
Subscriber===================================================================================
= BAD TERMINATION OF ONE OF YOUR APPLICATION PROCESSES
= RANK 0 PID 1228 RUNNING AT PC-ANSYS-157
= EXIT STATUS: -1 (ffffffff)
-
-
January 17, 2023 at 9:43 am
Rob
Ansys EmployeeAnything above that?
-
January 17, 2023 at 10:19 am
ehsan.sadeghi
SubscriberFluent gets closed after appearing this message. I found in the logs the following error:
Cortex received a fatal signal (SEGMENTATION VIOLATION).
-
-
January 17, 2023 at 11:33 am
Rob
Ansys EmployeeKnocking the solver over takes some doing. If you open the transcript has the solver done an interation (or few) and then failed or failed before doing an iteration?
Note, I'm not going to debug or do much with the UDF. It's beyond what we're able to support on here, and my UDF coding skills aren't all that high.
-
January 17, 2023 at 11:39 am
ehsan.sadeghi
SubscriberProblem solved! the face values were not saved in UDMI -
January 17, 2023 at 11:48 am
Rob
Ansys EmployeeExcellent. I think there's a UDM for faces too, so have a look at the face-cell data macros.
-
- You must be logged in to reply to this topic.

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
- The solver failed with a non-zero exit code of : 2
- Difference between K-epsilon and K-omega Turbulence Model
- Time Step Size and Courant Number
- Mesh Interfaces in ANSYS FLUENT
- error in cfd post
-
2524
-
2066
-
1279
-
1096
-
457
© 2023 Copyright ANSYS, Inc. All rights reserved.