CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

Trying to run an oscilating plate transient simulation

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 4, 2025, 09:03
Default Trying to run an oscilating plate transient simulation
  #1
New Member
 
Join Date: Jan 2024
Posts: 11
Rep Power: 3
Rcfd1 is on a distinguished road
As the tile suggest I am trying to run an oscilating plate transient simulations.

Basically I repeating all the steps from this video: https://www.youtube.com/watch?v=YTxch2vyphk&t=987s

But instead of Mesh Motion Rotation I am trying to insert the UDF (Cell Zones-> Inner Plate -> Mesh Motion)

But Ansys cannot recognize the UDF in that tab. (It recognizes it in the 6DOF tab though)

Can someone guide me on how should I load my UDF for that specific case and also maybe help me with the code?

My current code is this one.

#include "udf.h"

#define AMP 5.0 // Amplitude of pitch oscillation (degrees)
#define FREQ 1.0 // Frequency of oscillation (Hz)
#define PHASE 0.0 // Phase shift (radians)

DEFINE_CG_MOTION(pitching_airfoil, dt, vel, omega, time, dtime)
{
real angle_of_attack;
real angular_velocity;

// Calculate the oscillating angle of attack (in degrees)
angle_of_attack = AMP * sin(2 * M_PI * FREQ * time + PHASE); // Sinusoidal oscillation from -AMP to +AMP

// Convert the angle of attack to radians (since Fluent uses radians for rotation)
angle_of_attack = angle_of_attack * M_PI / 180.0; // Convert degrees to radians

// Calculate the angular velocity (time derivative of angle of attack)
angular_velocity = 2 * M_PI * FREQ * AMP * cos(2 * M_PI * FREQ * time + PHASE); // Derivative of sin for velocity

// Apply the angular velocity to the airfoil's rotation (about the z-axis, for pitch)
omega[0] = 0.0; // No rotation about x-axis
omega[1] = 0.0; // No rotation about y-axis
omega[2] = angular_velocity; // Rotation about the z-axis for pitching

// Translational velocity components (no translation in this case)
vel[0] = 0.0; // No velocity in the x-direction
vel[1] = 0.0; // No velocity in the y-direction
vel[2] = 0.0; // No velocity in the z-direction
}

This code is with the help of ChatGPT.
Rcfd1 is offline   Reply With Quote

Reply

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
How to continute a CFX transient run without losing previous time steps result file? Scar123111 CFX 5 January 31, 2020 06:14
Steady-state solution as IC for transient simulation pardoa OpenFOAM Running, Solving & CFD 3 July 24, 2019 06:49
Transient run continues from last time (when startover is desired) bongbang CFX 2 March 22, 2015 23:05
Resume Transient simulation HMR CFX 1 June 28, 2011 21:13
transient simulation: natural convection problem? Basics CFX 3 September 25, 2002 09:42


All times are GMT -4. The time now is 07:41.