TAGGED: fluent, friction-drag, udf
-
-
March 28, 2022 at 2:54 pm
eric1234598765
SubscriberHi,
I'm using Fluent 2020R2 to obtain laminar viscosity and velocity derivative via "C_MU_L(c,t)" and "C_DUDY(c,t)".
The trouble UDF is tested in VOF model with single processor using SST-K-OMEGA, which is going to compute the viscous drag of the "interface" which Fluent can't handle.
Here's UDF:
==================================================================
#include "udf.h"
DEFINE_ON_DEMAND(Viscous_Drag)
{
Domain *d = Get_Domain(1); /*Get the domain ID*/
face_t f;
cell_t c;
/*Get the thread id of that surface*/
Thread *t = Lookup_Thread(d,6); /* Interface_Fluid_porous1 */;
Thread *t1 = Lookup_Thread(d,7); /* Interface_Fluid_porous2 */;
real force;
real avgf;
int ii;
if (!Data_Valid_P())
{
return;
}
force=0.0;
avgf=0.0;
ii=1;
/* Loop over all cell*/
begin_c_loop(c,t)
{
force = force + C_MU_L(c,t);
}
end_c_loop(c,t)
Message("Viscous drag is = %8.4f ", force );
}
=================================================================
After debugging, I found that the Fluent would pop out "Received signal SIGSEGV." error and show the zero value when I using either "C_MU_L(c,t)" or "C_DUDY(c,t)" in the begin_c_loop, and with no problem when using other UDF cell macro such as C_T(c,t), C_K_L(c,t), and so on. However, laminar (molecular) viscosity was checked by xy-plot which is not zero.
Obviously, the problem is the misusing of the C_MU_L(c,t) and C_DUDY(c,t), therefore, I looking forward to any help.
Thanks!
March 28, 2022 at 3:09 pmeric1234598765
SubscriberUpdate:
Same error as stated when the VOF model is off.
March 29, 2022 at 11:13 amRob
Ansys EmployeeCheck if C_MU_L(c,t) needs a phase domain for VOF. I'm guessing, UDFs aren't one of my strong points.
March 30, 2022 at 10:53 americ1234598765
SubscriberHi I've solved the problem by pointing the face thread to the face centroid, which is
Thread *t = Lookup_Thread(d,6); /* Interface_Fluid_porous1 */
Thread *t0 = t->t0; /* Access t0 (Pointer to the adjacent cells thread.) from t (face thread) */
And using adjacent Cell Index in the f_loop , which is:
c0 = F_C0(f,t);
Now, the pointers I set are : t, t0, c0. Using c0 and t0 instead of c and t solve the problem in the loop. So the UDF is like:
==================================================
DEFINE_ON_DEMAND(Viscous_Drag1)
{
Domain *d = Get_Domain(1); /*Get the domain ID*/
face_t f; /*Index that identifies a wall face.*/
cell_t c0; /*Cell index that identifies the cell next to the wall.*/
/*Get the thread id of that surface*/
Thread *t = Lookup_Thread(d,6); /* Interface_Fluid_porous1 */
Thread *t0 = t->t0; /* Access t0 (Pointer to the adjacent cells thread.) from t (face thread) */
real viscosity;
if (!Data_Valid_P())
{
return;
}
real NV_VEC (A); /*Area normal vector*/
/* Loop over all surface faces*/
begin_f_loop(f,t)
{
F_AREA(A,f,t); /*Get the area vector*/
c0 = F_C0(f,t);
viscosity += C_MU_EFF(c0,t0);
}
end_f_loop(f,t)
}
=========================================
Best
Viewing 3 reply threads- You must be logged in to reply to this topic.
Ansys Innovation SpaceBoost 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.
Trending discussions- Floating point exception in Fluent
- What are the differences between CFX and Fluent?
- Heat transfer coefficient
- Difference between K-epsilon and K-omega Turbulence Model
- Getting graph and tabular data from result in workbench mechanical
- The solver failed with a non-zero exit code of : 2
- Suppress Fluent to open with GUI while performing in journal file
- Mesh Interfaces in ANSYS FLUENT
- Time Step Size and Courant Number
- error: Received signal SIGSEGV
Top Contributors-
7676
-
4476
-
2957
-
1433
-
1322
Top Rated Tags© 2023 Copyright ANSYS, Inc. All rights reserved.
Ansys does not support the usage of unauthorized Ansys software. Please visit www.ansys.com to obtain an official distribution.
-