CFD Online Logo CFD Online URL
Home > Forums > Fluent UDF and Scheme Programming

DEFINE_ADJUST not working properly

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

LinkBack Thread Tools Display Modes
Old   April 18, 2011, 10:09
Exclamation DEFINE_ADJUST not working properly
New Member
Join Date: Jan 2010
Location: United Kingdom
Posts: 27
Rep Power: 7
akm is on a distinguished road
as i understand define_adjust can be "used to adjust or modify FLUENT
variables that are not passed as arguments
in my 3phase eularian simulation i am required to modify the volume fractions of the two secondary phases, keeping the volume of primary phase same.

i have done the calculation as required in define_execute_at_end, to compute how much do the volume fractions change and hence correctly computed the value of global variables 'vf1' and 'vfpr'.

my adjust macro:

  Thread *t;
  cell_t c;
  real volf1, volf2, volf3;
  real xc[ND_ND];

  if (counter == 1)
         Thread *fr = THREAD_SUB_THREAD(t,1);  //1st secondary phase
	 Thread *to = THREAD_SUB_THREAD(t,2); //2nd secondary phase
	  volf1 = C_VOF(c,fr);
	  volf2 = C_VOF(c,to);
	  volf3 = 1-(volf1+volf2);  //primary phase volume frac.

	  if(volf1 > 0.01)
	    C_VOF(c,fr) = volf1 * vf1/vfpr;  //modifying the of 1st sec. phase
	    volf1 = C_VOF(c,fr);
	    C_VOF(c,to) = 1-(volf1+volf3);  //adjusting the vol. fr. of 2nd sec. phase, keeping the sum of volume fractions unity.
	    volf1 = C_VOF(c,fr);
	    volf2 = C_VOF(c,to);

	    Message("\t%g   %g\n",volf1,volf2);


When the variables are printed from the udf, they do seem to get modified as required by the problem. But returning to solver at the end of iteration/timestep, the variables show no change when viewed as contours or even when accessed by define_execute_at_end macro.

What might be the problem in modifying the variables ??
Is there anything wrong in what i am trying to do? Please suggest an alternative.

Can anyone please help me..

akm is offline   Reply With Quote


adjust, c_vof, define_adjust, udf, volume fraction

Thread Tools
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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Flapping wing rotation in Fluent 3D not working properly davesmith_01 FLUENT 1 February 13, 2011 22:35
Slip BC not working properly lfbarcelo OpenFOAM 3 July 15, 2010 09:53
Sample utility not working properly titio OpenFOAM 2 June 9, 2010 10:45
MultiComponenMixturecellMixture not working properly dominik_christ OpenFOAM Running, Solving & CFD 1 August 6, 2008 04:25
Working Principle of Micro-Oven aero CD-adapco 2 January 31, 2007 06:00

All times are GMT -4. The time now is 01:58.