Fluids

Fluids

Compute force and moment in your UDF

    • YasserSelima
      Subscriber
      Hello, nAs I see many questions regarding calculating force and/or moment on a rigid body, I would like to share my experience with a non-documented function defined in wall.h. The function is Compute_Force_And_Moment .For some mysterious reason, the function is not documented in the UDF manual .. but the theory guide includes the equations for calculating the force and moment on a wall. First you need to get the domain .. only one domain in single phase. If you have two phase flow, calling this with domain(2) will get the forces of the fluid defined as domain (2) ... (3) for the forces of fluid defined in domain 3. I tested this and the sum is equal to the mixture domain force (domain 1). Get the domain by:nDomain *d = Get_Domain(1);  nThen get the pointer on the thread you want to calculate force/ moment on. ID is an integer which you get from the boundary conditions. Say turbine_wall, you will find its id number listednThread *t_object = Lookup_Thread(d, ID);nnow make placeholders for the variablesndouble force[ND_ND], moment[ND_ND], cg[ND_ND];nNow call the function ... TRUE is when you call it by HOST and NODES ... FALSE when you call it by NODES only. nCompute_Force_And_Moment (d,t_object,cg,force,moment,TRUE);nnow force[0] , force[1] and force[2] if you have 3D, are the forces in the x, y and z directions.nsame for moment[0] .... etc.
    • Keyur Kanade
      Ansys Employee
      Thank you!nnRegards,nKeyurnHow to access Ansys Online Help DocumentnHow to show full resolution imagenGuidelines on the Student CommunitynHow to use Google to search within Ansys Student Communityn
    • wcj1n18
      Subscriber
      Thanks so much for taking the time to explain this, it's very useful for me!n
    • DrAmine
      Ansys Employee
      If not documented, so there must be reasons for that decision. As non-documented we, Ansys Staff, won't comment on thread or cases deploying it.n
Viewing 3 reply threads
  • The topic ‘Compute force and moment in your UDF’ is closed to new replies.