Fluids

Fluids

Topics related to Fluent, CFX, Turbogrid and more.

Irregular waves from flap motion

    • Egnir1711
      Subscriber

      Hello,


      I am very new to ansys and trying to implement the flap type wavemaker. For my geometry the wavetank has height in Z direction and length in X direction and width in Y direction. I want a regular wave which i can validate through wave theory. Although as u can see from the result its irregular. I want to know if i am doing some mistake in code or is it the setting for dynamic mesh which is wrong.  Please provide me with some feedback for improving my wave through flap motion. Thank you 


      the code is as follows : #include "udf.h"
      #include "dynamesh_tools.h"

      static real period =2;
      static real amplitude = 0.1;
      static real pi = 3.14159265358979323846;

      DEFINE_CG_MOTION(oscillate,dt,vel,omega,time,dtime)
      {
          /* define the variables */
          Thread *t;
          face_t f;
          real dv, ang_freq;

          /* get the thread pointer for which this motion is defined */
          t = DT_THREAD(dt);
          ang_freq = 2 * pi / period;

         
          /* loop over each face in the zone to create an array of data */
          begin_f_loop(f,t)
          {
              /* set x-component of velocity */
              omega[1] = amplitude * cos(ang_freq * time) ;
          }
          end_f_loop(f,t)

          Message("time = %f, x_vel = %fn", time, omega[1]);
      }


       

    • Rob
      Forum Moderator

      Read up on how C code defines direction vectors:  what direction is omega[1] referring to? 

    • Egnir1711
      Subscriber

      omega[1] refers to the Y direction although as it is omega moves along Y axis and in forward and backward in x direction

    • Rob
      Forum Moderator

      You've lost me. How would the y component alter the position of the node in the x direction?

    • Egnir1711
      Subscriber

      I want the motion of the Flap in a way the it is applicable to my 3d model. Should I try to make two code for defining each direction?

    • Rob
      Forum Moderator

      Isn't all the flapping/motion in the x-direction?

    • Egnir1711
      Subscriber

      yeah i can make it vel[0] for motion although it act as pistion motion as I have taken face loop. I wanted to have flap motion so I chose omega but when taking omega[0] the motion is not like flap. So I choose omega[1] which relates to my model.

    • Rob
      Forum Moderator

      But y is parallel to the inlet? 

    • Egnir1711
      Subscriber

      In boundary condition I have just pressure outlet which is assigned to airopening. The motion is through UDF file which is assigned to rigid body piston.

Viewing 8 reply threads
  • The topic ‘Irregular waves from flap motion’ is closed to new replies.