|
[Sponsors] |
UDF to create rotational motion constrained between 2 angles |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
December 7, 2021, 10:21 |
UDF to create rotational motion constrained between 2 angles
|
#1 |
New Member
unicorn
Join Date: Nov 2020
Posts: 6
Rep Power: 6 |
Hi there,
I'm trying to create a UDF to make a circular domain rotate about its centre but constrained to between its starting position and -90 degrees. Once it reaches -90 degrees I want it to rotate the back the opposite way to its start position. I have differentiated theta = -90*(sin(100t))^2 to get theta dot (angular speed) I currently have the below UDF that doesn't seem to be constraining the motion: Code:
#include "udf.h" #define PI 3.141592654 real theta_max = - 90 * (PI/180); real omega = 100 * (2 * PI/60); DEFINE_TRANSIENT_PROFILE(circ, time) { real theta_dot = 2 * theta_max * omega * cos(omega * time) * sin(omega * time); return theta_dot; } |
|
December 14, 2021, 08:33 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
you code should work without issues
however, I prefer to make few changes to avoid using standard names Code:
#include "udf.h" real theta_max = - 90 * (M_PI/180); real omega_w = 100 * (2 * M_PI/60); DEFINE_TRANSIENT_PROFILE(circ, time) { real theta_dot = 2 * theta_max * omega_w * cos(omega_w * time) * sin(omega_w * time); return theta_dot; }
__________________
best regards ****************************** press LIKE if this message was helpful |
|
Tags |
constrained, fluent, rotational motion, udf |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to define movement/deformation relative to a rigid body motion in Fluent by udf? | eagle_001 | Fluent UDF and Scheme Programming | 6 | May 17, 2022 04:41 |
UDF for equation of motion | saadyw | Fluent UDF and Scheme Programming | 0 | January 23, 2018 13:48 |
OpenFoam "Permission denied" and "command not found" problems. | iyidaniel@yahoo.co.uk | OpenFOAM Running, Solving & CFD | 11 | January 2, 2018 07:47 |
UDF Problem about Grid Motion !!! | Zhengyu Gao | Fluent UDF and Scheme Programming | 0 | December 6, 2013 20:45 |
udf in MRF to update the rotational speed | Jam | FLUENT | 0 | August 21, 2005 13:50 |