-
-
June 25, 2018 at 11:51 am
gowthamdada
SubscriberHow to write a UDF for pressure driven flow under dynamic mesh conditions?
Inlet pressure used to push the pig by that i have to find velocity of pig.
Here i have attached picture for your view.
-
June 26, 2018 at 1:09 am
Karthik R
AdministratorHello,
Please refer to the UDF manual for details on how to write the UDF. I generally tend to use an already written UDF from the manual and modify to serve my purpose (rather than starting from scratch).
Btw, what are planning on doing with your UDF? Just curious.
Best Regards,
Karthik
-
June 30, 2018 at 1:43 pm
gowthamdada
Subscriber/************************************************************
* compiled UDF
************************************************************/
#include "udf.h"
static real v_prev = 0.0;
static real time_prev = 0.0;
DEFINE_CG_MOTION(pig,dt1,dt2,vel,time,dtime)
{
Domain *d;
Thread *t1;
Thread *t2;
d = Get_Domain(1);
int ID1 = 16; int ID2 = 17;
t1 = Lookup_Thread(d, ID1);
t2 = Lookup_Thread(d, ID2);
face_t f;
real NV_VEC(A);
real force,force1,force2, dv;
/* reset velocities */
NV_S(vel, =, 0.0); /* scalar vel[0] = 0.0*/
if (!Data_Valid_P())
return;
/* get the thread pointer for which this motion is defined
t1 = DT_THREAD(dt1);
t2 = DT_THREAD(dt2);*/
/* compute pressure force on body by looping through all faces */
force = 0.0;
force1=0.0;
force2=0.0;
/*Fc = (2*3.14*5*0.25*10106000*0.3)/(1-0.33);*/ /*contact force= 2*pi*lp*del*E*mu/(1-nu) */
begin_f_loop(f,t1)
{
F_AREA(A,f,t1);
force1 += F_P(f,t1) * A[0];
}
end_f_loop(f,t1)
begin_f_loop(f,t2)
{
force2 += F_P(f,t2) * A[0];
}
end_f_loop(f,t1)
force = force1-force2;
/* compute change in velocity, i.e., dv = F * dt / mass - Fc*dt /mass
velocity update using explicit Euler formula */
dv = (time * force / 50.0);/*- (Fc*time / 50.0);*/
if (time > (time_prev + EPSILON))
{
v_prev += dv;
time_prev = time;
}
Message ("time = %f, x_vel = %f, force = %fn", time, v_prev,force);
/* set x-component of velocity */
vel[0] = v_prev;
}
this is what i tried... but i cant able to pick results.. whats problem on this
-
July 1, 2018 at 11:26 am
Raef.Kobeissi
SubscriberHello,
Why is your UDF very complicated? for transient pressure inlet boundary condition, the UDF is simple. You can also write to file the velocity of the solid object:
https://www.youtube.com/watch?v=Y52rqqSTUHM
https://www.youtube.com/watch?v=LQ2y0sIXgio
https://www.youtube.com/watch?v=8NIOC8Nl91E
Regards -
September 14, 2018 at 5:08 pm
gowthamdada
SubscriberSir,
I used the same. but i gave one translation in that 6-dof dialogue box and created dynamic mesh using layering technique but it's not working.
Kindly help me further
-
- You must be logged in to reply to this topic.

Boost Ansys Fluent Simulations with AWS
Computational Fluid Dynamics (CFD) helps engineers design products in which the flow of fluid components is a significant challenge. These different use cases often require large complex models to solve on a traditional workstation. Click here to join this event to learn how to leverage Ansys Fluids on the cloud, thanks to Ansys Gateway powered by AWS.

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.

Ansys Blog
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
- Floating point exception in Fluent
- What are the differences between CFX and Fluent?
- Heat transfer coefficient
- Getting graph and tabular data from result in workbench mechanical
- Difference between K-epsilon and K-omega Turbulence Model
- The solver failed with a non-zero exit code of : 2
- Time Step Size and Courant Number
- Mesh Interfaces in ANSYS FLUENT
- error: Received signal SIGSEGV
-
5290
-
3311
-
2471
-
1308
-
1016
© 2023 Copyright ANSYS, Inc. All rights reserved.