-
-
February 7, 2023 at 7:55 pm
Aditi Deekshita Pallay
SubscriberHello!
I am currently working on CFD Analysis of a synthetic jet actuator modelled inside a 2D aerofoil using ANSYS Fluent 2022 R2 Student Version. All the modelling and meshing is done. I am able to compile the udf but it is not visible in the drop down menu while giving the boundary condition of the diaphragm.
I have also installed Microsoft Visual Studio and tried. It isn't working.
So then I have interpreted my code and checked that I was able to select it from the drop down menu of the velocity inlet boundary condition. But when I initialise the project, i am getting a "BAD TERMINATION" error and the fluent is closing.
Can anyone suggest a possible solution for the compilation or interpretation procedures for loading udf in my case?
This is a simple code that I used:
#include "udf.h"#define pi 3.1415926535DEFINE_CG_MOTION(diaphragm_motion, dt, vel, omega, time, dtime){real amplitude = 0.1;real frequency = 1.0;vel[1] = amplitude * frequency * cos(2 * pi * frequency * time);omega[1] = -2 * pi * amplitude * frequency * sin(2 * pi * frequency * time);} -
February 8, 2023 at 1:41 pm
Rob
Ansys EmployeeAs a starting point I'd use the built in compiler as finding all of the Microsoft components and getting them to work is somewhat more complex than it ought to be. Also, do not interpret any code, that's going to cause all sorts of problems with complex macros.
I'd then review the mesh, large jumps in cell size are really not going to make your model any more stable.
-
February 9, 2023 at 5:57 am
Aditi Deekshita Pallay
SubscriberThank you for your response.
If I use a built in compiler there are many errors for the undeclared variables and other predefined functions and non existing directories. That's the reason I had to install Microsoft Visual Studio and then compile it . It has successfully compiled but I think the macro that I used which is DEFINE_CG-MOTION is only useful for the dynamic mesh case and one cannot find the loaded udf into the boundary condition of the velocity inlet for that macro.
However if I use another macro such as DEFINE_PROFILE for defining the motion of the diaphragm I encountered so many errors. I'm not able to figure out which kind of code is compatible with the existing user defined function directories of ANSYS Fluent 2022 R2.This is the code that I have written using DEFINE_PROFILE
#include "udf.h"
#include
DEFINE_PROFILE(diaphragm_motion, t, i)
{
real x[ND_ND];
real y;
face_t f;
begin_f_loop(f, t)
{
F_CENTROID(x,f,t);
y = sin(2 * M_PI * x[0]);
F_PROFILE(f, t, i) = y;
}
end_f_loop(f, t)
}
-
February 9, 2023 at 9:35 am
Rob
Ansys EmployeeMaybe read this https://ansyshelp.ansys.com/account/Secured?returnurl=/Views/Secured/corp/v231/en/flu_udf/flu_udf_DynamicMeshDEFINE.html%23flu_udf_sec_define_grid_motion as it's the one I used. DEFINE_PROFILE is for properties on a boundary, so velocity, temperature etc and is nominally superseded by Expressions.
If the built in compiler is returning a load of complaints it's usually a good idea to read these and fix them.
-
- 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
- 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
-
3720
-
2570
-
1783
-
1236
-
594
© 2023 Copyright ANSYS, Inc. All rights reserved.