TAGGED: non-newtonian, strain-rate, udf, viscosity
-
-
April 26, 2023 at 2:59 pm
Antonin HIPPOLYTE
SubscriberHi everyone,
I am new to UDF function and I am trying to implement a new viscosity in a lid driven simulation. The required viscosity is proportional to the inverse of the strain rate magnitude and is computed in the following script:
#include "udf.h"
DEFINE_PROPERTY(muinverse, c, t)
{
real strain_rate_mag;
real mu;
real mumin = 0.01;
real mumax = 1.0;
strain_rate_mag = pow(C_STRAIN_RATE_MAG(c, t),1);
mu = 0.01 + 1.0/(1 + strain_rate_mag);
if (mu < mumin)
{
mu = mumin;
}
if (mu > mumax)
{
mu = mumax;
}
return mu;
}
However, when I run the simulation and export the viscosity results, I have some parts of the plot that are not in agreement with the analytical solution. Does anyone experienced the same error and do you have any suggestion or explication for this case?This plot corresponds to the results obtained from the UDF simulation versus the theoretical curve. The red points in the figure corresponds to the unexpected viscosity in the lid driven cavity.
-
April 27, 2023 at 10:34 am
Rob
Ansys EmployeeThe code looks OK, although I'm not sure why you included strain_rate_mag = pow(C_STRAIN_RATE_MAG(c, t),1); rather than just using the macro. Is the result from the UDF maths or the solution?
-
April 27, 2023 at 11:13 am
Antonin HIPPOLYTE
SubscriberI previously used the square of the velocity. Actually this step is useless now but I don't think that's the cause of my problem.
-
-
April 27, 2023 at 11:45 am
Rob
Ansys EmployeeAgreed.
-
- 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
-
5290
-
3311
-
2469
-
1308
-
1016
© 2023 Copyright ANSYS, Inc. All rights reserved.