• Non ci sono risultati.

Ansys sourcecodes B

N/A
N/A
Protected

Academic year: 2021

Condividi "Ansys sourcecodes B"

Copied!
14
0
0

Testo completo

(1)

Appendix

B

Ansys source codes

Contents

B.1 Main script used . . . 121 B.1.1 1DOF , harmonic analysis with force applied . . . 121 B.1.2 1DOF , harmonic analysis with displacement applied . . . 126 B.1.3 1DOF , harmonic analysis by superposition method with

force applied,ξ no constant on the structure . . . 127 B.1.4 Displacement control . . . 131

B.1

Main script used

In this chapter the main kinds of scripts used are discussed. It will be shown the script for the simplest system: 1DOF mass/spring/damper because it is easy to understand and at the same time it is easy to extend to a complex model modifying the parameters and the model. Also it is shown the displacement control method.

B.1.1 1DOF , harmonic analysis with force applied

It gives the displacement of the mass 2, used to check the script of Matlab in Appendix A.1.1. Structural damping is used with constant damping ratio on the structure ξ of 0.02.

 1 C∗∗∗

2 C∗∗∗−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− 3 C∗∗∗

4 C∗∗∗CONSTANT DAMPING RATIO, xi , CONSTANT ON ALL STRUCTURE 5 C∗∗∗ x i IS GIVEN ON THE HARMONIC ANALYSIS BY dmprat COMMAND

(2)

6 C∗∗∗ 7 C∗∗∗−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− 8 C∗∗∗ 9 FINISH 10 /CLEAR 11 /FILENAME, ’ 1DOF_xi_CONSTANT ’ 12 /TITLE , ’ 1DOF_xi_CONSTANT ’ 13 /PREP7 15 C∗∗∗∗∗∗∗∗∗∗∗∗∗ 16 C∗∗∗PARAMETERS 17 C∗∗∗∗∗∗∗∗∗∗∗∗∗ 18 FRQ1 = 0 ! FREQUENCY START 19 FRQ2 = 10 ! FREQUENCY STOP 20 NS = 10 ! FREQUENCY SUDDIVISION

21 NM = 1 ! NUMBER OF MODE SHAPE TO BE USED 23 ! MASSES 24 m2 = 10 ! [ kg ] 26 ! STIFFNESS 27 k1 = 10000 ! [N/m] 29 !DAMPING 30 c1 = 0 . 0 2 ! [N∗(m/S ) ^(−1) ] 32 C∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗ 33 C∗∗∗ELEMENT TYPE 34 C∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗ 35 ET, 1 , 2 1 , 0 , 0 , 0 !MASS 36 ET, 2 , COMBIN37, , , 1 ! SPRING

38 C∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗ 39 C∗∗∗REAL COSTANT 40 C∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗ 41 ! MASSES

(3)

42 R, 1 , m2 44 ! STIFFNESS 45 R, 1 1 , k1 47 C∗∗∗∗∗∗∗∗∗ 48 C∗∗∗MODELL 49 C∗∗∗∗∗∗∗∗∗ 50 !NODE 51 N, 1 52 N, 2 , 1 54 !MASS ELEMENT 55 TYPE, 1 56 REAL, 1 57 E, 2 59 ! SPRING ELEMENT 60 TYPE, 2 61 REAL, 1 1 62 E, 1 , 2 64 C∗∗∗∗∗∗∗∗∗∗∗∗∗∗ 65 C∗∗∗CONSTRAINTS 66 C∗∗∗∗∗∗∗∗∗∗∗∗∗∗

67 CERIG, 1 , 2 ,UY ! UY DOF RESTRAINED 68 CERIG, 1 , 2 ,UZ ! UZ DOF RESTRAINED 69 D, 1 ,ALL ! FRAME 70 FINISH 72 C∗∗∗∗∗∗∗∗∗∗∗∗ 73 C∗∗∗SOLUTION 74 C∗∗∗∗∗∗∗∗∗∗∗∗ 75 !−−−−−−−−−−−−−−−−−−−−−−−−−−− 76 ! FIRST STEP MODAL ANALYSIS 77 !−−−−−−−−−−−−−−−−−−−−−−−−−−−

(4)

78 /SOLU

79 ANTYPE,MODAL ! MODAL ANALYSIS 80 MODOPT,LANB,NM ! EXTRACTION METHOD 81 SOLVE

82 FINISH 83 /SOLU 84 FINISH

85 /POST1 ! SAVE NATURAL FREQUENCIES AS FILE .TXT 86 /OUTPUT, 1 DOF_xi_CONSTANT_FULL_NaturalFrequency , t x t 87 SET, LIST

88 /OUTPUT 89 FINISH

91 !−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− 92 ! SECONDS STEP HARMONIC ANALYSIS 93 !−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− 94 /SOLU

95 ANTYPE,HARMIC ! HARMONIC ANALYSIS 96 HROPT, FULL ! FULL METHOD

97 HARFRQ, FRQ1, FRQ2 ! FREQUENCY RANGE 98 NSUBST, NS ! NUMBER OF SUBSTEP 99 DMPRAT, C1 ! DAMPING

100 KBC, 1 ! LOAD IS STEP CHANGED 101 C∗∗∗∗∗∗∗ 102 C∗∗∗ Load 103 C∗∗∗∗∗∗∗ 104 F , 2 ,FX, 1 105 SOLVE 106 FINISH 108 C∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗ 109 C∗∗∗ POST−PROCESSING 110 C∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗ 111 /POST26 112 !REAL PART 113 NSOL, 2 , 2 ,U,X

(5)

114 STORE,MERGE ! STORE UX OF NODE 2 115 ∗GET, size , VARI, , NSETS

116 ∗dim ,M2_RP, array , s i z e ! CREATE ARRAY PARAMETER 117 ∗dim , M2_IP, array , s i z e ! CREATE ARRAY PARAMETER

118 VGET,M2_RP, 2 , , 0 ! STORE REAL PART OF VARIABLE 2 INTO M2_RP

119 VGET, M2_IP, 2 , , 1 ! STORE IMAGINARY PART OF VARIABLE 2 M2_IP

121 ∗CREATE, ansuitmp ! SAVE M2_RP AS FILE .TXT 122 ∗CFOPEN,M2_RP, t x t 123 ∗VWRITE,M2_RP( 1 ) 124 ( F15 . 1 2 ) 125 ∗CFCLOS 126 ∗END 127 /INPUT, ansuitmp

129 ∗CREATE, ansuitmp ! SAVE M2_IP AS FILE .TXT 130 ∗CFOPEN, M2_IP, t x t 131 ∗VWRITE, M2_IP( 1 ) 132 ( F15 . 1 2 ) 133 ∗CFCLOS 134 ∗END 135 /INPUT, ansuitmp

137 PARSAV, ALL, Parameters_1DOF_xi_CONSTANT ,TXT

139 ! SAVE ALL THE PARAMETERS IN MEMORY,

140 ! WHICH CAN BE LOADED INTO ANOTHER FILE BY: 141 ! PARRES, , Parameters_1DOF_xi_CONSTANT ,TXT

(6)

B.1.2 1DOF , harmonic analysis with displacement applied

The only differences with the previous section, Appendix B.1.1, are the first row after /P REP 7 where the input for the system is resumed and the part concern the harmonic response which is shown here.

 1 /PREP7

2 PARRES, ,X.TXT

3 !RESUME PARAMETER FROM THE SYSTEM 4 . . .

5 !−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− 6 ! SECONDS STEP HARMONIC ANALYSIS 7 !−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− 8 ∗DIM,FRQ,ARRAY, NS ! CREATE FRQ ARRAY 9 ∗DO, n ,FRQ1+1,NS

10 FRQ( n ) = n 11 ∗ENDDO

13 /SOLU

14 ∗Do , IJK , 1 , NS

15 ANTYPE,HARM ! HARMONIC ANALYSIS 16 HROPT, FULL ! FULL METHOD

17 DMPRAT, x i ! DAMPING 18 HARFRQ,FRQ( IJK ) ! FREQUENCY

19 KBC, 1 ! LOAD IS STEP CHANGED

20 C∗∗∗ 21 C∗∗∗ Load 22 C∗∗∗ 23 D, 2 ,UX,X( IJK ) 24 LSWRIT 25 ∗ENDDO 26 LSSOLVE, 1 , NS 27 FINISH 

(7)

B.1.3 1DOF , harmonic analysis by superposition method with force applied, ξ no constant on the structure

Contrarily to the Appendix B.1.1 the structural damping used in not constant on the structure, therefore it is applied by the material properties. Obviously, here it is constant because there is only one element, but each element can have a different material property and so different ξ. Also the harmonic analysis is solved by the superposition method.

 1 C∗∗∗

2 C∗∗∗−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− 3 C∗∗∗

4 C∗∗∗CONSTANT DAMPING RATIO, xi , No CONSTANT ON ALL STRUCTURE 5 C∗∗∗ x i IS GIVEN ON THE MATERIAL PROPERTY OF THE MATERIAL 6 C∗∗∗ 7 C∗∗∗−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− 8 C∗∗∗ 9 FINISH 10 /CLEAR 11 /FILENAME, ’ 1DOF_xi_NO_CONSTANT ’ 12 /TITLE , ’ 1DOF_xi_NO_CONSTANT ’ 13 /PREP7 15 C∗∗∗∗∗∗∗∗∗∗∗∗∗ 16 C∗∗∗PARAMETERS 17 C∗∗∗∗∗∗∗∗∗∗∗∗∗ 18 FRQ1 = 0 ! FREQUENCY START 19 FRQ2 = 10 ! FREQUENCY STOP 20 NS = 10 ! FREQUENCY SUDDIVISION

21 NM = 1 ! NUMBER OF MODE SHAPE TO BE USED 23 ! MASSES

24 m2 = 10 ! [ kg ]

26 ! STIFFNESS

(8)

29 !DAMPING 30 c1 = 0 . 0 2 ! [N∗(m/S ) ^(−1) ] 32 C∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗ 33 C∗∗∗ELEMENT TYPE 34 C∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗ 35 ET, 1 , 2 1 , 0 , 0 , 0 ! MASS 36 ET, 2 , COMBIN37, , , 1 ! SPRING

38 C∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗ 39 C∗∗∗REAL COSTANT 40 C∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗ 41 ! MASSES 42 R, 1 , m2 44 ! STIFFNESS 45 R, 1 1 , k1 47 C∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗ 48 C∗∗∗MATERIAL PROPERTIES 49 C∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗ 50 MP,DMPR, 1 , c1 ! DAMPING 52 C∗∗∗∗∗∗∗∗∗ 53 C∗∗∗MODELL 54 C∗∗∗∗∗∗∗∗∗ 55 !NODE 56 N, 1 57 N, 2 , 1 59 !MASS ELEMENT 60 TYPE, 1 61 REAL, 1 62 E, 2 64 ! SPRING ELEMENT

(9)

65 TYPE, 2 66 REAL, 1 1 67 E, 1 , 2 69 C∗∗∗∗∗∗∗∗∗∗∗∗∗∗ 70 C∗∗∗CONSTRAINTS 71 C∗∗∗∗∗∗∗∗∗∗∗∗∗∗

72 CERIG, 1 , 2 ,UY ! UY DOF RESTRAINED 73 CERIG, 1 , 2 ,UZ ! UZ DOF RESTRAINED 74 D, 1 ,ALL ! FRAME 75 FINISH 77 C∗∗∗∗∗∗∗∗∗∗∗∗ 78 C∗∗∗SOLUTION 79 C∗∗∗∗∗∗∗∗∗∗∗∗ 80 !−−−−−−−−−−−−−−−−−−−−−−−−−−− 81 ! FIRST STEP MODAL ANALYSIS 82 !−−−−−−−−−−−−−−−−−−−−−−−−−−− 83 /SOLU

84 ANTYPE,MODAL ! MODAL ANALYSIS 85 MODOPT,QRDAMP,NM ! EXTRACTION METHOD 86 MXPAND,NM ! EXPANSION

87 SOLVE 88 FINISH 89 /SOLU 90 FINISH

91 /POST1 ! SAVE NATURAL FREQUENCIES AS FILE .TXT 92 /OUTPUT, 1 DOF_xi_NO_CONSTANT_NaturalFrequency , t x t

93 SET, LIST 94 /OUTPUT 95 FINISH

97 !−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− 98 ! SECONDS STEP HARMONIC ANALYSIS 99 !−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− 100 /SOLU

(10)

101 ANTYPE,HARMIC ! HARMONIC ANALYSIS

102 HROPT,MSUP ! MODE SUPERPOSITION METHOD 103 HARFRQ, FRQ1, FRQ2 ! FREQUENCY RANGE

104 NSUBST, NS ! NUMBER OF SUBSTEP 105 KBC, 1 ! LOAD IS STEP CHANGED 106 C∗∗∗∗∗∗∗ 107 C∗∗∗ Load 108 C∗∗∗∗∗∗∗ 109 F , 2 ,FX, 1 110 SOLVE 111 FINISH 113 !−−−−−−−−−−−−−−−−−−−−− 114 ! THRID STEP EXPANDED 115 !−−−−−−−−−−−−−−−−−−−−− 116 /SOLU 117 EXPASS,ON 118 NUMEXP, NS , FRQ1, FRQ2, YES 119 SOLVE 120 FINISH 122 C∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗ 123 C∗∗∗ POST−PROCESSING 124 C∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗ 125 /POST26 126 !REAL PART 127 NSOL, 2 , 2 ,U,X

128 STORE,MERGE ! STORE UX OF NODE 2 129 ∗GET, size , VARI, , NSETS

130 ∗dim ,M2_RP, array , s i z e ! CREATE ARRAY PARAMETER 131 ∗dim , M2_IP, array , s i z e ! CREATE ARRAY PARAMETER

132 VGET,M2_RP, 2 , , 0 ! STORE REAL PART OF VARIABLE 2 INTO M2_RP

133 VGET, M2_IP, 2 , , 1 ! STORE IMAGINARY PART OF VARIABLE 2 M2_IP

(11)

135 ∗CREATE, ansuitmp ! SAVE M2_RP AS FILE .TXT 136 ∗CFOPEN,M2_RP, t x t 137 ∗VWRITE,M2_RP( 1 ) 138 ( F15 . 1 2 ) 139 ∗CFCLOS 140 ∗END 141 /INPUT, ansuitmp

143 ∗CREATE, ansuitmp ! SAVE M2_IP AS FILE .TXT 144 ∗CFOPEN, M2_IP, t x t 145 ∗VWRITE, M2_IP( 1 ) 146 ( F15 . 1 2 ) 147 ∗CFCLOS 148 ∗END 149 /INPUT, ansuitmp

151 PARSAV, ALL, Parameters_1DOF_xi_CONSTANT ,TXT

153 ! SAVE ALL THE PARAMETERS IN MEMORY,

154 ! WHICH CAN BE LOADED INTO ANOTHER FILE BY: 155 ! PARRES, , Parameters_1DOF_xi_CONSTANT ,TXT



B.1.4 Displacement control

As a first step loading of the parameters, mainly the response of the point of interest obtained from the system, accessory on the assembly. As a second step an harmonic analysis for the accessory on the shaker with random input enables to find the transfer function response different for each frequency. Then, knowing the transfer function and the output of the accessory it is possible to obtain the input for the shaker. As last step a checking the input for the shaker found. This cycle can be used for all the previous models, and for more complex system adjusting the parameter and the model properly.

 1 !−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

2 ! LOAD PARAMETERS FROM THE SYSTEM 3 !−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− 4 /PREP7

(12)

5 PARRES, ,PARAMETER.TXT

6 !RESUME PARAMETER FROM THE SYSTEM MAINLY: 7 !TGP output o f t h e t a r g e t p o i n t

8 !TGP_RP REAL PART OF TGP FROM THE SYSTEM 9 ! TGP_IP IMAGINARY PART OF TGP FROM THE SYSTEM

11 !−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− 12 ! SECONDS STEP HARMONIC ANALYSIS 13 !−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− 14 ∗DIM,FRQ,ARRAY, NS

15 ∗DO, n ,FRQ1+1,NS 16 FRQ( n ) = n 17 ∗ENDDO

18 !TGP_S output o f t h e t a r g e t p o i n t input ramdom 19 ∗dim , YS, array , NS+1 ! INPUT FOR THE SHAKER RANDOM 20 ∗dim ,Y0_RP, array , 1 ! REAL PART TGP_S WITH YS 21 ∗dim , Y0_IP , array , 1 ! IMAGINARY PART TGP_S WITH YS 22 ∗dim , Y0 , array , 1 ! OUTPUT OF TGP WITH YS

23 ∗dim ,TETA, array , NS+1 ! PHASE OF TGP_S 24 ∗dim ,ALPHA, array , NS ! PHASE OF TGP

25 ∗dim ,YW, array , NS ! OUTPUT WANTED FOR TGP

26 ∗dim , Y_INP, array , NS ! INPUT FOR THE SHAKER WANTED 27 YS( 1 ) = 3 ! STARED VALUE INPUT SHAKER

28 TETA( 1 ) = ATAN(YS( 1 ) ∗SIN ( 0 . 5 ) /YS( 1 ) ∗COS( 0 . 5 ) ) 30 /SOLU

31 ∗Do , IJK , 1 , NS

32 FINISH

33 !−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− 34 ! TRANSFER FUNCTION FOR ( IJK ) th FREQUENCY 35 ! BY INITIAL CONDITION

36 !−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

37 /SOLU

38 ANTYPE,HARM ! HARMONIC ANALYSIS 39 HROPT, FULL ! FULL METHOD

(13)

41 HARFRQ,FRQ( IJK ) ! FREQUENCY

42 KBC, 1 ! LOAD IS STEP CHANGED

43 C∗∗∗

44 C∗∗∗ Load

45 C∗∗∗

46 D, X,UY, YS( IJK ) ∗COS(TETA( IJK ) ) ,YS( IJK ) ∗SIN (TETA( IJK ) ) 47 ! X = POINT OF APPLICATION LOAD

48 SOLVE 49 FINISH 50 /POST26 51 NSOL, 2 ,TGP_S, U,Y 52 STORE,MERGE 53 VGET,Y0_RP, 2 , , 0 54 VGET, Y0_IP , 2 , , 1 55 Y0 ( 1 ) = ( ( (Y0_RP( 1 ) ) ∗∗2+(Y0_IP ( 1 ) ) ∗∗2) ∗ ∗ ( 1 / 2 ) ) 56 G = Y0 ( 1 ) /YS( IJK ) 57 !−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− 58 ! BY AMPLITUDE & PHASE OF THE TARGET POINT 59 ! FROM THE SYSTEM FIND INPUT FOR THE SHAKER 60 !−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− 61 YW( IJK ) =

( ( (TGP_RP( IJK ) ) ∗∗2+(TGP_IP( IJK ) ) ∗∗2) ∗ ∗ ( 1 / 2 ) ) ! TGP FROM THE SYSTEM

62 ALPHA( IJK ) = ATAN(TGP_IP( IJK ) /TGP_RP( IJK ) ) ! PHASE OF TGP

63 TETA( IJK+1) = ALPHA( IJK )

64 Y_FIND = YW( IJK ) /G ! INPUT FOR THE SHAKER 65 YS( IJK+1) = Y_FIND ! RANDOM INPUT FOR THE

SHAKER IJK+1 66 Y_INP( IJK ) = Y_FIND

67 FINISH

68 !−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− 69 ! VALIDATING OF THE METHOD, FIND THE TARGET 70 ! POINT RESPONSE WITH THE INPUT FOUND ABOVE 71 !−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

(14)

73 ANTYPE,HARM ! HARMONIC ANALYSIS 74 HROPT, FULL ! FULL METHOD

75 DMPRAT, x i ! DAMPING 76 HARFRQ,FRQ( IJK ) ! FREQUENCY

77 KBC, 1 ! LOAD IS STEP CHANGED

78 C∗∗∗

79 C∗∗∗ Load

80 C∗∗∗

81 D, X,UY, Y_INP( IJK ) ∗COS(ALPHA( IJK ) ) , 82 Y_INP( IJK ) ∗SIN (ALPHA( IJK ) )

83 LSWRIT

84 ∗ENDDO

85 LSSOLVE, 1 , NS 86 FINISH

Riferimenti

Documenti correlati

In Section 4, the characterization provided by Theorem 3.2 leads to combina- torial results: we investigate the structure of the partial order of likeness among dendrites, showing

The temperatures shown here are: local equilibrium tem- perature T , thermodynamic non-equilibrium temperature T neq (equal to the kinetic temperature along the x axis), the

Since for systems not in thermodynamic equilibrium the total entropy production P must be positive for arbitrary fluxes (Second Law of Thermodynamics), also the second term in

A Bayesian hierarchical model was developed to estimate time-dependent contrasts while addressing the peculiar features displayed by the experi- mental units (wine tanks):

The resulting binary images are input into the spline-based algorithm for diameter estimates and the measurements performance against REVIEW is reported in Table 8.. The removal

Tissue levels refer to superficial (skin) and/or deep tis- sue layers (muscle, subcutaneous fat), whereas tissue units involve the cells and extracellular matrix composing the tissue

In the Standard Model these phases occur only in the CKM matrix which is part of the electroweak sector of the theory, hence these are often called “weak phases.” The weak phase of

The objective of the 6th International Symposium of the European Water Resources Association is to pro- vide an open forum for analyzing the main challenges for an effective