Fluids

Fluids

Topics related to Fluent, CFX, Turbogrid and more.

Udf for wall motion (dynamic mesh)

    • Luigi0
      Subscriber

      Hi,

      I have a simple channel with length = 2 mm, Height = 150 um. Inlet is a mass-flow inlet and the outlet is a pressure outlet. The liquid is water and the flow is laminar. The bottomwall (see picture) need to move up and down (along y) in order to generate pressure waves that propagate in y direction.

    • YasserSelima
      Subscriber
      Check that you selected angles in rad.n
    • YasserSelima
      Subscriber
      You can check mesh movement before starting the simulation.n
    • YasserSelima
      Subscriber
      One thing I would like to add. the frequency is very high ... to capture this fast movement, the time step should be 1e-07 or lessn
    • Luigi0
      Subscriber
      Thanks nThe time step is 1e-08. I have difficulties to check the mesh movement, because the displacement are very small. nI have checked the angles and they are in rad, but rotation are not present in my model.n
    • YasserSelima
      Subscriber
      Zoom on the wall while checking the moving mesh.n
    • DrAmine
      Ansys Employee
      Check averaged mesh y coordinate at bottom wall within a report definition n
    • YasserSelima
      Subscriber
      No I understand the reason. nThe amplitude is equal to (v0 / 2 pi f) ... hmmm 0.1 by almost 35 millions. I know the channels width is in microns, but does this amplitude sound right? n
    • Luigi0
      Subscriber
      The amplitude should be right, it is in the order of nanometres. I am confused regarding the dynamic mesh settings: I treated my wall with a rigid body motion, is it reasonable? nRegarding the report, I can create the report but I don't find the option averaged mesh y coordinate.n
    • YasserSelima
      Subscriber
      first, used double precision. second define all your variables as double instead of real. This increases the number of digits saved for any numbernthird define a global variable double my_bondary_location=0;n fourth add this at the end of your current function my_boundary_location += vely*dtime ;nfinally add this function to your codenDEFINE_REPORT_DEFINITION_FN(my_location)n{n treturn my_boundary_location;n}nNow you can find my_boundary_location to monitorn
    • YasserSelima
      Subscriber
      make it nreturn 10e09* my_boundary_location; n
    • Luigi0
      Subscriber
      Thanks for replying. I am new to Udf coding, after define_report_definition, what should I put in the parentesis?nI update my udf:n#include udf.hn#include dynamesh_tools.hnn#define freq = 5000000;n#define v0 = 0.1;ndouble my_boundary_location = 0;nnDEFINE_CG_MOTION(wall, dt, vel, omega, time, dtime) n{nNV_S (vel, =, 0.0);nNV_S (omega, =, 0.0);nnvely = v0*sin(2*M_PI*f*time);nvel[1] = vely;nmy_boundary_location += vely*dtime; n}nnDEFINE_REPORT_DEFINITION_FN(my_location)n{nreturn 10e-09*my_boundary_location;n}n
    • YasserSelima
      Subscriber
      report plot the variable my_location .. you should be able to monitor your wall location in manometers now,n
    • Luigi0
      Subscriber
      I think that I managed how to report plot of the wall location, but it seems that doesn't move. The curve is always showing zero value.nn
    • YasserSelima
      Subscriber
      try using cosine function instead of the sine. So, you get higher velocity at the beginning n
    • YasserSelima
      Subscriber
      You can add this to the function as well nMessage(
      velocity = %f, displacement = %f, 1000*vely , 1e9*my_boundary_location);nThis should print the velocity and displacement every timestepn
Viewing 15 reply threads
  • The topic ‘Udf for wall motion (dynamic mesh)’ is closed to new replies.