-
-
October 18, 2017 at 2:47 pm
sdarmayuda
SubscriberHallo,
I'm quite new and still learning this program ANSYS 17.2 academic version. I'm trying to simulate a hydrodynamic coupling. It consists of two part, Pump side and Turbine side (A screenshoot of the model is available). The rotational velocity of the pump side is constant. The rotational velocity of the turbine side is changing in respect of time and depends on the value of the working torque (from the fluid to the turbine's blade).
I've made a plane on my turbine's geometry and the working torque (Moment) on the turbine can displyed using 'monitors' and 'reports'.
And now I'm going to use this value, so the turbine's rotational velocity can change in respect of time.
1. How can I Import this value into my UDF? Which variable are used in this case?
2. And will this UDF File be read in every Iteration? Or will it be just be read once? I dont know if I should put the looping here.
3. While I was trying to Interpret my UDF File, this warning came 'line 23: structure reference not implemented'. Can someone Show/tell me the mistakes?
Here is my UDF File.
***********************************************************
#include "udf.h"
#define Niter 25 /* iteration update interval */
#define omg_ts 0.0 /* starting omega */
#define omg_tf 600.0 /* final omega */
#define Jt 0.000554 /* Moment Inertia of the Turbin*/
DEFINE_ADJUST(testudf,d)
{
int zoneID;
int iter = (nres==0)?(1)(int)count2[nres-1]);
float omgt;
Thread *tc;
zoneID = 2;
tc = Lookup_Thread(d,zoneID);
if ( (iter%Niter)==0 )
{
del_omgt = Mt/Jt;
omgt = omg_ts + del_omgt*(iter/Niter);
if ( omgt > omg_tf ) omgt = omg_tf;
THREAD_VAR(tc).fluid.omega = omgt;
}
}
************************************************************
I'm new and therefore I really appreciate any Reply and any help. Thanks in advance.
Best regards,
Darma Yuda
-
November 7, 2017 at 2:45 pm
sdarmayuda
SubscriberI have once again adjusted my UDF. But still I can't find a way to retrieve the value of the working torque. Can someone give me a hint about this? Thank you very much
************************************************************************************
#include "udf.h"
DEFINE_TRANSIENT_PROFILE(testudf,CURRENT_TIME)
{
real omega_ts=0.0; /*starting omega*/
real omega_tf=600.0; /*final omega*/
real Jt=0.000554; /*Moment Inertia of the Turbin*/
real delta_t=0.0001; /*delta t simulation*/
real CURRENT_TIMESTEP;
real CURRENT_TIME;
real alpha_t; /*angular acceleration*/
Thread *t;
cell_t c;
t=Lookup_Thread(d,9); /*Zone ID = 9*/
begin_c_loop (c,t)
{
alpha_t= Mt/Jt; /*M = J*alpha, but how can I retrieve the value of Mt?*/
omega_ts+=alpha_t*CURRENT_TIMESTEP;
if (omega_ts > omega_tf)
{omega_ts = omega_tf;}
THREAD_VAR(t).fluid.omega=omega_ts; /*I'm also not sure about this syntax or macro*/
}
end_c_loop (c,t)
}
-
November 22, 2017 at 12:37 pm
sdarmayuda
SubscriberHallo everyone,
I have found how to retrieve the torque from Fluent. However, there is still error in the code after I intepreted the UDF code. it says "line 14: parse error". I think it is about the macro DEFINE_TRANSIENT_PROFILE. Can somebody help to show me the mistakes about this macro? Thank you very much.
Here is my UDF Code:
**************************************************************************
#include "udf.h"
DEFINE_ON_DEMAND(wall_forces)
{
Domain * domain = Get_Domain (1); /* For multiphase flow, you need to set the Sub domain */
Thread *t;
real CG[3], force[3], moment[3];
t = Lookup_Thread (domain, 13); /* 13 is the ID of the wall to be determined. */
NV_S (CG, =, 0.0); /* coordinates of the center position to find the moment. */
Compute_Force_And_Moment (domain, t, CG, force, moment, TRUE);
Message("f=(%e, %e, %e), m=(%e, %e, %e)n", force[0], force[1], force[2], moment[0], moment[1], moment[2]);
/* force [0], force [1], force [2] are respectively x, y, z-direction forces, Is the sum of the force by the force and the shear stress due to pressure. */
}
DEFINE_TRANSIENT_PROFILE(testudf, CURRENT_TIME)
{
real omega_ts=0.0; /*starting omega*/
real omega_tf=600.0; /*final omega*/
real Jt=0.000554; /*Moment Inertia of the Turbin*/
real delta_t=0.0001; /*delta t simulation*/
real CURRENT_TIMESTEP;
real CURRENT_TIME;
real alpha_t; /*angular acceleration*/
Thread *t;
cell_t c;
t=Lookup_Thread(domain,9); /*Cell Zone ID = 9*/
begin_c_loop (c,t)
{
alpha_t= 15*moment[0]/Jt; /*there are 15 blades, x axis as rotation axis*/
omega_ts+=alpha_t*CURRENT_TIMESTEP;
if (omega_ts > omega_tf)
{omega_ts = omega_tf;}
THREAD_VAR(t).fluid.omega=omega_ts;
}
end_c_loop (c,t)
}
-
- 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.
- Floating point exception in Fluent
- What are the differences between CFX and Fluent?
- Heat transfer coefficient
- Difference between K-epsilon and K-omega Turbulence Model
- Getting graph and tabular data from result in workbench mechanical
- The solver failed with a non-zero exit code of : 2
- Time Step Size and Courant Number
- Mesh Interfaces in ANSYS FLUENT
- Suppress Fluent to open with GUI while performing in journal file
- error: Received signal SIGSEGV
-
8750
-
4658
-
3151
-
1678
-
1452
© 2023 Copyright ANSYS, Inc. All rights reserved.