ansys uploading 2D coordinate file to geometry
How do I Linearize Stress in Mechanical?
Workbench Mechanical tin can use the Construction Geometry branch of its Outline to ascertain planes in infinite onto which User Defined Results from selected geometry can be mapped from selected bodies. Although some math can exist done on these results, the range of operations required to perform linearization of stress distributions is more than complex, and can be aided by APDL Commands Objects.
This article illustrates an approach to using APDL Commands Object to map and linearize results on a plane.
Setup Ansys Workbench Mechanical Construction Geometry
In a Workbench Mechanical model, a Construction Geometry can be inserted in the Model Outline, and used to define a surface that cuts across the interior of a 3D solid model. In the image beneath, a surface called "MySurface" has been defined to exist on the X-Y plane of the user-defined Coordinate Arrangement "MyCs_12". The surface can be seen to cut through the interior of a solid model of a cylinder.
The user-divers coordinate system will be employed in the Ansys macro that follows. Defining the section for plotting purposes is used to check positioning of the cutting plane and provides a plot useful in a written report, but just the user-defined coordinate system is used in the macro.
The coordinate system used above to position the surface is called "MyCS_12" and tin can exist defined in various ways. In the following figure, it is positioned from existing geometry. In this example, the X and Y axis directions are related to the Global Cartesian axes.
Note in the figure higher up that a Manual setting of Coordinate Organization ID has been employed. In this example it was prepare to "12", which was also used in the name of the coordinate organization "MyCS_12" for ease of identification. This coordinate system number will be used later in work washed by the inserted APDL Commands Object to position a Working Plane that cuts through the elements of chosen geometry. The coordinate system number "12" tin can be passed as an argument to the APDL Commands Object, as illustrated farther beneath.
A Named Choice will be used to indicate which bodies are to be sliced by a surface for mapping and linearization for a Commands Object. Multiple versions of the Commands Object tin can be inserted in the Outline at the post-processing stage below Solution to evaluate different surfaces that cutting through 3D solid models in various locations. Each tin can exist provided with a different Named Selection to point the body or bodies that are to be cutting. The component that is the Named Selection will have to be entered straight into an individual APDL Commands Object.
In the above figure, a Named Selection "SUCR_This" identifies a body that is to be sliced by a cut plane with the surface mapping of stresses to be mapped in an APDL Commands Object that is inserted in the postprocessing Solution branch of the Outline. The Named Selection solid body will exist selected inside the Commands Object with a CMSEL command. The piece is indicated by reference to the coordinate system number "12" applied manually to the coordinate organization named "MyCS_12" to a higher place. Only the number "12" is relevant in defining the coordinate system in the example presented here:
My_Cs=ARG1 ! specify the coordinate arrangement, ARG1 of macro call
cmsel,s,SUCR_This ! select elements of body/bodies of interest
nsle ! select their nodes
The surface onto which stresses volition be mapped for linearization volition typically exist perpendicular to a major axis on a body. In a second example in the figure below, the geometry of a body is used to align and orient the surface by positioning the Z-axis of the local coordinate system used to define the surface. I this 2nd instance, the torso'southward major axis is non aligned with the Global Cartesian axes:
Note in the following figure that the ARG1 argument "12" is used to define the position of the working plane, and that the elements of the Named Selection "SUCR_This" are selected for the surface results mapping that follows:
The following figure shows the mesh within the Ansys Batch job, and two coordinate systems: the Global Cartesian system, and Local Coordinate System "12" as defined in the Workbench Mechanical Outline. System "12" volition exist used to position the cut plane for stress linearization.
The APDL Commands Object macro presented in this document is used to linearize bending stress on a cross-section. It does not consider what to do with shear and torsional loads on the department cut through the selected torso. Such an "exercise for the reader" should consider both: (1) whether a linearized shear or torsional load meaning in overloading a part at the cutting plane, and (2) whether design codes, contracts, or product condom considerations that are to exist satisfied require such loads to be evaluated in a linearized way.
The following effigy is the content of the APDL Commands Object that volition map stresses onto the cutting plane, linearize those stresses for boilerplate stress perpendicular to the cutting plane, and bending stress about the centroid of the cut section, add the normal and linearized bending stress, and plot results. The content of the Commands Object will need to accept the Component name (from the Named Option for the trunk of interest) and the coordinate organization number changed for each surface to be postprocessed for linearization.
Figure below: APDL Commands Object Listing to Linearize Stress on a Surface
! Position working plane at triad of specified coordinate system.
! Z centrality of working plane should be perpendicular to cut across 3D torso/bodies of involvement.
!
! Calculate Mx, My well-nigh center of surface on working airplane.
! Map linearized Mc/I onto the surface.
!
! It is important that the WP is located on the centrality of interest
! for the purpose of shear, torsion, and hoop stress work.
!
! SUCR stores the following quantities for the divers surface:
! — GCX, GCY, GCZ are global Cartesian coordinates at each
! point on the surface.
! — NORMX, NORMY, NORMZ are components of the unit of measurement normal at each
! point on the surface.
! — DA is the contributory area of each point.
!
! Call subsequently placing Coordinate Organisation where it cuts the model at position of involvement.
! Cut will exist across the elements of the torso in the Named Selection "SUCR_This"
!
!
! At this bespeak we are in /POST1
!
/com, .
set,last ! read in result of last load pace/substep <<===== #####
/com, .
!
! Programme PNG prototype files
!
pngr,comp,on,9 ! compression
pngr,orient,horizontal ! orientation
pngr,color,2 ! color versus B&Due west or grey
pngr,tmod,one ! bitmap text
/gfile,600 ! Or, use 967 –> 0.75 * (half dozen.v x 200 – x) pixels, vi.5″ wide 200 DPI lscape
/RGB,Alphabetize,100,100,100, 0 ! black/white reversal
/RGB,INDEX, 80, 80, 80,xiii
/RGB,Index, lx, 60, 60,14
/RGB,INDEX, 0, 0, 0,15
/COLOR,PBAK,OFF ! clear background
!
/PLOTPS,INFO,3 ! Multi-legend manner
/PLOPTS,WP,ON ! Working aeroplane plotted
!
!
/evidence,png ! Generate PNG image files for Workbench
!
My_Cs=ARG1 ! specify the coordinate arrangement, ARG1 of macro phone call
cmsel,s,SUCR_This ! select elements of body/bodies of interest
nsle ! select their nodes
*get,numelements,elem,,count ! how many elements in the body/bodies
*if,numelements,eq,0,so
*MSG,Error
The indicated trunk/bodies in SUCR_This contain no elements
/EOF
*endif
!
WPCSYS,,My_Cs ! place working airplane at origin of coord sys ARG1
/CPLANE,one ! cut airplane is working plane
WPSTYL,,,,,,0,2,1 ! cartesian WP with triad shown
!
! Check existence of coordinate system in ARG1
*GET,csexist,CDSY,My_Cs,ATTR,KCS
*if,csexist,GT,-i,so
! perform calculations
/com, .
/com, .
/com, Checking origin and orientation of "My_Cs" coord sys
/com, .
*GET,x_orig,CDSY,My_Cs,LOC,X ! find the origin
*GET,y_orig,CDSY,My_Cs,LOC,Y
*Become,z_orig,CDSY,My_Cs,LOC,Z
*Get,THXY,CDSY,My_Cs,ANG,XY ! find the orientation
*GET,THYZ,CDSY,My_Cs,ANG,YZ
*GET,THZX,CDSY,My_Cs,ANG,ZX
/annot,dele ! delete existing annotations if any
/VIEW,1,ane,2,three
/ANG,i
/ANNOT,DELE
/ANUM ,0, 1, -0.32, 0.92000
/TLAB,-0.32, 0.92,Origin at %x_orig%, %y_orig%, %z_orig%
/ANUM ,0, 1, -0.32, 0.86000
/TLAB,-0.32, 0.86,Thetas at %THXY%, %THYZ%, %THZX%
/title,Elements of Body/Bodies and Working Plane
eplo
/championship,Nodes of Body/Bodies and Working Aeroplane
nplo
! /ui,copy,save,png,graph,color,norm,portrait,yep
/com, .
/com, .
/com, The SUCR control to create "mysurf" ##############
/com, Surface is divers by the cutting airplane in window 1 (controlled by working aeroplane (/CPLANE,1)
!
SUCR,mysurf,CPLANE,two ! form the surface on Working Airplane, accurateness 2. Automatically creates:
! GCX, GCY, GCZ – global Cartesian coord at each point on the surface.
! NORMX, NORMY, NORMZ – components of the unit of measurement normal at each point on surf.
! DA – the contributory surface area of each point
!
SUSEL,S,mysurf ! select this surface; it is used beneath
/championship,Plot coordinates on working plane cut prior to transformation
SUPL,mysurf,GCX
SUPL,mysurf,GCY
SUPL,mysurf,GCZ
!
/annot,dele
!
! Will tranform X, Y, and Z coord of mapped surface and so that data exists in Working Aeroplane X,Y
!
! Annotation: The following *Get commands render rotations in DEGREES for the working aeroplane position
!
*get,thxy,CDSY,4,ANG,XY ! Kickoff rotation, about the Global Z centrality, that put working plane where it is
*go,thyz,CDSY,iv,ANG,YZ ! Second rotation, abou the new X axis, that put working aeroplane where information technology is
*get,thzx,CDSY,4,ANG,ZX ! Third rotation, well-nigh the newest Y axis, that put working plane where information technology is
!
*go,origx,CDSY,iv,LOC,X ! location of the origin of the working airplane, in Global Cartesian
*get,origy,CDSY,4,LOC,Y ! location of the origin of the working plane, in Global Cartesian
*become,origz,CDSY,4,LOC,Z ! location of the origin of the working aeroplane, in Global Cartesian
!
! Form cosine and sin terms as used in a rotation matrix
/com, .
/com, .
/com, Class cosine and sin terms as used in a rotation matrix
!
*afun,deg ! treat theta values as degrees
c1=cos(thxy) ! Cosine of THXY, kickoff rotation nigh Global Z
s1=sin(thxy)
c2=cos(thyz) ! Cosine of THYZ, 2nd rotation virtually the new X
s2=sin(thyz)
c3=cos(thzx) ! Cosine of THZX, 3rd rotation about the newest Y
s3=sin(thzx)
*afun,rad ! return to default radians
!
! Form terms needed in beginning 2 rows of the 3×3 rotation matrix
R11=c3*c1-s3*s2*s1
R12=c3*s1+s3*s2*c1
R13=-s3*c2
R21=-c2*s1
R22=c2*c1
R23=s2
!
! Terms of the third row if wanted for checking purposes
! R31=s3*c1+c3*s2*s1
! R32=s3*s1-c3*s2*c1
! R33=c3*c2
!
! Create data that results if the average X, Y, Z in global coord are translated dorsum to global origin
!
! Employ these rotation terms to create Surface Operations results data containing
! the X and Y values of surface data as would be measured in the working plane.
! Global Coordinates of points on the surface before transformation are GCX, GCY, and GCZ
! Place the above terms as surface data for subsequent SUCALC operations
!
! Note: DA acts equally a dummy in the following:
!
/com, .
/com, .
/com, Placing zeros on the surface for diverse items #############
! Class a ZERO on the surface
SUCALC,MyZero,DA,Nada,,,,0.0
!
! Course R11 values etc over the surface (EVERY Indicate ON SURFACE GETS THE VALUE):
!
SUCALC,sr11,DA,ZERO,,,,r11 ! rotation matrix terms
SUCALC,sr12,DA,Aught,,,,r12
SUCALC,sr13,DA,Cypher,,,,r13
SUCALC,sr21,DA,ZERO,,,,r21
SUCALC,sr22,DA,Zero,,,,r22
SUCALC,sr23,DA,ZERO,,,,r23
!
! SUCALC,sr31,DA,Null,,,,r31 ! third rotation data if wanted
! SUCALC,sr32,DA,ZERO,,,,r32
! SUCALC,sr33,DA,ZERO,,,,r33
!
/com, .
/com, .
/com, Forming working aeroplane coord from CGX, GCY, GCZ and rotation
! Form working plane coordinates by multiplying matrix rows past vector of GCX, GXY, GCZ
! Beginning do 10
SUCALC,WPX1,sr11,MULT,GCX ! R11*Ten
SUCALC,WPX2,sr12,MULT,GCY ! R12*Y
SUCALC,WPX3,sr13,MULT,GCZ ! R13*Z
SUCALC,WPX,WPX1,Add together,WPX2
SUCALC,WPX,WPX,Add together,WPX3 ! Class X ON WORKING Aeroplane = R11*X+R12*Y+R13*Z
!
! And then do Y
SUCALC,WPY1,sr21,MULT,GCX ! R21*Ten
SUCALC,WPY2,sr22,MULT,GCY ! R22*Y
SUCALC,WPY3,sr23,MULT,GCZ ! R23*Z
SUCALC,WPY,WPY1,Add,WPY2
SUCALC,WPY,WPY,Add together,WPY3 ! Form Y ON WORKING PLANE = R21*X+R22*Y+R23*Z
!
! Z for checking — all points should exist on the aforementioned airplane
! SUCALC,WPZ1,sr31,MULT,GCX ! R31*X
! SUCALC,WPZ2,sr32,MULT,GCY ! R32*Y
! SUCALC,WPZ3,sr33,MULT,GCZ ! R33*Z
! SUCALC,WPZ,WPZ1,ADD,WPZ2
! SUCALC,WPZ,WPZ,ADD,WPZ3 ! Class Z ON WORKING PLANE = R31*X+R32*Y+R33*Z
!
! Observe average X, Y, and Z values on the plane for the WPX, WPY, WPZ data
!
/com, .
/com, .
/com, Finding boilerplate X, Y, Z on plane from working aeroplane coord
SUEVAL,avg_x,WPX,AVG
SUEVAL,avg_y,WPY,AVG
! SUEVAL,avg_z,WPZ,AVG
!
! Nosotros do not ever have a perfect circle so get X and Y relative to average
! Find X, Y, Z of points on surface relative to the average bespeak
! Calculate the local 10, Y, Z of points on the surface
/com, .
/com, .
/com, Subtracting boilerplate X, Y, Z from the working plane X, Y, and Z coord
SUCALC,LCX,WPX,SUB,MyZero, , ,-avg_x ! X coord measured from avg_x
SUCALC,LCY,WPY,SUB,MyZero, , ,-avg_y ! Y
! SUCALC,LCZ,WPZ,SUB,MyZero, , ,-avg_z ! Z
!
/com, .
/com, .
/com, Plot transformed coordinates on the working plane cut
/title,Plot coordinates on working plane cut AFTER transformation
SUPL,mysurf,LCX
SUPL,mysurf,LCY
! SUPL,mysurf,LCZ
!
/com, .
/com, .
/com,Forming squares of Ten and Y measurements
! Discover squares of the local X and Y measurements
SUCALC,LCXsq,LCX,MULT,LCX, , ,0, ! X coord measured from avg_x
SUCALC,LCYsq,LCY,MULT,LCY, , ,0, ! Y
!
/com, .
/com, .
/com, Integrating to go Ixx and Iyy
! Integrate to get Ixx and Iyy
SUEVAL,Ixx,LCYsq,INTG ! Ixx (well-nigh avg_x)
SUEVAL,Iyy,LCXsq,INTG ! Iyy (nigh avg_y)
!
*get,max_cs,CDSY,,NUM,MAX ! maximum coordinate arrangement number
!
*if,max_cs,le,ten,and so ! fix to 10 if necessary so that adjacent CS is eleven.
max_cs=x
*endif
!
/com, .
/com, .
/com, Creating local cartesian CS on the working plane
CSWPLA,max_cs+i,0 ! align local CS Cartesian on WP, becomes agile CSYS
RSYS,max_cs+1 ! use this local coordinate system
!
/com, .
/com, .
/com, Mapping SZ onto the surface
! Give the user something to look at
SUMAP,sax,S,Z ! map Sz (axial) onto the surface. AXIAL STRESS <<===
/com, .
/com, .
/com, Plotting SZ as mapped onto the surface
/title,SZ Mapped onto the surface
SUPL,MYSURF,sax,i ! plot the mapped effect with element edges
!
/com, .
/com, .
/com, Class results in a cylindrical coordinate system
!
CSWPLA,max_cs+ane,one ! switch to a cylindrical system
RSYS,max_cs+one ! use this local coordinate system
SUMAP,s_thetaz,south,yz ! torsional stress (y=theta, z=axis)
SUMAP,s_hoop,south,y ! hoop stress (y=theta)
!
CSWPLA,max_cs+i,0 ! dorsum to cartesian organization
RSYS,0 ! dorsum to Global Cartesian results
!
/com, .
/com, .
/com, Course products of axial stress with Local Ten and Y
sucalc,sax_y,sax,MULT,LCY ! Used beneath to calculate Mx
sucalc,sax_x,sax,MULT,LCX ! Used below to calculate My
!
/com, .
/com, .
/com, Form integrals. This produces moments near the origin.
sueval,Mx,sax_y,INTG
sueval,MY_neg,sax_x,INTG ! This is the negative of My
!
/com, .
/com, .
/com, Summate averaged values of hoop stress and torsional stress
SUEVAL,avg_hoop,S_HOOP,AVG
SUEVAL,avg_theta,S_THETAZ,AVG
!
/com, .
/com, .
/com, Calculate averaged value of direct centric stress
SUEVAL,avg_axial,sax,AVG
/com, .
/com, .
/com, Internet Moment
M_net=sqrt(Mx**two+My_neg**2)
!
/com, .
/com, .
/com, Form K/I values for user in Mc/I further below
Mx_Ixx=Mx/Ixx
My_Iyy=-My_neg/Iyy
!
/com, .
/com, .
/com, Place these M/I values on surface prior to calculation of Mc/I values
SUCALC,MxIxx,DA,ZERO,,,,Mx_Ixx
SUCALC,MyIyy,DA,ZERO,,,,My_Iyy
!
/com, .
/com, .
/com, Form Mc/I values–note term with minus sign.
! Step one: Sz due to Mx (term gets plus sign in summation further beneath)
SUCALC,sz_mx,LCY,MULT,MxIxx
! Step ii: Sz due to My (term gets minus sign in summation further below)
SUCALC,sz_my_neg,LCX,MULT,MyIyy
!
/com, .
/com, .
/com, Form sums of stresses
SUCALC,sz_lin,sz_mx,SUB,sz_my_neg ! combine the two axial stresses due to bending
!
/com, .
/com, .
/com, Grade boilerplate axial stress (one value)
SUCALC,sz_axavg,DA,ZERO,,,,avg_axial
!
/com, .
/com, .
/com, Course sum of average axial stress (abiding) and linearized bending stress
SUCALC,sz_lin2,sz_lin,Add together,sz_axavg
/com, .
/com, .
/com, Linearized stresses (membrane plus/minus bending) on the cut
/championship,Linearized Stress on the Cut, Due to Angle But
/ANNOT,DELE
/ANUM ,0, 1, -0.32, 0.92000
/TLAB,-0.32, 0.92,Mx=%Mx%, My=-%My_neg%
/ANUM ,0, 1, -0.32, 0.86000
/TLAB,-0.32, 0.86,M_net=%M_net%
!
SUPL,MYSURF,sz_lin,0 ! without element edges
SUPL,MYSURF,sz_lin,1 ! with element edges
!
/title,Linearized Bending+Centric Stress Normal to Cut, No Torsion or Shear.
/ANNOT,DELE
!
SUPL,MYSURF,sz_lin2,0 ! without element edges
SUPL,MYSURF,sz_lin2,1 ! with chemical element edges
!
*else
/com, .
/com, .
/com, Coordinate organization requested in ARG1 does non exist
*MSG,WARN,My_Cs
Coordinate system %1000% in statement to this macro does not be.
!
*endif
!
! Exit hither
/title
rsys,0
csys,0
allsel
There is some unnecessary content in the above APDL code, including various comments that bespeak where the commands take executed in the Output file that is generated by the Ansys Batch job, and some unnecessary actress coordinate system work and measurements of coordinate organisation orientations.
The plots generated in this APDL code explore some output possibilities. Users may wish to orient the viewing direction for the plots, by adjusting the arguments to the /VIEW command. These arguments could be based on the orientation angles measured for the coordinate system that defines the cutting airplane, or otherwise determined by a user's commands.
Users may also wish to add together some commands that process shear and torsional stresses, and consider adding their effects to the linearized boilerplate and angle stresses on the cutting section.
A brief summary of the steps required for this stress linearization on cutting planes is:
- Select a body of interest and refer to it in a Named Option.
- Define a Cartesian coordinate arrangement that cuts the body. Tape the coordinate system number.
- Identify the APDL macro in a postprocessing Commands Object. Provide an argument with the coordinate system number, and modify the name in the Component selection to the ane in the Named Selection.
- Practise the above for each torso of interest.
- Solve the model, and expect at the postprocessing results.
Sample Results
The following plot shows stress normal to a surface. Information technology is generated by referring to Surface equally a "Scoping Method", choosing the surface from a drop-downward list, and filling in the Definition to indicate "Orientation" and the "Coordinate System" for the event of interest. Information technology does not testify a linearized stress.
Note that in the Details section, numerical Results output includes an Average value for the normal stress. What is missing is a reference to linearized bending, and the sum of linearized angle stress and average normal stress.
Stresses are mapped onto the locations where the cutting plane goes through the 3D elements of the selected geometry by the macro. Integrations and other operations are performed on the data that is mapped to the surface, resulting in linearized membrane average and linearized bending results.
The math operations employed in the presented macro are taken from the Surface Operation commands available in Ansys. For reference, some of the following commands are employed in the macro case:
Surface Operations Commands
These /POST1 commands are used to ascertain an capricious surface and to develop results information for that surface:
SUCALC Create new result information by operating on two existing result datasets on a given surface.
SUCR Create a surface.
SUDEL Delete geometry information as well as any mapped results for specified surface or for all selected surfaces.
SUEVAL Perform operations on a mapped particular and store upshot in a scalar parameter.
SUGET Create and dimension an NPT row array parameter named PARM, where NPT is the number of geometry points in SurfName.
SUMAP Map results onto selected surface(s).
SUPL Plot specified SetName effect information on all selected surfaces or on the specified surface.
SUPR Print surface data.
SURESU Resume surface definitions from a specified file.
SUSAVE Save surface definitions and result items to a file.
SUSEL Selects a subset of surfaces.
SUVECT Operate betwixt two mapped result vectors.
Summary | Stress Linearization
A macro has been employed in a Workbench Mechanical postprocessing APDL Commands Object to form linearized membrane average and linearized bending stress on a plane department that cuts across a trunk in the model. Surface Operations are used to behave out the mapping, multiplications, integrations and summations required on the surface to form these postprocessing results. An example apply of the macro has been illustrated in a uncomplicated model.
Much of the correct use of this macro volition result from user settings. The location of the cutting plane must be indicated with a local coordinate organisation with the coordinate system number applied manually by the user. A Construction Geometry "Surface" can be entered to brand the location of the section more visible to the user, and in a written report, merely is not a necessity in employing the macro.
The user must select the solid geometry that is to be cut by the surface section, and supply information technology to the macro as a Named Choice. Elements of that Named Selection are selected equally a Component inside the APDL commands.
The current example of the macro returns membrane average stress that is normal to the section cut through the body, and a linearized bending result. The contributions of these two results are summed and the result is plotted.
The user must decide how to orient the cutting plane—the nowadays macro is only one example. This would go challenging in a model with large rotations in the body or bodies of interest.
The user must decide how to apply linearized stress values in assessment of a structure, and in satisfaction of the requirements of a design code. The user must also make up one's mind how to arroyo assessment of any torsional or shear furnishings at the cutting aeroplane, especially when warping can issue. Cloth behaviors are assumed linear. A user must decide how to assess structures with textile yielding or other nonlinear effects.
The above two images show stress on a section prior to linearization and subsequently. Because of the simple loading the results are similar, however they are not identical. The section plot is formed in Ansys by an SUPL command.
Ansys also has Path linearization techniques that appraise linearized results forth a line through a section. The nowadays area-based technique is a newer possibility, and does not necessarily satisfy existing pattern codes.
Source: https://simutechgroup.com/linearizing-stresses-normal-to-a-plane-in-mechanical/
0 Response to "ansys uploading 2D coordinate file to geometry"
Postar um comentário