-
-
May 30, 2023 at 9:09 am
TONY ARHUR
SubscriberHello please I am compiling a UDF for rotating screws but I receive an error message which indicates the motion.h is missing. Please where can I get this header.
-
May 30, 2023 at 11:05 am
Rob
Ansys EmployeeDid you #include it? Single screw or interlocking?
-
May 30, 2023 at 11:07 am
TONY ARHUR
SubscriberPlease I am working on interlocking screws
-
May 30, 2023 at 11:08 am
Rob
Ansys EmployeeAnd did you #include that header?
-
May 30, 2023 at 11:10 am
TONY ARHUR
SubscriberYes. I did include the motion.h in the script but it seems it can not be located on my file path
-
May 30, 2023 at 1:17 pm
Rob
Ansys EmployeeDid you compile the UDF?
-
May 30, 2023 at 1:30 pm
TONY ARHUR
SubscriberI am trying to compile the script using the fluent setup but I received this error code which indicates the motion.h cannot be located
-
May 30, 2023 at 1:39 pm
Rob
Ansys EmployeeI assume the solver is set to 3d and transient? Which moving mesh macro are you using?
-
May 30, 2023 at 1:44 pm
TONY ARHUR
SubscriberI am using the built in compiler for this so I have not specified the mesh macro
-
May 30, 2023 at 1:47 pm
Rob
Ansys EmployeeIn the .c file, what's the motion macro? Ie DEFINE_GRID_MOTION etc.
-
May 30, 2023 at 1:55 pm
TONY ARHUR
SubscriberCan I send the script over for u to have a look please
-
May 30, 2023 at 2:19 pm
Rob
Ansys EmployeeYou can post it here, but I (and other Ansys staff) will only have a quick look as we don't debug code. Others aren't similarly constrained, but their participitation is voluntary.
-
May 30, 2023 at 2:22 pm
TONY ARHUR
Subscriber#include "udf.h"
#include "motion.h"DEFINE_CG_MOTION(rotating_screws, dt, vel, omega, time, dtime)
{
Thread *t;
cell_t c;
real omega_z1 = 300 * 2 * M_PI / 60; // Rotational speed for screw in rad/s
real omega_z2 = 200 * 2 * M_PI / 60; // Rotational speed for screw-2 in rad/s/* Loop over all cell threads */
c_thread_loop_c (t, dt)
{
/* Loop over all cells in the cell thread */
begin_c_loop (c, t)
{
/* Update the rotation of the cell centroid based on the angular velocity for screw */
C_CENTROID(c, t)[0] += omega_z1 * dt * (C_NORMAL(c, t)[1] * (C_CENTROID(c, t)[2] - 0.0)
- C_NORMAL(c, t)[2] * (C_CENTROID(c, t)[1] - 0.0));
C_CENTROID(c, t)[1] += omega_z1 * dt * (C_NORMAL(c, t)[2] * (C_CENTROID(c, t)[0] - 0.0)
- C_NORMAL(c, t)[0] * (C_CENTROID(c, t)[2] - 0.0));
C_CENTROID(c, t)[2] += omega_z1 * dt * (C_NORMAL(c, t)[0] * (C_CENTROID(c, t)[1] - 0.0)
- C_NORMAL(c, t)[1] * (C_CENTROID(c, t)[0] - 0.0));
/* Update the rotation of the cell centroid based on the angular velocity for screw-2 */
C_CENTROID(c, t)[0] += omega_z2 * dt * (C_NORMAL -
May 30, 2023 at 3:13 pm
Rob
Ansys EmployeeI'm not sure you can calculate both motions in one macro, you may need two DEFINE_CG_MOTION sections. Compare with the example to see if there's anything else you need to do.
https://ansyshelp.ansys.com/account/Secured?returnurl=/Views/Secured/corp/v231/en/flu_udf/flu_udf_DynamicMeshDEFINE.html%23flu_udf_sec_define_cg_motion
-
May 30, 2023 at 6:22 pm
TONY ARHUR
SubscriberMy main problem has to do with the fatal error that says: motion.h file not found. I have check the installation directory and I could not find the header file "motion.h". Please where can I get this file.
-
May 31, 2023 at 10:26 am
Rob
Ansys EmployeeI don't have that file in my install, so maybe the error is non-diagnostic.
And review the example - is this the macro you should be using?
-
- 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.
- 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
-
7690
-
4484
-
2957
-
1435
-
1322
© 2023 Copyright ANSYS, Inc. All rights reserved.