TAGGED: udf
-
-
April 2, 2023 at 12:49 pm
K
SubscriberI'm trying to write a UDF that loops over the compute nodes one by one using compute_node_loop.
I did a small test below on 4 cores, where I save the compute node number into each of the cells: cells in compute node 0 would have a UDM of 0, cells in compute node 1 would have a UDM of 1, and so on. However, when I plot the UDM, all the values in the entire domain are 3, rather than having values ranging from 0 to 3 between partitions.
#include "udf.h"
DEFINE_ON_DEMAND(my_on_demand_function)
{
int pe;
#if !RP_HOST
compute_node_loop(pe)
{
Domain *domain;
Thread *tc;
cell_t c;
domain = Get_Domain(ROOT_DOMAIN_ID);
thread_loop_c(tc,domain)
{
begin_c_loop(c,tc)
{
C_UDMI(c,tc,0) = pe;
}
end_c_loop(c,tc)
}
}
#endif
} -
April 6, 2023 at 11:26 am
Keyur Kanade
Ansys EmployeeAs support we do not debug UDFs. But can provide help on particular syntex. Please check following link for details of UDF. Also if you have any subsequent questions, please post it on Ansys Forum Ansys Learning Forum under specific category.
Chapter 1: Overview of User-Defined Functions (UDFs) (ansys.com)
Regards,
Keyur
How to access Ansys Online Help Document
Guidelines on the Student Community
Fluids Engineering Courses | Ansys Innovation Courses
-
- 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: Received signal SIGSEGV
-
5108
-
3205
-
2423
-
1308
-
948
© 2023 Copyright ANSYS, Inc. All rights reserved.