|
[Sponsors] |
February 22, 2019, 10:24 |
UDF for rotating zone transient (MRF)
|
#1 |
New Member
Federico
Join Date: Jan 2017
Posts: 11
Rep Power: 9 |
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; } } |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Resolved] GPU on Fluent | Daveo643 | FLUENT | 4 | March 7, 2018 09:02 |
Rigid body motion on transient fluent mrf | ghost82 | EnSight | 4 | September 6, 2014 12:24 |
Should an empty MRF zone really induce this much cross-flow? | sylvester | OpenFOAM | 5 | November 18, 2010 04:48 |
parse error in transient udf | spring | FLUENT | 1 | July 6, 2010 07:26 |
Sliding mesh error | Karl Kevala | FLUENT | 4 | February 21, 2001 16:52 |