using subroutines in ansys autodyn

4
Using subroutines in ANSYS Autodyn Step 1: Within Autodyn, I select Options > Create User-Subroutine Project and select the location of where I want the subroutine folder to be created. Step 2: I go to this folder location and open ad_usrsub.sln with Visual Studio 2017.

Upload: others

Post on 29-Dec-2021

106 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Using subroutines in ANSYS Autodyn

Using subroutines in ANSYS Autodyn

Step 1:

Within Autodyn, I select Options > Create User-Subroutine Project and select the location of where I

want the subroutine folder to be created.

Step 2:

I go to this folder location and open ad_usrsub.sln with Visual Studio 2017.

Page 2: Using subroutines in ANSYS Autodyn

Step 3:

On the right hand panel, I locate the file I want to edit within the fsrc folder. Since I’m using a 2D

model, I want to edit usrsub2.f90. Locate the subroutine I want to edit, I want to edit the EXEDIT

subroutine so I deleted the original EXEDIT and copy and pasted the example code from the manual

into here.

Step 4:

I build the solution and the code compiles

Page 3: Using subroutines in ANSYS Autodyn

Step 5:

Now that the executable has been made, I go to Workbench and I right click Setup, then choose

“Select user executable..” Then I choose the ad_usrsub.exe file that has been created.

Step 6:

Once this is done I go to Autodyn and select User variables > Add and do the following for VAR01

and VAR02 since they are both required by the example code I originally chose from the manual.

Page 4: Using subroutines in ANSYS Autodyn

Step 7:

I save the project and run the simulation. The user subroutine I have used is used to store the

maximum pressure over time for all cells in the problem. However, I can’t seem to access this data

anywhere within Autodyn. I get these results when I select VAR.1 which is supposed to be an array

which stores the maximum pressure. I also don’t see the option anywhere to views this data in the

history plots.