<reponame>isaacansys/example-data<gh_stars>1-10
"""Script generated by ansys-mapdl-core version 0.59.dev0"""
from ansys.mapdl.core import launch_mapdl
mapdl = launch_mapdl(loglevel="WARN")
mapdl.run("/batch,list")
mapdl.run("/verify,linear_non_prestressed")
mapdl.title("linear_non_prestressedSolving brake squeal problem using linear non pre-stressed modal solve")
mapdl.run("/graphics,power							")  # turn on power graphics
mapdl.run("/rgb,index,100,100,100,0					")  # specifying RGB values for images and contour plot
mapdl.run("/rgb,index,80,80,80,13")
mapdl.run("/rgb,index,60,60,60,14")
mapdl.run("/rgb,index,0,0,0,15")
mapdl.run("/show,png")
mapdl.run("/out,scratch")
mapdl.prep7()
mapdl.shpp("off", "", "nowarn")  # turn off shape checking
mapdl.cdread("comb", "disc_pad_model", "cdb", "", "")  # Read disc_pad_model.cdb file
mapdl.allsel("all")
# ################################################################################################
# disc_pad_model.cdb file contains the following information
# 
# 1. Nodes and elements of the brake disc pad model
# ****************************************************
# 
# 2. Element definition and their key-option settings
# ****************************************************
# 
# The model is meshed with Solid186 elements with reduced integration
# element technology
# 
# -----------------------------------------------------------------------
# ET,1,SOLID186
# KEYOPT,1,2,0
# ------------------------------------------------------------------------
# 
# 
# 3. Material properties for the brake disc pad model
# ******************************************************
# 
# All components of the disc pad model is assigned with
# linear elastic isotropic materials
# 
# -----------------------------------------------------------------------
# MP,DENS,1,7850.,
# MP,EX,1,200000000000.,
# MP,NUXY,1,0.3,
# -----------------------------------------------------------------------
# 
# 
# 4. Contact pair definition
# ******************************
# 
# Frictional contact pairs are used to define contact between brake pads
# and disc
# 
# Bonded contact pairs are used to define contact for other components of
# the braking system.
# 
# Friction contact pair definition
# 
# --------------------------------------------------------------------------
# *set,tid,31
# *set,cid,30
# r,tid
# r,cid
# et,tid,targe170
# et,cid,conta174
# keyo,cid,10,2
# keyo,cid,12,0
# mp,mu,cid,0.3
# keyo,cid,2,0
# keyo,cid,9,1
# keyo,cid,5,1
# keyo,cid,7,0
# ------------------------------------------------------------------------------
# 
# Bonded contact pair definition
# 
# ----------------------------------------------------------------------------------
# *set,tid,35
# *set,cid,34
# r,tid
# r,cid
# et,tid,targe170
# et,cid,conta174
# keyo,cid,12,5
# keyo,cid,4,2
# keyo,cid,2,2
# keyo,cid,9,1
# keyo,cid,7,0
# ------------------------------------------------------------------------------------
# 
# 5. Boundary conditions and loading applied on the brake disc and pads
# ************************************************************************
# 
# Components are formed with nodes and element to specify boundary conditions
# 
# Nodes belonging to component FIXEDSU is fixed in all directions.
# 
# -----------------------------------------------------------------------------------
# cmsel,s,FIXEDSU,node
# d,all,all
# ------------------------------------------------------------------------------------
# 
# Nodes belonging to the pads surface where pressure loading is applied are
# grouped to form components named _ZERODISPUX and _ZERODISPUY.
# 
# Nodes belonging to component _ZERODISPUX are constrained in X direction
# 
# Nodes belonging to component _ZERODISPUY are constrained in Y direction
# 
# -------------------------------------------------------------------------------------
# cmsel,s,_ZERODISPUX,node
# d,all,ux,0
# cmsel,s,_ZERODISPUY,node
# d,all,uy,0
# --------------------------------------------------------------------------------------
# 
# 
# 
# ###############################################################################################
mapdl.allsel("all")
mapdl.run("fini")
# #########################################
# Analysis settings and solution control
# ##########################################
mapdl.run("/solu")
mapdl.antype("modal")  # Perform modal analysis
mapdl.modopt("unsym", 30)  # Use UNSYM eigen solver and extract 30 modes
mapdl.mxpand(30, "", "", "")  # Expand 30 modes
mapdl.nropt("unsym")  # Unsymmetric Newton Raphson option
mapdl.cmsel("s", "c1_r", "")
mapdl.cmsel("a", "c2_r", "")
mapdl.cm("E_ROTOR", "elem")  # Create a component with target elements attached to disc
mapdl.allsel("all")
mapdl.cmrotate("e_rotor", "", "", 2, "")  # Rotate the target elements to generate sliding friction contact
mapdl.solve()
mapdl.finish()
mapdl.run("/post1")
mapdl.run("/out,")
mapdl.set("list")
mapdl.set(1, 21)
mapdl.plnsol("u", "sum")  # Plot the mode shape for mode 21
mapdl.set(1, 22)
mapdl.plnsol("u", "sum")  # Plot the mode shape for mode 22
mapdl.run("/show,close")
mapdl.finish()
mapdl.run("/clear,nostart")
mapdl.exit()