Ejemplo n.º 1
0
    [x, y] = [x * 0.3048, y * 0.3048]
    [xc, yc] = [xc * 0.3048, yc * 0.3048]
    [L1, p1, p2] = part.draw_arc(x, y, xc, yc)
    air_lines.append(L1)
# make the last 3 lines after the arcs
pts_ft_other = [[2, 110], [0, 110]]
for [x, y] in pts_ft_other:
    [x, y] = [x * 0.3048, y * 0.3048]  # conversion to metric
    [L1, p1, p2] = part.draw_line_to(x, y)
    air_lines.append(L1)
part.draw_line_to(0, 0)
# view the points, lines, and areas
model.plot_geometry(model_name + '_geom', display=show_gui)

# set part material
mat = pyc.Material('concrete')
mat.set_mech_props(2300, 30000 * (10**6), 0.2)
model.set_matl(mat, part)

# set the element type, line division, and mesh the database
model.set_eshape(eshape, 2)
model.set_etype('plstrain', part, thickness)
model.set_ediv('L8', 2)
# mesh with 1.0 or less fineness, smaller is finer
model.mesh(0.5, 'gmsh')
# plot the part elements
model.plot_elements(model_name + '_elem', display=show_gui)

# set loads and constraints
model.set_load('press', air_lines, press_atm)
model.set_fluid_press(water_lines, dens_water, grav, water_ht_m, press_atm)
Ejemplo n.º 2
0
part.draw_line_rad(length)
hole_lines = part.draw_hole(0, 0, diam * 0.5, filled=False)
model.set_ediv(hole_lines, 10)
part.chunk()
# view the geometry
model.plot_geometry(proj_name + '_geom', display=show_gui)

# set loads and constraints
pressure = -1000
model.set_load('press', part.top, pressure)
model.set_load('press', part.bottom, pressure)
model.set_constr('fix', ['P6', 'P8'], 'y')
model.set_constr('fix', ['P4', 'P7'], 'x')

# set part material
mat = pyc.Material('steel')
mat.set_mech_props(7800, 210 * (10**9), 0.3)
model.set_matl(mat, part)

# set the element type and mesh database
model.set_eshape(eshape, 2)
model.set_etype('plstress', part, 0.1)
model.mesh(1.0, 'gmsh')  # mesh 1.0 fineness, smaller is finer
model.plot_elements(proj_name + '_elem', display=show_gui)
model.plot_pressures(proj_name + '_press', display=show_gui)
model.plot_constraints(proj_name + '_constr', display=show_gui)

# make and solve the model
prob = pyc.Problem(model, 'struct')
prob.solve()
Ejemplo n.º 3
0
               [1, 2, rad_web_bot], [10, 11, rad_web_bot], [2, 3, rad_web_top],
               [9, 10, rad_web_top]]
for [i1, i2, rad] in fillet_list:
    part.fillet_lines(lines[i1], lines[i2], rad)
# view the geometry
model.plot_geometry(model_name + '_geom',
                    pnum=False,
                    lnum=False,
                    display=show_gui)

# set loads and constraints
model.set_rpm(10000, part)
model.set_constr('fix', part.left, 'y')

# set part material
mat = pyc.Material('nickel_alloy')
mat.set_mech_props(8220, 208 * 10**9, 0.3)
model.set_matl(mat, part)

# mesh model
model.set_eshape(eshape, 2)
model.set_etype('axisym', 'A0')
model.set_etype('plstress', 'A1', 0.1)
model.get_item('L15').set_ediv(8)
model.get_item('L6').set_ediv(8)
model.get_item('L2').set_ediv(24)
model.get_item('L10').set_ediv(24)
model.mesh(1.0, 'gmsh')
# mesh with 1.0 fineness, smaller is finer
# plot the part elements
model.plot_elements(model_name + '_elem', display=show_gui)