|
[Sponsors] |
Oscillating liquid piston with known frequency and amplitude |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
July 8, 2018, 22:18 |
Oscillating liquid piston with known frequency and amplitude
|
#1 |
New Member
Beric Anissa
Join Date: May 2018
Posts: 5
Rep Power: 8 |
Hello,
I'm trying to modelize an oscillating liquid piston. I want to study the surface of the liquid according to the frequency and the amplitude of the piston. I need to use a dynamic mesh and create a sine motion for the piston. I want to use the following C code to program this motion: #include "udf.h" DEFINE_PROFILE(unsteady_velocity, thread, position) { face_t f; real t = CURRENT_TIME; begin_f_loop(f, thread) { F_PROFILE(f, thread, position) = 0.05*sin(3.14*t); } end_f_loop(f, thread) } However, I'm not sure of the units of the amplitude and the frequency I'm using. How can I know if 0.05 is in mm, cm, m ? Also my simulation is not working well and I haven't seen if the piston is really moving up and down following a sine wave. Is the code correct ? Thanks for your help |
|
July 9, 2018, 21:05 |
|
#2 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
Fluent uses SI base units and therefore length scales are in metres and time is in seconds. The DEFINE_PROFILE macro is used for changing flow variables such as velocity to impose on a boundary condition (e.g. inlet). The dynamic mesh uses a different set of macros, see "Dynamic Mesh DEFINE Macros" in the UDF manual for reference.
|
|
July 9, 2018, 23:27 |
|
#3 |
New Member
Beric Anissa
Join Date: May 2018
Posts: 5
Rep Power: 8 |
Thank you for your reply,
I've checked all the possible macros and maybe you think that DEFINE_CG_MOTION is more suitable to define a piston motion ? |
|
July 10, 2018, 00:25 |
|
#4 |
New Member
Beric Anissa
Join Date: May 2018
Posts: 5
Rep Power: 8 |
As I am working in 2D, if the piston motion is given by: y=A*sin(wt), the code will be:
#include "udf.h" DEFINE_CG_MOTION(piston_motion, dt, vel, omega, time, dtime) { real A, w, pi; pi = 3.14; NV_S(vel, =, 0.0); NV_S(omega, =, 0.0); A = 0.005; w = 2 * pi * 1; /* 1Hz frequency */ vel[0] = 0; vel[1] = A * sin(w*time); } Is that correct ? |
|
July 10, 2018, 05:39 |
|
#5 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
Is y a position or velocity? The DEFINE_CG_MOTION uses velocities. For an example of using this macro for a piston motion, see: CG Motion UDF Problem
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Amplitude spectrum of temperature fluctuations | selvam2487 | CFX | 0 | March 16, 2014 14:59 |
FSI oscillating plate | spatialtime | CFX | 4 | April 29, 2009 16:04 |
urgent! amplitude and frequency | Sheila | FLUENT | 3 | June 22, 2006 12:23 |