|
[Sponsors] | |||||
|
|
|
#21 |
|
Senior Member
|
||
|
|
|
|
|
|
|
#22 |
|
New Member
mecamor
Join Date: Jul 2011
Posts: 23
Rep Power: 3 ![]() |
I modeled the cylinder come a rectangle. and also as a piston rectanble. I left a bit of space between the piston and the cylinder. bopundary conditon as I put Moving wall for the piston but still. I'm fluent again. Amir Please do you can give me more detail
thanks you |
|
|
|
|
|
|
|
|
#23 |
|
New Member
mecamor
Join Date: Jul 2011
Posts: 23
Rep Power: 3 ![]() |
Dera amir I put dynamic mesh for the piston or the fluid
|
|
|
|
|
|
|
|
|
#24 |
|
Senior Member
|
The easiest way for you is writing a UDF for the piston and hook to to the piston and with appropriate setting in dynamic mesh panel (smoothing & re-meshing) change the fluid zone cells. it's also better to take a look over manual.
Amir |
|
|
|
|
|
|
|
|
#25 | |
|
New Member
mecamor
Join Date: Jul 2011
Posts: 23
Rep Power: 3 ![]() |
Quote:
I wrote the UDF of the piston, but when compiling with C 13 or it Fluent There's an error in line 3. How I should do. thank you Error: C:\Program Files\ANSYS Inc\v130\fluent\ntbin\win64\PISTON2.c: line 3: parse error. How I should do. thank you #include "udf.h" #include "dynamesh_tools.h" static real v_prev= 0.0; DEFINE_CG_MOTION(piston, dt, vel, omega, time, dtime) { Thread *t; face_t f; real NV_VEC (A); real force, dv; /* reset velocities */ NV_S (vel, =, 0.0); NV_S (omega, =, 0.0); if (!Data_Valid_P ()) return; /* get the thread pointer for which this motion is defined */ t = DT_THREAD ((Dynamic_Thread *)dt); /* compute pressure force on body by looping through all faces */ force = 0.0; begin_f_loop (f, t) { F_AREA (A, f, t); force += F_P (f, t) * NV_MAG (A); } end_f_loop (f, t) /* compute change in velocity, i.e., dv= F * dt/ mass; velocity update using explicit eulerformula */ dv= dtime* force / 50.0; v_prev+= dv; CX_Message ("time = %f, x_vel= %f, force = %f\n", time, v_prev, force); /* set x-component of velocity */ vel[0] = v_prev; } |
||
|
|
|
||
|
|
|
#26 | |
|
Senior Member
|
Quote:
It doesn't have any error while compiling; try VC++ instead. |
||
|
|
|
||
|
|
|
#27 |
|
New Member
mecamor
Join Date: Jul 2011
Posts: 23
Rep Power: 3 ![]() |
||
|
|
|
|
|
|
|
#28 |
|
Member
Alberto Pellegrino
Join Date: Jan 2011
Posts: 32
Rep Power: 4 ![]() |
Hi,
follow this: http://www.cfd-online.com/Wiki/Fluen...with_Fluent_13 You will find how to set Visual C++ to compile UDF, and how to open Fluent depending on the OS you have (32 or 64 bit). Regards |
|
|
|
|
|
|
|
|
#29 |
|
Member
Alberto Pellegrino
Join Date: Jan 2011
Posts: 32
Rep Power: 4 ![]() |
Hi Amir,
sorry for my delay. Just wanted to thank you for your support. Now it's working...but you need to hook UDF only to the grid you want to move. Only in that way I don't get a negative volumes error. Regards Alberto |
|
|
|
|
|
|
|
|
#30 |
|
New Member
mecamor
Join Date: Jul 2011
Posts: 23
Rep Power: 3 ![]() |
hello
I work with windows 7. how to build the library udf. and when I compile my udf fluent that he lacks nmake. |
|
|
|
|
|
|
|
|
#31 |
|
Member
Alberto Pellegrino
Join Date: Jan 2011
Posts: 32
Rep Power: 4 ![]() |
Hi,
as I said above, you only need to follow the instructions given on that answer (http://www.cfd-online.com/Wiki/Fluen...with_Fluent_13). I had the same problem (lack of nmake). And I use Win 7 as well. Mind to open Fluent from SDK command prompt. regards |
|
|
|
|
|
|
|
|
#32 |
|
Member
Vidit Sharma
Join Date: Aug 2012
Location: Delhi, India
Posts: 32
Rep Power: 2 ![]() |
hi,
I am trying to move a 2d cylinder in y direction by using UDF:- # include "udf.h" # include "dynamesh_tools.h" DEFINE_CG_MOTION(pump,dt,cg_vel,cg_omega,time,dtim e) { Thread *t; real freq_t; NV_S(cg_vel,=,0.0); if(!Data_Valid_P()) return; freq_t = 0.01; t= DT_THREAD((Dynamic_Thread*)dt); cg_vel[0] = 0.0; cg_vel[1] = freq_t; } But I am having a problem while compiling it in Visual Studio Command Prompt. While executing nmake command to compile an error is appearing which is saying NMAKE : fatal error U1077: "sed" :return code '0X1' can anybody tell how to eliminate this error???? ![]() ![]() Thank You Regards Vidit Sharma |
|
|
|
|
|
|
|
|
#33 |
|
New Member
samrat himvanth nanduri
Join Date: May 2012
Posts: 21
Rep Power: 3 ![]() |
Hi everyone,
I want some help regarding an issue i'm facing. I need to write a UDF for rotating an O Grid. To be precise we can rotate using GUI MESH - ROTATE and solve it. But i need to do the same using an UDF. For example i need to rotate the whole domain by 8 deg I give that value in the UDF and the grid gets rotated. Can some1 help me out regarding this. Thanks in advance, sam. |
|
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| UDF to change Rotation Speed in a MRF simulation | Mike | FLUENT | 3 | September 27, 2011 06:46 |
| UDF CG_MOTION rotation dynamic mesh | Mads | FLUENT | 1 | August 1, 2010 02:05 |
| UDF for a sinusoidal rotation of an airfoil | Lorenzo | FLUENT | 2 | October 10, 2008 10:37 |
| UDF for CG rotation | araz | FLUENT | 0 | January 2, 2005 01:12 |
| UDF for solid body rotation | araz | FLUENT | 0 | October 7, 2004 11:57 |