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

UDF for rotating zone transient (MRF)

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 22, 2019, 09:24
Default UDF for rotating zone transient (MRF)
  #1
New Member
 
Federico
Join Date: Jan 2017
Posts: 11
Rep Power: 9
FCTCD is on a distinguished road
Dear Colleagues,

I am at my first attempt on using UDF for my simulations. My target is to increase the rotational speed of a particular ZoneID (in Cell Conditions) every 120 time step with 10 iterations per time step. I wrote the following code, but I have few questions.
1 - Is the code correct for what I want to do?
2 - Should I write another udf for each different zoneID by changing the value specified (in my case 6, but in my simulation also 4 is rotating)
3 - I have a wall (impeller) in boundary conditions that I normally set at 0 constant rad/s relative do adjacent cells, should I write a UDF for that as well or it will change the rotational speed according to the cell zone authonomously?

Thanks in advance.

Code:
#include "udf.h"

#define Niter 1200 /*number of iterations per time step*/
#define omega_i 1250 */starting rotational speed*/
#define omega_f 1650 */final rotational speed*/
#define delta_omega */rot. speed increment per time step/*

DEFINE_ADJUST(mycode,domain){int zoneID; int iter = (nres==0)?(1):((int)count2[nres-1]);
float omega;
Thread *tc;

zoneID = 6;
tc = Lookup_Thread(domain,zoneID);
if ((iter%Niter)--0){omega = omega_i +(iter/Niter)*delta_omega;
	if (omega>omega_f) omega = omega_f;
	THREAD_VAR(tc).fluid.omega = omega;
	}

}
FCTCD 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
[Resolved] GPU on Fluent Daveo643 FLUENT 4 March 7, 2018 08:02
Rigid body motion on transient fluent mrf ghost82 EnSight 4 September 6, 2014 11:24
Should an empty MRF zone really induce this much cross-flow? sylvester OpenFOAM 5 November 18, 2010 03:48
parse error in transient udf spring FLUENT 1 July 6, 2010 06:26
Sliding mesh error Karl Kevala FLUENT 4 February 21, 2001 15:52


All times are GMT -4. The time now is 03:11.