CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > FLUENT

monitoring of displacement during fall of a body

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

Reply
 
LinkBack Thread Tools Display Modes
Old   October 8, 2009, 01:03
Default monitoring of displacement during fall of a body
  #1
New Member
 
Deepti.R.Krrishnan
Join Date: Jun 2009
Posts: 4
Rep Power: 8
Deepti is on a distinguished road
hi,

i am using the tutorial for the 2d falling box. i want to get the displacement monitoring for the box. is it possible to get a plot of it in fluent as we get for pressure ,velocity etc...


thanks for all the inputs.

deepti
Deepti is offline   Reply With Quote

Old   October 8, 2009, 02:21
Default
  #2
Super Moderator
 
-mAx-'s Avatar
 
Maxime Perelli
Join Date: Mar 2009
Location: Switzerland
Posts: 2,964
Rep Power: 30
-mAx- will become famous soon enough
I assume you can only do that with UDF. (is the tutorial running with an udf?)
__________________
In memory of my friend Hervé: CFD engineer & freerider
-mAx- is offline   Reply With Quote

Old   October 8, 2009, 02:51
Default
  #3
New Member
 
Deepti.R.Krrishnan
Join Date: Jun 2009
Posts: 4
Rep Power: 8
Deepti is on a distinguished road
yes,i am using the cg udf. isnt the udf meant for giving properties to the physicals phenomenon? can i include the kind of solution that i need to extract? is it possible to define a custom function? i tried doing it. but i couldnt incorporate the flow time variable.

thank you for the inputs.
Deepti is offline   Reply With Quote

Old   October 8, 2009, 04:14
Default
  #4
Super Moderator
 
-mAx-'s Avatar
 
Maxime Perelli
Join Date: Mar 2009
Location: Switzerland
Posts: 2,964
Rep Power: 30
-mAx- will become famous soon enough
i don't know this tutorial, but cg udf sounds like "center of gravity". It should be an 6dof motion, so I assume you can extract the displacement in a file.
just like in this udf (no 6dof motion):
*********
#include <stdio.h>
#include "udf.h"
#if !RP_NODE
# define UDF_FILENAME "udf_loc_velo"
# define UDF_DATA "data.dat"
/* read current location and velocity from file */
static void
read_loc_velo_file (real *loc, real *velo)
{
FILE *fp = fopen(UDF_FILENAME, "r");
if (fp != NULL)
{
float read_loc, read_velo;
fscanf (fp, "%e %e", &read_loc, &read_velo);
fclose (fp);
*loc = (real) read_loc;
*velo = (real) read_velo;
}
else
{
*loc = 0.0;
*velo = 0.0;
}
}
/* write current location and velocity in file */
static void
write_loc_velo_file (real loc, real velo)
{
FILE *fp = fopen(UDF_FILENAME, "w");
if (fp != NULL)
{
fprintf (fp, "%e %e", loc, velo);
fclose (fp);
}
else
Message ("\nWarning: cannot write %s file", UDF_FILENAME);
}

/* write current location and velocity in datafile */
static void
write_data_file (real time, real loc, real velo, real force)
{
FILE *fp = fopen(UDF_DATA, "a+");
fprintf (fp, "%e %e %e %e\n", time, loc, velo, force);
fclose (fp);

}

#endif /* !RP_NODE */

DEFINE_ON_DEMAND(reset_velocity)
{
#if !RP_NODE
real loc, velo;
read_loc_velo_file (&loc, &velo);
write_loc_velo_file (loc, 0.0);
Message ("\nUDF reset_velocity called:");
#endif
}
DEFINE_CG_MOTION(valve, dt, cg_vel, cg_omega, time, dtime)
{
#if !RP_NODE
Thread *t = DT_THREAD (dt);
face_t f;
real force, loc;
#endif
real velo;
/* reset velocities */
NV_S (cg_vel, =, 0.0);
NV_S (cg_omega, =, 0.0);
if (!Data_Valid_P ())
return;
#if !RP_NODE
/* compute force on piston wall */
force = 0.0;
begin_f_loop (f, t)
{
real *AA;
AA = F_AREA_CACHE (f, t);
force += F_P (f, t) * AA[0];
}
end_f_loop (f, t)
# if RP_2D
if (rp_axi)
force *= 2.0 * M_PI;
# endif
read_loc_velo_file (&loc, &velo);
/* add in spring force */
# define K_SPRING 253.18
{
real init_disp = 0.02791;
real s_force = K_SPRING * (loc + init_disp);
force = force - s_force;
}
/* compute change in velocity */
{
real dv = dtime * force / 0.0217;
velo += dv;
loc += velo * dtime;
}
Message ("\nUDF valve: time = %f, x_vel = %f, force = %f, loc(m)= %f\n",
time, velo, force, loc);
write_loc_velo_file (loc, velo);
write_data_file (time,loc,velo,force);
#endif /* !RP_NODE */
#if PARALLEL
host_to_node_real_1 (velo);
#endif
cg_vel[0] = velo;
}
DEFINE_CG_MOTION(moving_fluid, dt, cg_vel, cg_omega, time, dtime)
{
#if !RP_NODE
Thread *t = DT_THREAD (dt);
face_t f;
real force, loc;
#endif
real velo;
/* reset velocities */
NV_S (cg_vel, =, 0.0);
NV_S (cg_omega, =, 0.0);
if (!Data_Valid_P ())
return;

#if !RP_NODE
read_loc_velo_file (&loc, &velo);
#endif /* !RP_NODE */
#if PARALLEL
host_to_node_real_1 (velo);
#endif
cg_vel[0] = velo;
}
__________________
In memory of my friend Hervé: CFD engineer & freerider
-mAx- is offline   Reply With Quote

Old   September 4, 2012, 03:31
Default
  #5
New Member
 
vahid
Join Date: Apr 2011
Posts: 4
Rep Power: 6
vahidss is on a distinguished road
Fluent user guide (6DOF) :
Note that you can also keep track of an object's motion history using the text user interface and by entering yes for the motion-history? text interface command.
define -> models -> dynamic-mesh-controls-> six-dof-parameter->
motion-history?
vahidss is offline   Reply With Quote

Reply

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
Monitoring Torque on rotating body in MRFSimpleFoam mahendra OpenFOAM Running, Solving & CFD 38 November 20, 2013 06:46
Free fall body simulation velan OpenFOAM Running, Solving & CFD 5 July 31, 2010 13:23
how to use Total Mesh Displacement for making a subject translating and rotating? snailstb CFX 3 September 16, 2009 04:06
Body force at the cell face Souviktor Fluent UDF and Scheme Programming 0 March 31, 2009 08:54
velocity of a body fall. th. viscous medium sohrab arora Main CFD Forum 3 September 11, 2001 22:33


All times are GMT -4. The time now is 20:23.