TAGGED: autodyn, explicit-dynamics, fortran, subroutine, visual-studio
-
-
May 6, 2021 at 10:52 pm
Conorryan98
SubscriberHi there,
I implemented the EXEDIT3 example thats found in the ANSYS Autodyn user subroutines guide. It stores the maximum momentum over time for all cells in the problem. I built the solution in Microsft Visual Studio 2017. It gave me 219 warnings but 0 errors...the last line i got was "Build: 2 succeeded, 0 failed, 0 up-to-date, 0 skipped".
May 7, 2021 at 7:44 pmChris Quan
Ansys EmployeeThe user subroutine EXEDIT3 in the Autodyn User Subroutine Tutorial uses VAR01 and VAR02 to store the maximum momentum calculated by the user subroutine and its associated time.
To plot VAR01 & VAR02 in Autodyn GUI using Contour Plot or set them as Time History variables for History Plot, you need to activate these two variables in Autodyn GUI before running the model.
You need to click on User Variables at the left navigational bar in Autodyn GUI to Add and Activate the variables VAR01 & VAR02. Make sure Restart is checked so these variables are stored for restart analysis. See attached picture below.
You can also rename the variable, for example, VAR.1 to Momentum. See attached picture below. Thus, for plotting purpose, Autodyn will show its name as Momentum in Contour Plot and Time History Plot. However, internally the name doesn't change so you still need to refer it to VAR01 in the user subroutine.
May 7, 2021 at 8:31 pmConorryan98
SubscriberHi there
Thank for the reply. Unfortunately when I do this I still don't see any results.
For the contour plot I don't get any results for VAR.1 and VAR.2 (see photos).
I also don't have any options to plot this data in the time history plot.
Do you think the warnings I'm getting in my Build log are affecting the results (in original post)
Thanks
C
May 11, 2021 at 9:56 pmMay 12, 2021 at 2:37 pmConorryan98
Subscriberokay thank you. The EXEDIT tutorial (2D) seems to be working when I use it with SPH. Is it just the 3D one that doesn't work with SPH?
I have modified the EXEDIT example subroutine to find minimum X-velocity of the particles. I would like to extract the negative values of all the cells which have a negative x-velocity. In picture 2, this is all the particles which move in the left direction. The contouring is in x-velocity. I have tried to create a file called mytable.txt which writes this data so that I can see it, but I can't seem to figure out where to put it in the code. Eventually I would also like to add cell mass so that I can extract each node's x-momentum. Any help would be greatly appreciated. Thanks.
SUBROUTINE EXEDIT
! ************************************************************************
! THIS IS A USER SUPPLIED SUBROUTINE WHICH CAN BE USED TO PROVIDE
! SPECIAL CUSTOM EDITING. THE FREQUENCY AT WHICH THIS SUBROUTINE
! IS CALLED IS DEFINED THROUGH INPUT (GLOBAL-EDIT-USER). WHEN
! REQUESTED, IT IS CALLED BY THE EDIT PROCESSOR AT THE END OF A
! COMPUTATIONAL CYCLE. THE ROUTINE IS CALLED BEFORE ANY OTHER
! TYPES OF STANDARD EDITS ARE CALLED FOR THAT CYCLE (EG. PRINT ! SAVE, HISTORY, DISPLAY, ETC), SO IT MAY ALSO BE USED TO SET UP
! DATA TO BE PROCESSED BY OTHER EDIT TYPES.
! ************************************************************************
USE mdgrid
USE ranges
USE kindef
USE cycvar
USE wrapup
USE subdef
IMPLICIT NONE
INTEGER (INT4) ::I,J,NS,IJK
REAL (REAL8)::X_VEL
! ************************************************************************
! THIS SUBROUTINE ATTAINS Minimum X Velocity FOR EACH CELL (2D)
!
!VAR01ARRAY STORING Minimum X Velocity
!VAR02ARRAY STORING TIME WHEN Minimum X Velocity OCCURS
! ************************************************************************
OPEN(99,FILE='mytable.txt')
write (99,*)'X-Vel'
! INITIALIZATION OF ARRAYS
IF (NCYCLE == 1) THEN
! LOOP OVER ALL PARTS
DO NS = 1, NUMSUB
NSUB = NS
CALL GETSUB
! LOOP OVER ALL CELLS
DO I = 1,IMAX
DO J = 1,JMAX
IJK= IJSET(I,J)
VAR01(IJK)= BIG! BIG = 1.01E20_real8
VAR02(IJK)= BIG
! END LOOP ON CELLS
END DO
END DO
! END LOOP ON PARTS
END DO
END IF
! GET Minimum X Velocity
! LOOP OVER ALL PARTS
IF (NCYCLE > 1) THEN
DO NS = 1, NUMSUB !NUMSUB = Number of Parts in problem
IF (NS/=NSUB) THEN !NSUB = Current Part number /= not equals "If 1 does not equal the current part number, then Current Part number is 1?
NSUB = NS
CALL GETSUB
END IF
! LOOP OVER ALL CELLS
DO I = 1,IMAX !From I=1 to I=MAX IMAX = Maximum I-index for current Part
DO J = 1,JMAX !From J=1 to J=MAX
! GET MAXIMUM X Velocity FOR EACH CELL
IJK = IJSET(I,J)
X_VEL = UXN(IJK)
IF(X_VEL <= VAR01(IJK)) THEN
VAR01(IJK) = X_VEL
VAR02(IJK) = TIME
IF (VAR01(IJK) < 0) THEN
VAR03(IJK) = VAR01(IJK)! If value of VAR01(IJK) is less than 0, it is equal to VAR03(IJK)
END IF
END IF
! END LOOP ON CELLS
END DO
END DO
! END LOOP ON PARTS
END DO
END IF
RETURN
END SUBROUTINE EXEDIT
May 12, 2021 at 8:26 pmConorryan98
SubscriberI resolved the issue thanks
May 13, 2021 at 3:25 pmChris Quan
Ansys EmployeeFor 3D SPH particles, you may need different approach to access the particle variables. Please review the Autodyn User Subroutine Tutorial carefully.
Viewing 6 reply threads- The topic ‘Finding data obtained from Autodyn user subroutine’ is closed to new replies.
Ansys Innovation SpaceTrending discussionsTop Contributors-
3712
-
1313
-
1163
-
1090
-
1014
Top Rated Tags© 2025 Copyright ANSYS, Inc. All rights reserved.
Ansys does not support the usage of unauthorized Ansys software. Please visit www.ansys.com to obtain an official distribution.
-
The Ansys Learning Forum is a public forum. You are prohibited from providing (i) information that is confidential to You, your employer, or any third party, (ii) Personal Data or individually identifiable health information, (iii) any information that is U.S. Government Classified, Controlled Unclassified Information, International Traffic in Arms Regulators (ITAR) or Export Administration Regulators (EAR) controlled or otherwise have been determined by the United States Government or by a foreign government to require protection against unauthorized disclosure for reasons of national security, or (iv) topics or information restricted by the People's Republic of China data protection and privacy laws.