General Mechanical

General Mechanical

Topics related to Mechanical Enterprise, Motion, Additive Print and more.

Ansys Workbench Mechnical 2021 and UPF usermat problem!

    • mehdi.yasaee
      Subscriber

      I'm working in ANSYS 2021 R2.

      I've setup a Static Structural model in workbench. Simple cube model with the bilinear plasticity usermat.f placed in the working directory. 

      I've inserted a command(APDL):

      /UPF, usermat.f

      Under Static Structural step. 

      When I solve, the UPF process doesn't start, there is no compilation etc.

      If I were to execute the exact input file in Terminal, then it will work correctly with the usermat.f compiling. This means the Fortran compilers are all working correctly.

      The exact same process in ANSYS 2019 R3 works correctly in Workbench Mechanical.

      What am I doing wrong?

       

      To note:

      ANS_USE_UPF is set to TRUE in environment variable

      Envrionment path to ANSYS directory is set, meaning findUPF.bat can be run directly in Terminal. 

       

       

       

    • David Weed
      Ansys Employee

      Hi, is this on the Windows or Linux OS? Note that for Linux, the /UPF command in WB-Mechanical will not work. You'd need to user the shared library method instead and set the environment variable ANS_USER_PATH to wherever the compiled library resides.

    • janot.lubritz
      Subscriber

       

       

      Hey! I’ve got the exact same question. When I’m compiling the .f files with the Terminal (admin mode) and open them with apdl everything works but the compilation within workbench does not work. The command “/UPF, usermat.f” that is inserted into the model does not do the trick. The .f file is in the same folder as the model solution. I’m working on Windows 10 with Ansys 2021 R1 (shouldn’t have anything to do with the Ansys version).

      Does anybody have an idea how I can connect the UPF to the workbench model?

       

      @David Weed: What do you mean with the ANS_USER_PATH variable? What is the value of the variable and what do you mean with "where the compiled library resides."? I thought it would start the compilation once I solve the workbench model?

      Thanks so much in advance!

       

       

      • mehdi.yasaee
        Subscriber

        I think this must be a bug in Ansys 2021 since in Ansys 2019 using the command works correctly and the usermat is compiled directly within Workbench Mechanical. 

        What you need to do is to use the precompile method. Basically chose a folder on your machine as your usermat folder. Then put the compiled usermat files in there. 

        In windows Environmental Variables create a system Environement Variable ANS_USER_PATH to point to the usermatfolder.

        Finally to compile the usermat.f files, make sure all the correct softwares(intel compiler, visual studio) and paths have been installed correctly. Then go to this folder: 

        C:\Program Files\ANSYS Inc\v212\ansys\custom\user\winx64

        and look for the file: ANSUSERSHARED.bat

        You need to put this and usermat.f in the same folder then run the batch file. Which should compile the usermat creating a bunch .dll, .lib, .map etc. files, . 

        In Ansys Mechanical, you activate the usermat by adding APDL Command in the analysis tree, /UPF, usermat

        Hope this helps

        • Boyka Uri
          Subscriber

          Thanks a lot. it`s work!

           

        • janot.lubritz
          Subscriber

           

           

          I have two more questions: First one is on how to assign material properties when using an UPF in the workbench environment. With APDL you assign them with the TB command and there is nothing assigned beforehand. When using workbench there is always a basic material (Steel or so) assigned beforehand and I cannot delete it. Do I have to assign the material properties for my usermat via an APDL command in the workbench tree and do I have to delete the steel properties somehow?

          Would be great if somebody could give me a hint on that since it does not work right now.

           

          Second one is on the linking of the usermat in the workbench file: I use the \upf, usermat.f command as described above and have the two variables (ANS_USE_UPF = TRUE and ANS_USER_PATH = path to compiled dlls files) set but everytime I run the solver an error prompts:

          ”An error occured while starting the solver module.”

          In the solver files directory is a link_error file and a link file so it looks like the linking did not work. Is there a way to check whether everything is linked correctly and compiling/running the usermat when I run/solve the workbench file? Somehow it still does not work within the workbench. When I run the RVE model without the included usermat and for example isotropic steel everything works fine.

          I know that the usermat code works and compiles without any errors as it works with APDL but I have to use the same usermat in a Workbench model.

           

          Thanks in advance!

           

           

Viewing 2 reply threads
  • The topic ‘Ansys Workbench Mechnical 2021 and UPF usermat problem!’ is closed to new replies.