CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > ANSYS > FLUENT

UDF to change angular velocity after every timestep based on the previous value

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Search this Thread Display Modes
Old   November 8, 2022, 11:13
Default UDF to change angular velocity after every timestep based on the previous value
New Member
Join Date: Jul 2019
Posts: 14
Rep Power: 6
usr0830 is on a distinguished road
I am trying to run a simulation where the angular velocity of a dynamic mesh zone changes every time step based on this equation of motion where moment_z is the moment on the two aerofoils defined as one wall.

omega_prev + = ((1/I) * (moment_z - (alpha * omega_prev)))
When I set up the dynamic mesh with the udf, the initialisation returns an "All compute processes received SIGFPE." error. I am not sure what the cause of this error is. Could someone more knowledgeable please help me solve this?

This is the UDF I am using:

#include "udf.h"
real current_dt;
real omega_old;
real omega_new;
real moment_z;
static I = 0.0275; /* Moment of inertia */
static alpha = 0.00626;
static real omega_prev = 0.0;
DEFINE_CG_MOTION (rotational_motion1, dt, vel, omega, time, dtime)
#if !RP_HOST
current_dt = RP_Get_Integer("time-step");
if (current_dt ==1)
omega_prev = -128;
omega_prev = omega[2];
Message("Omega_old1 is %g",omega_prev);
Domain *d =Get_Domain(1);
Thread *t_object = Lookup_Thread(d, 2);
real moment [ND_ND], cg[ND_ND], force [ND_ND];
Compute_Force_And_Moment(d, t_object, cg, force, moment, TRUE);
moment_z= moment [2]; 
/* Equation of motion */
omega_prev += ((1/I) * (moment_z - (alpha * omega_prev)));
Message("Omega_new1 is %g",omega_prev);
omega[2] = omega_prev;

Thank you!
usr0830 is offline   Reply With Quote


rotating domain, udf

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
udf for one dimensional linear motion based on force maccheese Fluent UDF and Scheme Programming 2 September 1, 2019 02:18
UDF comilation error. urgent help please m zubair Fluent UDF and Scheme Programming 4 February 10, 2019 11:19
Fluent do not use my velocity field(by UDF) to solve energy equation tangleiplus Fluent UDF and Scheme Programming 6 January 21, 2019 21:28
adapt viscous resistance based on velocity / UDF Häwimeddel FLUENT 2 April 20, 2009 10:08
UDF velocity and temperature Raj FLUENT 3 February 1, 2009 18:29

All times are GMT -4. The time now is 17:00.