Ansys AQWA user_force subroutine

Discussion in 'Software' started by jasonlou, Mar 5, 2013.

  1. jasonlou
    Joined: Mar 2013
    Posts: 4
    Likes: 0, Points: 0, Legacy Rep: 10
    Location: Oregon

    jasonlou New Member

    I am modeling a wave energy convertor using AQWA. The power take off is modeled as a damping system between two strucutres. I want to calculate the damping force using the external subroutine function of AQWA. AQWA has given a sample subroutine in both fortran and c language. I tried to compile the subroutine directly, but the generated dll file could not be used in AQWA. I have used both fortran and c compiles, such as gfortran, visual studio C++. My questions is: Are there any part missing in the sample subroutine? Does anyone have the experience of using the user_force.dll in AQWA?
     
  2. CWTeebs
    Joined: Apr 2011
    Posts: 232
    Likes: 15, Points: 0, Legacy Rep: 171
    Location: Maine

    CWTeebs AnomalyGenerator

    No, they should work when everything is configured and built properly.

    Yes, but only absolutely needed it for one actual project. Otherwise I've just messed around with it.
     
  3. jasonlou
    Joined: Mar 2013
    Posts: 4
    Likes: 0, Points: 0, Legacy Rep: 10
    Location: Oregon

    jasonlou New Member

    Dear CWTeebs,

    Great to hear that you have used this AQWA function. Thanks for letting me know that it is not the problem of the code itself. I have been trying to build a workable .dll file using two compilers, but could not make either one work.
    The first one is a fortran compiler (gfortran), the command I use is
    gfortran -c user_force.f90
    gfortran -shared -mrtd -o user_force.dll user_force.o (or gfortran -shared -o user_force.dll user_force.o)
    The second one is a C++ compiler (Microsoft Visual Studio). I walk through the online tutorial step by step to generate the .dll file.
    Both of these two compiler could generate a user_force.dll, but after replacing the original user_force.dll in the bin/win64 folder with the generated one, the AQWA could not even start at the very beginning.
    May I ask which compiler do you use? How did you build the user_force.dll? My system is Windows 7, 64 bite.
    Your help will be very appreciated.
     
  4. CWTeebs
    Joined: Apr 2011
    Posts: 232
    Likes: 15, Points: 0, Legacy Rep: 171
    Location: Maine

    CWTeebs AnomalyGenerator

    Are you using a 32 or 64 bit compiler? I've only used the user force with a 32 bit version of the compiler and AQWA.
     
  5. jasonlou
    Joined: Mar 2013
    Posts: 4
    Likes: 0, Points: 0, Legacy Rep: 10
    Location: Oregon

    jasonlou New Member

    I am using 64 bit compiler and AQWA. Not sure if the problem comes from the difference between 64 bit and 32 bite. May I ask which compiler and commands do you use?
     
  6. CWTeebs
    Joined: Apr 2011
    Posts: 232
    Likes: 15, Points: 0, Legacy Rep: 171
    Location: Maine

    CWTeebs AnomalyGenerator

    Vs 2008. What do you mean by "which commands did you use?"
     
  7. jasonlou
    Joined: Mar 2013
    Posts: 4
    Likes: 0, Points: 0, Legacy Rep: 10
    Location: Oregon

    jasonlou New Member

    Thanks again for your suggestion. I am going to work on this compiler. For "the commands" I mean what compiler options (or command line options) did you use? To help me when I use VS, are all compiler options default settings when building dll file in VS ? Are there any important options different from default which you think might be important?
     
  8. Dinoi
    Joined: Apr 2013
    Posts: 4
    Likes: 0, Points: 0, Legacy Rep: 10
    Location: Sao Paulo

    Dinoi New Member

    Hi!

    I have a problem with the calculation of floting body in the time domain when I put a external forces. So, I put the Exetrnal forces (Structure forces) and after the simulation seems the follow error:

    "ASCITH - External Force T/H file.|Missing value(s) - Expected 7|Record#8"

    Does anybody know this error type?
     
  9. CWTeebs
    Joined: Apr 2011
    Posts: 232
    Likes: 15, Points: 0, Legacy Rep: 171
    Location: Maine

    CWTeebs AnomalyGenerator

    Well, I don't know what your default compiler options are. Last I knew you had to compile the function with stdcall and run WB as admin. I circumvented a lot of problems on Windows/AQWA-WB by compiling a second library that gets loaded from a secure location on the computer. The only modification I made to the user_force routine was to load the second library, as I had a number of problems reloading the user_force dll directly with WB running.

    Yeah, it has little/nothing to do with this thread, which is about programming issues related to using/creating the user_force DLL, and your question itself is...lacking. What are you simulating? Why do you need an external force file? My guess is you formatted the file incorrectly or the number of entries doesn't match the time history.
     
  10. Dinoi
    Joined: Apr 2013
    Posts: 4
    Likes: 0, Points: 0, Legacy Rep: 10
    Location: Sao Paulo

    Dinoi New Member

    I am calculating a platform that is submissive at forces generate from the structure on the top of the platform. I attached the first lines of my forces file, with the format. The total time is 600 s.
     

    Attached Files:

  11. mekchu
    Joined: Jul 2013
    Posts: 10
    Likes: 0, Points: 0, Legacy Rep: 10
    Location: Korea

    mekchu Junior Member

    Hi All,

    I am trying to use user_force subroutine provided by ANSYS AQWA. Actually, I am beginner for this application. Please tell me procedure how to use above subroutine to account external force?
    As my understanding, I have to use FDLL option to active user_force subroutine and IUFC/RUFC command to define external force after compiling above subroutine. Am I right?

    Thanks
     

  12. Matheus
    Joined: Apr 2020
    Posts: 3
    Likes: 0, Points: 1
    Location: BRAZIL

    Matheus New Member

    Jasonlou, I am facing a problem that you already had. Can you help me please?
     
Loading...
Forum posts represent the experience, opinion, and view of individual users. Boat Design Net does not necessarily endorse nor share the view of each individual post.
When making potentially dangerous or financial decisions, always employ and consult appropriate professionals. Your circumstances or experience may be different.