Dear xansys experts,
While trying to retrieve Equivalent stresses at a specific path of the model considering different design points in ANSYS workbench (for example in this case 3 design points) and making use of the APDL commands to print the results into a csv file at a specific location, I am able to retrieve 3 different csv files for 3 design points. However, my requirement is to print a single csv file containing the stress values of the path at 3 different design points.
For this I have created 3 different arrays to store the stresses at each design point and saved the database (code snippet_1 is executed successfully). once all the three design points are evaluated, I tried to resume each of the database separately to retrieve the stresses and store it in a single array (which can be printed as 1 file with all the stresses at 3 different design points as per my requirement) but in doing so there is an error while executing code snippet_2.
Code snippet_1:
*IF,design_points,EQ,1,then
*DO, p, 1, path_points
*DO, ls, 1, num_loadsteps
set, ls
!sets the loadstep
! Results - Stress SX
PDEF, SX, S, EQV
*GET, MARRAY_1(p, 3+design_points), PATH, , ITEM, SX, PATHPT, p
*ENDDO
! Coordinates
MARRAY_1(p, 1)=xaux
*GET, MARRAY_1(p, 2), PATH, , ITEM, YG, PATHPT, p
MARRAY_1(p, 3)=zaux
*ENDDO
SAVE,result1,db
*ELSEif,design_points,EQ,2
*DO, p, 1, path_points
*DO, ls, 1, num_loadsteps
set, ls
!sets the loadstep
! Results - Stress SX
PDEF, SX, S, EQV
*GET, MARRAY_2(p, 3+design_points), PATH, , ITEM, SX, PATHPT, p
*ENDDO
! Coordinates
MARRAY_2(p, 1)=xaux
*GET, MARRAY_2(p, 2), PATH, , ITEM, YG, PATHPT, p
MARRAY_2(p, 3)=zaux
*ENDDO
SAVE,result2,db
*ELSEif,design_points,EQ,3
*DO, p, 1, path_points
*DO, ls, 1, num_loadsteps
set, ls
!sets the loadstep
! Results - Stress SX
PDEF, SX, S, EQV
*GET, MARRAY_3(p, 3+design_points), PATH, , ITEM, SX, PATHPT, p
*ENDDO
! Coordinates
MARRAY_3(p, 1)=xaux
*GET, MARRAY_3(p, 2), PATH, , ITEM, YG, PATHPT, p
MARRAY_3(p, 3)=zaux
SAVE,result3,db
*ENDDO
*ENDIF
Code snippet_2:
ALLSEL
*IF,design_points,EQ,3,then
resume,result3,db
*DIM, MARRAY, ARRAY, path_points, 5+num_loadsteps !4+num_loadsteps
*DO, p, 1, path_points
MARRAY(p,6)=MARRAY_3(p,6)
*ENDDO
resume,result1,db
*DO, p, 1, path_points
MARRAY(p,1)=MARRAY_1(p,1)
MARRAY(p,2)=MARRAY_1(p,2)
MARRAY(p,3)=MARRAY_1(p,3)
MARRAY(p,4)=MARRAY_1(p,4)
*ENDDO
! Columns in results file: X, Y, Z, SX LS1 to LS6
*CFOPEN,Results_superposition,csv
*VWRITE, MARRAY(1,1), MARRAY(1,2,), MARRAY(1,3), MARRAY(1,4)
%i; %g; %g; %g;
*CFCLOS
RESUME,result2,db
*DO, p, 1, path_points
MARRAY(p,5)=MARRAY_2(p,5)
*ENDDO
Error:
*IF design_points ( = 3.00000 ) EQ
3 ( = 3.00000 ) THEN
RESUME ANSYS DATA FROM FILE NAME=result3.db
*** MAPDL GLOBAL STATUS ***
TITLE = graphs_merge--Static Structural (A5)
ANALYSIS TYPE = STATIC (STEADY-STATE)
5 ELEM TYPES DEFINED MAX ELEM TYPE NUMBER = 5
354 ELEMENTS DEFINED MAX ELEMENT NUMBER = 708
1869 NODES DEFINED MAX NODE NUMBER = 1869
1 MATERIALS DEFINED MAX MATERIAL NUMBER = 1
2 REAL CONSTS DEFINED MAX REAL CONST NUMBER = 4
0 SECTIONS DEFINED MAX SECTION NUMBER = 0
0 COORD SYS DEFINED MAX COORD SYS NUMBER = 0
ACTIVE COORDINATE SYSTEM = 0 (CARTESIAN)
NUMBER OF DEFINED NODAL CONSTRAINTS = 18
NUMBER OF DEFINED NODAL LOADS = 3
NUMBER OF DEFINED COMPONENTS = 1
NUMBER OF DEFINED ELEM SURFACE LOADS = 0
NUMBER OF DEFINED ELEM BODY LOADS = 0
NUMBER OF DEFINED NODE BODY FORCES = 0
CURRENT LOAD CASE = 0 OF 0
LOAD SET = 1
SUBSTEP = 10
TIME/FREQ = 1.0000
INITIAL JOBNAME = file
CURRENT JOBNAME = file
SET PARAMETER DIMENSIONS ON MARRAY TYPE=ARRA DIMENSIONS= 21 6 1
*DO LOOP ON PARAMETER= P FROM 1.0000 TO 21.000 BY 1.0000
PARAMETER MARRAY(P,6) = 417.4975946
*ENDDO INDEX= P
RESUME ANSYS DATA FROM FILE NAME=result1.db
*** MAPDL GLOBAL STATUS ***
TITLE = graphs_merge--Static Structural (A5)
ANALYSIS TYPE = STATIC (STEADY-STATE)
5 ELEM TYPES DEFINED MAX ELEM TYPE NUMBER = 5
354 ELEMENTS DEFINED MAX ELEMENT NUMBER = 708
1869 NODES DEFINED MAX NODE NUMBER = 1869
1 MATERIALS DEFINED MAX MATERIAL NUMBER = 1
2 REAL CONSTS DEFINED MAX REAL CONST NUMBER = 4
0 SECTIONS DEFINED MAX SECTION NUMBER = 0
0 COORD SYS DEFINED MAX COORD SYS NUMBER = 0
ACTIVE COORDINATE SYSTEM = 0 (CARTESIAN)
NUMBER OF DEFINED NODAL CONSTRAINTS = 18
NUMBER OF DEFINED NODAL LOADS = 3
NUMBER OF DEFINED COMPONENTS = 1
NUMBER OF DEFINED ELEM SURFACE LOADS = 0
NUMBER OF DEFINED ELEM BODY LOADS = 0
NUMBER OF DEFINED NODE BODY FORCES = 0
CURRENT LOAD CASE = 0 OF 0
LOAD SET = 1
SUBSTEP = 10
TIME/FREQ = 1.0000
INITIAL JOBNAME = file
CURRENT JOBNAME = file
*DO LOOP ON PARAMETER= P FROM 1.0000 TO 21.000 BY 1.0000
PARAMETER MARRAY(P,1) = 1.000000000
*** ERROR *** CP = 8.734 TIME= 10:49:25
Invalid character in parameter name.
The setting of parameter= MARRAY(P,1) is ignored.
NUMBER OF WARNING MESSAGES ENCOUNTERED= 1
NUMBER OF ERROR MESSAGES ENCOUNTERED= 1
Kindly help me to understand if my approach is correct in this case, if not please suggest further.
Best Regards,
Shravani