General Mechanical

General Mechanical

apdl script within structural workbench

    • desouzadacosta
      Subscriber

      Hi All,


      I am stuck in executing an apdl script inside the Structural Workbench using apdl command objects (see the figs). I am also attaching the .wbpz, .dat and .F if somebody can give a try. Basically I exported the .iges from the APDL and started a structural model setup. When I hit solve, errors are displayed.


      Any output is very welcome.


      Alex

    • Sandeep Medikonda
      Ansys Employee

      Not everyone is allowed to download the files. Can you post inline pictures and maybe you can explain what error you are seeing and what is your special need to use command snippets?


      Regards,
      Sandeep
      Guidelines on the Student Community

    • desouzadacosta
      Subscriber

      hi Sandeep


      thanks for the reply. How can i post inline pictures?

    • Sandeep Medikonda
      Ansys Employee

      Save your image or snapshot on your computer. Then click on the image button as shown below, use the Browse button to find and upload it.



      Regards,
      Sandeep

    • desouzadacosta
      Subscriber

    • Sandeep Medikonda
      Ansys Employee

      What is the error you are seeing? That message really cuts away the errors? What does your solution output say and how does your force convergence plot look?


      It looks like you are passing parameters to a user material subroutine. The problem could be coming from there. This will be hard to debug just from the images, maybe someone else on the community who has permissions might be able to help. Please, note that user-defined features are not generally supported.


      Also, this is really not the way you set up an analysis in Mechanical. Please take some time to do a few examples provided in the Cornel Learning Modules. See this Post.


      Regards,
      Sandeep

    • desouzadacosta
      Subscriber

      Hi Sandeep


      Ansys staff not being able to download from this forum is really a huge setback on the purpose behind this forum.


      Could you at least try the first lines printed in the picture in the Structural Mechanical ?


      Best


      Alex

    • jj77
      Subscriber

      As Sandeep says the way you model and include apdl commands in workbench is not as ideal. Follow the links and tutorials as indicated and practise.


      Now for the model:


      - Make the cube in say Design Modeler


      - Include command for the material part only (see image below - yellow marking, and command on the main window). Make sure to have the sub. routine in the same folder as the workbench files.


      - Apply the displacements yourself in workbench (see red marking bellow). Apply the enforced disp. gradually (10 steps of 0.1 m)


      - Use the analysis settings as shown below.


      - Use coarse mesh (say 0.5 m sides on  HEX el.).


      That works.



       

    • desouzadacosta
      Subscriber

      Hi. Follows the pictures of my settings. Still error. Confused.


    • desouzadacosta
      Subscriber

    • Sandeep Medikonda
      Ansys Employee

      The error says that you don't have any loads in the model? Like jj77 says, apply a displacement using boundary conditions over a few steps.

    • desouzadacosta
      Subscriber

      Sorry. What do you mean by "apply a displacement using boundary conditions over a few steps" ?


      Could you show a picture of that ?


      Thanks a lot.

    • Sandeep Medikonda
      Ansys Employee

      desouza,


      Please see this post by Peter. He demonstrates this for multiple loading cases, but you would just use incremental loading. So, instead of values of  Z as 0, 2, -1 etc. you might want to use 0, 0.1, 0.2 ....and so on.


      Regards,
      Sandeep

    • desouzadacosta
      Subscriber

      Hi,


      I  think is going further but still with errors. I reproduce my screens below. Any clue is very welcome. I am terribly clueless.


      Best


      Alex




    • desouzadacosta
      Subscriber

      Hey peterozman


      help us. We are in complete darkness about this issue.

    • peteroznewman
      Subscriber

      Hey desouzadacosta,


      Is your goal to run an apdl script?  I'm not skilled in that area.


      Is you goal to shear a cube of material with a neo-hookean material model? I can help you with that in Mechanical.


      I followed jj77's advice above and just included the code for the material.



      Regards,
      Peter


      ANSYS 19.2 archive attached.

    • desouzadacosta
      Subscriber

      Hi Peter


      Thanks a lot for the reply. We are trying to hook the usermat.f for hyperelastic material and apply the loads, but we are stuck in the errors above. The reason for using mechanical instead mechanical apdl is because we intend to do some coupled fsi with fluent.
      Any of your great output would be very welcome.
      Best
      Alex
    • peteroznewman
      Subscriber

      Hi Alex,


      Do you have all of the following three compilers installed on your system?



      • Microsoft Visual Studio Professional 2015 update 3 (including the MS C++ compiler)

      • Intel C++ 17.0.4

      • Intel Visual FORTRAN 17.0.4 compilers


      You can't compile source code without them. I don't have a FORTRAN compiler, so I won't be able to compile the usermat.f source code.


      If you have compilers, before linking UPFs, make sure that the INCLUDE, LIB, and PATH environment variables are set correctly for the required C/C++ and Intel Fortran compilers.


      Regards,
      Peter

    • peteroznewman
      Subscriber

      Hi Alex,


      The /UPF command offers the simplest method for linking user programmable features into Mechanical APDL. The format of the command is:


      /UPF, RoutineName

      where RoutineName is the name of the user routine (filename.ext) that you want to link. The specified routine must reside in the current working directory. 


      Following are prerequisites for using the /UPF command method on a Windows system:




      • A script named findUPF.bat is used to detect the /UPF command. You must include the path to this script in your system PATH variable. This script is typically located in Program FilesAnsys IncV192ansysbin<platform> where <platform> is a directory that uniquely identifies the hardware platform version: “Winx64” for 64-bit Windows.




      • Before starting Mechanical APDL, you must set the ANS_USE_UPF environment variable to TRUE. This causes the program to search for /UPF in the input file. This environment variable is required only on Windows systems and only when using the /UPF command method for linking UPFs. The ANS_USE_UPF environment variable should not be set when using other methods to link UPFs.




      Have you done the above?


      Regards,
      Peter

    • desouzadacosta
      Subscriber

      Hi Peter,


      I am going to try installing the fortran compiler. Is there some kind of native fortran compiler when using mechanical apdl (not mechanical workbench) ? 


      The .dat runs till the end when reading the .dat in the mechanical apdl interface.


      Best,


      Alex

    • Rohith Patchigolla
      Ansys Employee

      Hi Desouzadacosta,


      Please try this using "User Programmable Features v4" ACT extension available for free in the APP store at the below link (extensions available for all versions from v17.1 to v19.2). 


      https://catalog.ansys.com/product/5b3bc6857a2f9a5c90d32ee0/user-programmable-features


      This app will make things a lot easier for you (for example, it has options to check your compiler installation and MS Visual studio installation, directly scope the usermat file etc.). The extension documentation is also very good. 


      Hope this helps. 


      Best regards,


      Rohith

    • peteroznewman
      Subscriber

      Hi Alex,


      Yes, the file runs for me too, but I don't believe it is using the usermat.f routine since I don't have the FORTRAN compiler.
      The installation instructions for ANSYS says these compilers are required for UPF code use.


      If you are a student, you can get Intel FORTRAN for free.


      Regards,
      Peter

    • desouzadacosta
      Subscriber

      Hi Peter,


      I said about a "fortran native compiler" (i.e., installed with ANSYS)  because for fluent there is


      an option of hooking an "interpreted" udf.c file, using a C compiler installed during ANSYS instalation(not the Visual Studio C++ required for compiled fluent udf). 


      Maybe the ANSYS guys from the forum could clarify more about that.


      Best,


      Alex


       

    • peteroznewman
      Subscriber

      Hi Rohith,


      (1) If Alex has FORTRAN source code, usermat.f, does he need to install a FORTRAN compiler to use that code in a UPF?


      (2) Does the ANSYS media include a FORTRAN compiler?


      (3) Is the free student version of the Intel FORTRAN compiler, Intel® ParallelStudIo Xe 2019, compatible with ANSYS UPF linking?


      Update: I found 2019 is version 19, but the ANSYS Help says to get version 17, so I downloaded an older version. Installing that is not simple as I don't have the Prerequisites.



      Thanks in advance,
      Peter

    • peteroznewman
      Subscriber

      Hi Alex,


      Here is a zip file for you.


      Regards,
      Peter

    • David Weed
      Ansys Employee

      Hi Peter/Alex,


       


      1) Since Alex is using the /UPF command (that is also the command that the UPF ACT app uses under the hood) he will need the IFORT compiler installed on his system. Essentially, every time you issue the /UPF command, it compiles and links to the MAPDL source code. It's a sort of "compile/link on the fly' method.


      2) ANSYS does not offer users an IFORT compiler; they need to purchase this separately (the same goes for Microsoft Visual Studios)


      3) Intel PS 2019 is not supported by ANSYS; if the user is in R19.2, they need IFORT 17.0.4. and MS VS 2015 Professional w/ update 3: https://ansyshelp.ansys.com/account/secured?returnurl=/Views/Secured/corp/v192/ai_instl/win_compilers.html?q=fortran%20compiler

    • desouzadacosta
      Subscriber

      Hi David


      Is ifort 17.0.4 contained within intel ps 2017?

    • desouzadacosta
      Subscriber

      Thxs

    • peteroznewman
      Subscriber

      Hi Alex,


      I guess it is the 2017 Update 4 version is 17.0.4, which I downloaded and showed the missing prerequisites above.



       Below is the webpage where it looks like I could download MS Visual Studio 2015 and join the free Dev Essentials program to get free access.


    • peteroznewman
      Subscriber

      Alex,


      The supported MS VS Professional 2015 Update 3 will run as a Trial version.



      If you want to use after the trial period, the Retail cost of an annual subscription at the MS Store is $1,199 for the first year and $799 per year afterward.


      I wonder if the free MS VS Community (instead of Professional) would work with ANSYS.   After you see the /UPF actually working, you can uninstall Professional and install Community and see if it still works.


      To get a MS C++ Compiler, I downloaded this:



      but when I ran the installer, it said it could not install this since Visual Studio was installed, and to uninstall that to install this!
      This is why I am glad I am not a software developer...


      Alex, I have to ask, how much do you want to run that usermat.f code?  It seems like a huge effort to get your computer ready to run it. I've only now got two of the four items required.


      Regards,
      Peter

    • David Weed
      Ansys Employee

      Hi Peter,


      The Intel web page and 17.0.4. compiler that you've shown are correct. Alex will need an Intel account so that he can access that site.

    • peteroznewman
      Subscriber

      Hi David,


      Do you know if I uninstall VS Professional 2015 so that I can first install MS Visual C++ Build Tools 2015, will I then be able to install VS Pro 2015, or are they mutually exclusive? I can try it a see, it's just the waiting time. Or do I have the wrong package for MS C++?


      Regards,
      Peter


       

    • desouzadacosta
      Subscriber

      Hi Peter,


      Thxs again. The effort is because me and my partner have a master degree subject to develop.

    • desouzadacosta
      Subscriber

      From the upf extension manual it requires a bit older versions of ifort and msvc :


      Requirements for using UPF


      • Installation Requirement


      – You must install ANSYS with the ‘Customization Files’ option checked during


      installations


      ? Note that this is NOT default when installing ANSYS


      • Compiler Requirements


      – Intel FORTRAN 15.0.2 compilers for ANSYS


      ? Other compilers are not supported


      • Visual Studio Requirements


      – Visual Studio 2012 (including the MS C++ compiler) for ANSYS

    • peteroznewman
      Subscriber

      Alex, what version of ANSYS are you using?


      For ANSYS 19.2, the versions are newer than you are listing above.

    • desouzadacosta
      Subscriber

      18.0 . I am going to try 19.2 also. By now I passed the ansys customization window. But I am stuck with the two other windows below :


      One more thing what is the link for the ifort 2017 Update 4 version 17.0.4. I see only the picture.



    • desouzadacosta
      Subscriber

      Where do I go from here to 2017 Update 4 version 17.0.4 :



       

    • peteroznewman
      Subscriber

      I went into the Free Software Tools link in blue text, and registered with a .edu email address.

    • desouzadacosta
      Subscriber

       Hi Guys,


      Back in the business of running TD 38 inside structural workbench.


      I installed all the required compilers for the ACT UPF .


      I reproduce below the troublesome messages.


      Any piece of advice would be great.


      Thanks,  Alex


       


       


       


    • peteroznewman
      Subscriber

      Please delete the duplicate post. It looks like you are putting the same error message in four times. I don't see the difference.

    • desouzadacosta
      Subscriber

      Hi Peter,


      Thanks for the reply.


      My apologies, some how I uploaded the same figs. I am going to upload the different ones.


      Best,


      Alex Costa

    • desouzadacosta
      Subscriber

      the figs and the .wbpz






    • peteroznewman
      Subscriber

      Alex,


      I recommend you change the BCs on this cube.


      Put a X=0 displacement and all others Free on one face normal to the X axis.


      Put a Y=0 displacement and all others Free on one face normal to the Y axis.


      Put a Z=0 displacement and all others Free on one face normal to the Z axis.


      Instead of a Force, use a non-zero X displacement on the face opposite the one with X=0.


      The advantage of these BCs is that it creates a pure normal stress in the X direction and zero stress in Y and Z directions.


      Finally, set the mesh size so you mesh with exactly 1 element. You can even set it to a linear element so there are only 8 nodes.


      Now you know the exact strain in X because it is set by the displacement and you can calculate what the X stress should be from that strain and the equations used to write code for the material subroutine.


      Regards,
      Peter

    • desouzadacosta
      Subscriber

      Hi Peter,


      Thanks for the clue. I will work on that.


      My feeling is that the fortran compiler is not compiling the usermat.f  , and assuming some wrong "default" material (same situation as you described when ran


      td38 input file inside Mechanical APDL without the fortran compiler installed).


      Alex

Viewing 43 reply threads
  • You must be logged in to reply to this topic.