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

Replace time with current timestep

Register Blogs Community New Posts Updated Threads Search

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   July 29, 2021, 12:51
Default Replace time with current timestep
  #1
New Member
 
Join Date: Jul 2021
Posts: 2
Rep Power: 0
zeefar is on a distinguished road
Hello,
I am trying to use the timesteps of my steady state solver instead of the time function I used to set my case as a transient one in the code below:
/* flap.c */
/* UDF for specifying a simple harmonic motion*/
/* */
/**********************************************/

#include "udf.h"
#define Freq 0.1
#define angular_freq 2.0*M_PI*Freq
#define tetmax -45.0*M_PI/180

DEFINE_CG_MOTION(shm, dt, cg_vel, cg_omega, time, dtime)
{
real omega;
omega = tetmax*angular_freq*cos(angular_freq*time); /* rotational speed about axis*/

cg_vel[0] = 0.0075 * sin(3.1415927 * time / 5.);
cg_vel[1] = 0.0;
cg_vel[2] = 0.0;

cg_omega[0] = 0.0;
cg_omega[1] = 0.0;
cg_omega[2] = omega;
}

I found this function CURRENT_TIMESTEP in the UDF manual to use the timestep of the solver for my steady state case. However, I have been unable to rework this into my code to replace time with the current timestep function and need help regarding this.
zeefar is offline   Reply With Quote

 


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
[Other] refineWallLayer Error Yuby OpenFOAM Meshing & Mesh Conversion 2 November 11, 2021 11:04
AMI speed performance danny123 OpenFOAM 21 October 24, 2020 04:13
LES, Courant Number, Crash, Sudden Alhasan OpenFOAM Running, Solving & CFD 5 November 22, 2019 02:05
laplacianFoam with source term Herwig OpenFOAM Running, Solving & CFD 17 November 19, 2019 13:47
Stuck in a Rut- interDyMFoam! xoitx OpenFOAM Running, Solving & CFD 14 March 25, 2016 07:09


All times are GMT -4. The time now is 02:55.