June 10, 2018 at 11:48 pmrshukla786Subscriber
i have to provide the motion to two pistons inside cylinder in fluent. two cylinders are connected via a pipe. how to write udf to give motion to both the pistons. I attached the 2D geometry made in ansys 19 modeler. Please help me in to move both the piston and also help me writing the udf its very urgent. I am attaching the image also which I imported in fluent.
June 11, 2018 at 7:28 amKeyur KanadeAnsys Employee
You can do it by using profile or by using udf.
For profile, please see following link.
For udf, you may need to use define_cg_motion macro. Please check its details at following link.
June 11, 2018 at 10:50 amrshukla786Subscriber
thanx for the reply Keyur. the prroblem I am facing is that both pistons have to provide the motion simultaneously. I have got one udf but getting negative volume cell error, I am not familiar very much about udf . This is udf I am using for both pistons but not getting results. There is no compilation error. I am attaching both the udf here you check what modification is required its very urgent please help. I am writing the udf in mthe next reply post, please go through and help if possible.
June 11, 2018 at 10:52 amrshukla786Subscriber
UDF for piston 1
#define r 0.005 /* i n m et e r */
#define l .03850 /* i n m et e r */
#define omega_0 41.88790205 /* Constant rpm for cranking */
#define I 0.000008596 /* Mass moment of Inertia kg m^2 */
#define A_1 0.00557923 /* Area of P i s t o n */
#define A_2 0.00204 /* Area of P i s t o n */
static real th_n=0.715584993;
static real omega_n=0;
return; /* Donot compute force if the solution is not initialized */
t = DT_THREAD (dt);
/* get the thread pointer(dt) corresponding to piston p1 for which the motion is defined */
/* Compute for ce on thr piston p1 using pressure and area */
Pressure = F_P(f,t);
force1 = -(Pressure-101325)*A_1 ;
omega_n = omega_0;
th_np1 = th_n+omega_n*dtime;
omega_np1 = omega_n+Pressure*r*dtime/I*(A_1*sin(th_n)+A_2*sin(th_n+100*M_PI/180)) ;
vel = - r*sin(th_n)*(1+r*cos(th_n)/stroke)*(th_np1 -th_n)/dtime;/* Specify y velocity for piston 1*/
th_n = th_np1;
June 12, 2018 at 6:27 amKeyur KanadeAnsys Employee
Along with udf, you need to select correct smoothing, remeshing, laryering options in dynamic mesh. Usually negative volume comes because of wrong remeshing settings.
Please check following for general information about dynamic mesh.
June 13, 2018 at 9:31 amrshukla786Subscriber
@keyur I tried everything its not moving. I have to complete this project otherwise i will not get my degree. Please help me. my whatsapp no is 8171385762
June 13, 2018 at 2:46 pmKeyur KanadeAnsys Employee
What kind of mesh you are using? Is it tri or quad? Please use structured quad mesh with which you can effectively use layering option in dynamic mesh.
You may want to check
Other users can chime in to check your udf.
June 14, 2018 at 6:36 amrshukla786Subscriber
okay i will try, i was using triangular till now.
- You must be logged in to reply to this topic.
Simulation World 2022
Check out more than 70 different sessions now available on demand. Get inspired as you hear from visionary companies, leading researchers and educators from around the globe on a variety of topics from life-saving improvements in healthcare, to bold new realities of space travel. Take a leap of certainty and check out a session today here.
Earth Rescue – An Ansys Online Series
The climate crisis is here. But so is the human ingenuity to fight it. Earth Rescue reveals what visionary companies are doing today to engineer radical new ideas in the fight against climate change. Click here to watch the first episode.
Subscribe to the Ansys Blog to get great new content about the power of simulation delivered right to your email on a weekly basis. With content from Ansys experts, partners and customers you will learn about product development advances, thought leadership and trends and tips to better use Ansys tools. Sign up here.
- Suppress Fluent to open with GUI while performing in journal file
- Heat transfer coefficient
- What are the differences between CFX and Fluent?
- Floating point exception in Fluent
- The solver failed with a non-zero exit code of : 2
- Getting graph and tabular data from result in workbench mechanical
- Difference between K-epsilon and K-omega Turbulence Model
- Time Step Size and Courant Number
- Mesh Interfaces in ANSYS FLUENT
- error in cfd post
© 2022 Copyright ANSYS, Inc. All rights reserved.