Fluids

Fluids

Can anyone help me step by step to compiling a UDF for a single dof system?

    • sugarl14
      Subscriber

      I have a wave energy converter that I am modeling that consists of a flap that is hinged to the sea floor, only allowing rotation (see general idea below)

    • YasserSelima
      Subscriber

      Hopefully this helps

      ">click here
  • Rob
    Ansys Employee
    Check you have the correct version of VS too, R18 was released in about 2017 so you'll want 2015 or earlier as an educated guess: we're typically using a VS version that's out when we start the coding cycle, because of differences in release cycles that means picking a version that's 2-3 version years older.
  • sugarl14
    Subscriber
    Thank you and for your responses.Let me back up a little bit and ask another question..Since my UDF is very simple (i.e. I'm only constraining the motion to be rotation about the Y-axis and specifying a damping value), could I just use an interpreted UDF instead of compiled UDF? Or even simpler, could I just utilize the Six DOF Properties tool in Fluent (see below) instead of using a UDF altogether?To reiterate, all I am trying to do is 3D model a wave energy converter (the inverted pendulum pictured above) that rotates only about the y-axis. I'd like to specify damping value (15,000 Nm/rad), and reference angle constraints (-30 to +30 degrees). I am looking for the simplest way to do this in dynamic meshing.Thank you again for your help!
  • Rob
    Ansys Employee
    The interpreted UDFs don't allow all of the macros to be used. With out reading the manual, I can't remember if that includes the mesh motion ones: I'm fairly sure it does.
  • YasserSelima
    Subscriber
    Dynamic mesh macros must be compiled
  • sugarl14
    Subscriber
    and thank you both for your involvement with my question.nI was able to successfully load and compile the UDF. As I mentioned previously, my situation involves a pendulum-like motion. The point of rotation that I am interested in is at [0 0 -3.3] meters but the CG of the device is at [0 0 -1.28] meters. nSince I am very new to UDFs, how would I define the motion of the flap to rotate about its hinge at [0 0 -3.3] rather than at its CG at [0 0 -1.28]? Would I specify that in the UDF? If so, how should the code be typed?.
  • YasserSelima
    Subscriber
    search the manual for SDOFO_CENTER_ROT, or something close, macro. This is to determine the center of rotation ... Also you need to restrict the motion to 1 dimension. There are three examples in the manual for SDOF .. look at them
  • sugarl14
    Subscriber
    Thank you. I have completed the part that only allows rotation about the y-axis, but I will look into the SDOF_CENTER_ROT macro and let you know if I run into any more issues. Thank you!
  • YasserSelima
    Subscriber
    nLook at this thread ... case that is very close to yoursnhttps://forum.ansys.com/discussion/22364/define-sdof-properties#latestn
  • sugarl14
    Subscriber
    Thank you for the reply. So in this example from the thread link you posted:nSDOFO_CENTER_ROT(sdof_obj)[0] = 6.0;  /* only needed for one DOF rotation */nSDOFO_CENTER_ROT(sdof_obj)[1] = 1.1938;  /* only needed for one DOF rotation */nSDOFO_CENTER_ROT(sdof_obj)[2] = 0.0;  /* only needed for one DOF rotation */nnthe [0], [1], and [2] parts correlate to the X, Y, and Z direction?.Furthermore, the 6.0, 1.1938, and 0.0 value refer to the coordinates? (i.e. [6 1.1938 0] meters?)n
  • YasserSelima
    Subscriber
    I believe so, but check the manual n
  • sugarl14
    Subscriber
    I couldn't find this in the manual for Fluent V 18.1. Is this macro only something for Fluent 2020 R2?n
  • Rob
    Ansys Employee
    Probably not new to 2021R1 but we do expand the documentation with the release cycle so you can find older/newer versions have different examples and more/less macros explained. n
  • sugarl14
    Subscriber
    Hi Arraythank you for your response!nnSo does that mean the macro SDOFO_CENTER_ROT(sdof_obj)[0] is or is not available in Fluent version 18.1?n
  • Rob
    Ansys Employee
    It means it may not be in the documentation; I would be surprised if it wasn't in the code but without checking I don't know. What happens when you use it? Note, R18 is now around 5 years old so you really need to update to get the latest technology. n
  • YasserSelima
    Subscriber
    example 3 in the UDF manualnfor some reason I have it in the pdf but I can't find it online nn
  • Rob
    Ansys Employee
    R18 would have had a local install of help. n
  • sugarl14
    Subscriber
    and nThank you for your help. I will try this out and let you know if it works in R18. I was able to get ANSYS 2021 R1 also so if it does not work in R18 I'll move to version 2021n
  • YasserSelima
    Subscriber
    this is taken from 2020 R2 manual ...n
  • Viewing 19 reply threads
    • You must be logged in to reply to this topic.