|
[Sponsors] |
monitoring of displacement during fall of a body |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 8, 2009, 02:03 |
monitoring of displacement during fall of a body
|
#1 |
New Member
Deepti.R.Krrishnan
Join Date: Jun 2009
Posts: 4
Rep Power: 17 |
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 |
|
October 8, 2009, 03:21 |
|
#2 |
Super Moderator
Maxime Perelli
Join Date: Mar 2009
Location: Switzerland
Posts: 3,297
Rep Power: 41 |
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 |
|
October 8, 2009, 03:51 |
|
#3 |
New Member
Deepti.R.Krrishnan
Join Date: Jun 2009
Posts: 4
Rep Power: 17 |
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. |
|
October 8, 2009, 05:14 |
|
#4 |
Super Moderator
Maxime Perelli
Join Date: Mar 2009
Location: Switzerland
Posts: 3,297
Rep Power: 41 |
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 |
|
September 4, 2012, 04:31 |
|
#5 |
New Member
vahid
Join Date: Apr 2011
Posts: 4
Rep Power: 15 |
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? |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Monitoring Torque on rotating body in MRFSimpleFoam | mahendra | OpenFOAM Running, Solving & CFD | 41 | March 18, 2019 22:08 |
Free fall body simulation | velan | OpenFOAM Running, Solving & CFD | 5 | July 31, 2010 14:23 |
how to use Total Mesh Displacement for making a subject translating and rotating? | snailstb | CFX | 3 | September 16, 2009 05:06 |
Body force at the cell face | Souviktor | Fluent UDF and Scheme Programming | 0 | March 31, 2009 09:54 |
velocity of a body fall. th. viscous medium | sohrab arora | Main CFD Forum | 3 | September 11, 2001 23:33 |