apdl script within structural workbench

  • 432 Views
  • Last Post 16 January 2019
desouzadacosta posted this 11 December 2018

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

Attached Files

Order By: Standard | Newest | Votes
SandeepMedikonda posted this 11 December 2018

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 posted this 11 December 2018

hi Sandeep

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

SandeepMedikonda posted this 11 December 2018

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 posted this 11 December 2018

SandeepMedikonda posted this 12 December 2018

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 posted this 12 December 2018

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 posted this 12 December 2018

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 posted this 12 December 2018

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

desouzadacosta posted this 12 December 2018

SandeepMedikonda posted this 12 December 2018

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 posted this 12 December 2018

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.

SandeepMedikonda posted this 12 December 2018

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 posted this 13 December 2018

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 posted this 18 December 2018

Hey peterozman

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

peteroznewman posted this 18 December 2018

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.

Attached Files

desouzadacosta posted this 18 December 2018

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 posted this 19 December 2018

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 posted this 19 December 2018

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 Files\Ansys Inc\V192\ansys\bin\<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 posted this 19 December 2018

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

rgpatchi posted this 19 December 2018

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 posted this 19 December 2018

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 posted this 19 December 2018

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 posted this 19 December 2018

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 posted this 19 December 2018

Hi Alex,

Here is a zip file for you.

Regards,
Peter

Attached Files

  • Liked by
  • desouzadacosta
DavidW posted this 19 December 2018

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 posted this 19 December 2018

Hi David

Is ifort 17.0.4 contained within intel ps 2017?

desouzadacosta posted this 19 December 2018

Thxs

peteroznewman posted this 19 December 2018

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 posted this 20 December 2018

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

  • Liked by
  • SandeepMedikonda
DavidW posted this 20 December 2018

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.

Show More Posts
Close