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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 29, 2021, 13: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

Old   July 29, 2021, 15:06
Default
  #2
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
Taking one step back: why are you doing this? What is the goal?

If you find a way to do this, your boundary condition changes during the calculation, so your solution will never converge. Never.

If your goal is to have a simulation that does not converge, there are easier ways to do this...
__________________
"The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform" is NOT the error after compiling. It is the error after loading. To see compiler errors, look at your screen after you click "build".
pakk is offline   Reply With Quote

Reply


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 12:04
AMI speed performance danny123 OpenFOAM 21 October 24, 2020 05:13
LES, Courant Number, Crash, Sudden Alhasan OpenFOAM Running, Solving & CFD 5 November 22, 2019 03:05
laplacianFoam with source term Herwig OpenFOAM Running, Solving & CFD 17 November 19, 2019 14:47
Stuck in a Rut- interDyMFoam! xoitx OpenFOAM Running, Solving & CFD 14 March 25, 2016 08:09


All times are GMT -4. The time now is 14:39.