# UDF for sloshing

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

 March 6, 2009, 11:35 UDF for sloshing #1 Alamedda Guest   Posts: n/a Sponsored Links Hi every one , I'm modeling a sloshing of a rectangular tank on FLUENT 6.3 and I kind of need some help for the UDF defining it. I want to simulate the sloshing from A to Z and and I'm facing problems in defining the source terms, the unsteady iteration, and what equations i need to activate. on the experimental side, My tank is doing sinusoidal movements (right/left and up/down). My biggest problem is the UDF. Mine is the following : #include "udf.h" #include "stdio.h" double x[ND_ND]; double PI=3.14159; real thetamax = (4*3.14159*2)/360; real frequence = 0.50 ; real phi=0; DEFINE_SOURCE(xmom_source, c, t, dS, eqn) { real temps; real omega, deromega; real source_x; temps = CURRENT_TIME; C_CENTROID (x, c, t); omega = thetamax*sin(temps*(2*PI)*frequence + phi); deromega = thetamax*(frequence*(2*PI))*cos(temps*frequence*(2 *PI) + phi); source_x = C_R(c,t)*(-9.8*sin(omega*temps)-x[1]*deromega-C_V(c,t)*omega-2*pow(omega, 2)*(x[0]-0.2)); dS[eqn] = 0; return source_x; } DEFINE_SOURCE(ymom_source, c, t, dS, eqn) { real temps; real omega, deromega; real source_y; temps = CURRENT_TIME; C_CENTROID (x, c, t); omega = thetamax*sin(temps*(2*PI)*frequence + phi); deromega = thetamax*(frequence*(2*PI))*cos(temps*frequence*(2 *PI) + phi); source_y = C_R(c,t)*(-9.8*cos(omega*temps)+(x[0]-0.2)*deromega+C_U(c,t)*omega-2*pow(omega, 2)*x[1]); dS[eqn] = 0; return source_y; } Thank you for responding.

 November 13, 2013, 02:29 hii #2 New Member   Puneet Join Date: Sep 2013 Posts: 13 Rep Power: 5 hii,did u get solution for ur problem, i also need help regarding same and i m also not able to create udf plz help me

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post modisa FLUENT 0 April 24, 2008 15:36 Lin FLUENT 1 September 7, 2007 06:11 Prabodh FLUENT 0 May 1, 2006 09:36 Zaher CFX 8 March 27, 2004 18:02 baned FLUENT 0 September 19, 2003 03:53