Semi-analytical models for plates, shells and panels (panels)#

Models for plates, shells, stiffened panels, single or multi-domain are available in this package.

class panels.shell.Shell(a=None, b=None, r=None, stack=None, plyt=None, laminaprop=None, rho=0, m=11, n=11, offset=0.0, **kwargs)#

General shell class that can be used for plates or shells

It works for both plates and cylindrical shells. The right model is selected according to parameter r (radius).

The approximation functions for the displacement fields are built using Bardell’s functions.

Parameters:
afloat, optional

Length (along the \(x\) coordinate).

bfloat, optional

Width (along the \(y\) coordinate).

rfloat, optional

Radius for cylindrical shell.

stacklist or tuple, optional

A sequence representing the angles for each ply.

plytfloat, optional

Ply thickness.

laminaproplist or tuple, optional

Orthotropic lamina properties: \(E_1, E_2, \nu_{12}, G_{12}, G_{13}, G_{23}\).

rhofloat, optional

Material density.

m, nint, optional

Number of terms for the approximation functions along \(x\) and \(y\), respectively.

offsetfloat, optional

Laminate offset about shell mid-surface. The offset is measured along the normal (\(z\)) axis.

Attributes:
ABD
Mach
Nxx
Nxx_cte
Nxy
Nxy_cte
Nyy
Nyy_cte
a
aeromu
air_speed
b
bay
beta
col_end
col_start
distr_loads
distr_loads_inc
distr_pds
distr_pds_inc
fields
flow
force_orthotropic_laminate
fsdt_shear_correction
gamma
group
increments
lam
laminaprop
laminaprops
m
matrices
model
n
name
num_eigvalues
num_eigvalues_print
nx
ny
offset
out_num_cores
plot_mesh
plyt
plyts
point_loads
point_loads_inc
point_pds
point_pds_inc
r
results
rho
rho_air
rhos
row_end
row_start
size
speed_sound
stack
x0
x1
x1u
x1ur
x1v
x1vr
x1w
x1wr
x2
x2u
x2ur
x2v
x2vr
x2w
x2wr
y0
y1
y1u
y1ur
y1v
y1vr
y1w
y1wr
y2
y2u
y2ur
y2v
y2vr
y2w
y2wr

Methods

add_distr_load_fixed_x(x[, funcx, funcy, ...])

Add a distributed force g(y) at a fixed x position

add_distr_load_fixed_y(y[, funcx, funcy, ...])

Add a distributed force g(x) at a fixed y position

add_distr_pd_fixed_x(x[, ku, kv, kw, funcu, ...])

Add a distributed prescribed displacement g(y) at a fixed x position

add_distr_pd_fixed_y(y[, ku, kv, kw, funcu, ...])

Add a distributed prescribed displacement g(x) at a fixed y position

add_point_load(x, y, fx, fy, fz[, cte])

Add a point load with three components

add_point_pd(x, y, ku, up, kv, vp, kw, wp[, cte])

Add a point prescribed displacement with three components

calc_cA(aeromu[, silent, size, finalize])

Calculate the aerodynamic damping matrix using the piston theory

calc_fext([inc, size, col0, silent])

Calculate the external force vector \(\{F_{ext}\}\)

calc_fint(c[, size, col0, silent, nx, ny, ...])

Calculate the internal force vector \(\{F_{int}\}\)

calc_kA([size, row0, col0, silent, finalize])

Calculate the aerodynamic matrix using the linear piston theory

calc_kC([size, row0, col0, silent, ...])

Calculate the constitutive stiffness matrix

calc_kG([size, row0, col0, silent, ...])

Calculate the (inital stress or) geometric stiffness matrix

calc_kM([size, row0, col0, h_nxny, ...])

Calculate the mass matrix

calc_stiffness_point_constraint(x, y[, u, ...])

Add a point constraint

clear_disps()

Used to clear exisiting displacements for the panels

clear_loads()

Used to clear exisiting loads for the panels

get_size()

Calculate the size of the stiffness matrices

save()

Save the Shell object using pickle

strain(c[, xs, ys, gridx, gridy, NLgeom])

Calculate the strain field

stress(c[, ABD, xs, ys, gridx, gridy, NLgeom])

Calculate the stress field

uvw(c[, xs, ys, gridx, gridy])

Calculate the displacement field

calc_kT

add_distr_load_fixed_x(x, funcx=None, funcy=None, funcz=None, cte=True)#

Add a distributed force g(y) at a fixed x position

Parameters:
xfloat

The fixed \(x\) position.

funcx, funcy, funczfunction, optional

The functions of the distributed force components, will be used from \(y=0\) to \(y=b\). At least one of the three must be defined

ctebool, optional

Constant forces are not incremented during the non-linear analysis.

add_distr_load_fixed_y(y, funcx=None, funcy=None, funcz=None, cte=True)#

Add a distributed force g(x) at a fixed y position

Parameters:
yfloat

The fixed \(y\) position.

funcx, funcy, funczfunction, optional

The functions of the distributed force components, will be used from \(x=0\) to \(x=a\). At least one of the three must be defined

ctebool, optional

Constant forces are not incremented during the non-linear analysis.

add_distr_pd_fixed_x(x, ku=None, kv=None, kw=None, funcu=None, funcv=None, funcw=None, cte=True)#

Add a distributed prescribed displacement g(y) at a fixed x position

Parameters:
xfloat

The fixed \(x\) position.

ku, kv, kwfloat, optional

The \(x,y,z\) components of the penalty stiffness of the prescribed displacement. At least one of the three must be defined, and corresponding to the funcu, funcv, funcw specified.

funcu, funcv, funcwtype: function, optional

Specify in normal coordinates (x,y) not natural The functions of the distributed prescribed displacements, will be used from \(y=0\) to \(y=b\). At least one of the three must be defined, and corresponding to the ku, kv, kw specified.

ctebool, optional

Constant prescribed displacements are not incremented during the non-linear analysis.

add_distr_pd_fixed_y(y, ku=None, kv=None, kw=None, funcu=None, funcv=None, funcw=None, cte=True)#

Add a distributed prescribed displacement g(x) at a fixed y position

Parameters:
yfloat

The fixed \(y\) position.

ku, kv, kwfloat, optional

The \(x,y,z\) components of the penalty stiffness of the prescribed displacement. At least one of the three must be defined, and corresponding to the funcu, funcv, funcw specified.

funcu, funcv, funcwtype: function, optional

The functions of the distributed prescribed displacements, will be used from \(y=0\) to \(y=b\). At least one of the three must be defined, and corresponding to the ku, kv, kw specified.

ctebool, optional

Constant prescribed displacements are not incremented during the non-linear analysis.

add_point_load(x, y, fx, fy, fz, cte=True)#

Add a point load with three components

Parameters:
xfloat

The \(x\) position.

yfloat

The \(y\) position in radians.

fxfloat

The \(x\) component of the force vector.

fyfloat

The \(y\) component of the force vector.

fzfloat

The \(z\) component of the force vector.

ctebool, optional

Constant forces are not incremented during the non-linear analysis.

add_point_pd(x, y, ku, up, kv, vp, kw, wp, cte=True)#

Add a point prescribed displacement with three components

o/p = [location and equivalent force]

Parameters:
xfloat

The \(x\) position.

yfloat

The \(y\) position in radians.

ku, kv, kwfloat

The \(x,y,z\) component of the penalty stiffness of the prescribed displacement.

up, vp, wpfloat

The \(x,y,z\) components of the prescribed displacement.

ctebool, optional

Constant prescribed displacements are not incremented during the non-linear analysis.

calc_cA(aeromu, silent=True, size=None, finalize=True)#

Calculate the aerodynamic damping matrix using the piston theory

calc_fext(inc=1.0, size=None, col0=0, silent=True)#

Calculate the external force vector \(\{F_{ext}\}\)

Recall that:

\[\{F_{ext}\}=\{{F_{ext}}_0\} + \{{F_{ext}}_\lambda\}\]

such that the terms in \(\{{F_{ext}}_0\}\) are constant and the terms in \(\{{F_{ext}}_\lambda\}\) will be scaled by the parameter inc.

See the documentation of shell_fext() for more details.

Parameters:
incfloat, optional

Since this function is called during the non-linear analysis, inc will multiply the terms \(\{{F_{ext}}_\lambda\}\).

sizeint or str, optional

The size of the force vector. Can be the size of the total internal force vector of a multidomain assembly. When using a string, for example, if ‘+1’ is given it will add 1 to the Shell`s size obtained by the Shell.get_size()

col0int, optional

Offset in a global force vector of an assembly.

silentbool, optional

A boolean to tell whether the log messages should be printed.

Returns:
fextnp.ndarray

The external force vector

calc_fint(c, size=None, col0=0, silent=True, nx=None, ny=None, ABDnxny=None)#

Calculate the internal force vector \(\{F_{int}\}\)

Parameters:
cnp.ndarray

The Ritz constants vector to be used for the internal forces calculation.

sizeint or str, optional

The size of the internal force vector. Can be the size of a global internal force vector of an assembly. When using a string, for example, if ‘+1’ is given it will add 1 to the Shell`s size obtained by the Shell.get_size()

col0int, optional

Offset in a global internal force vector of an assembly.

silentbool, optional

A boolean to tell whether the log messages should be printed.

nxint, optional

Number of integration points along \(x\).

nyint, optional

Number of integration points along \(y\).

ABDnxnynp.ndarray, optional

Laminate stiffness for each integration point, if not supplied it will assume constant properties over the shell domain.

Returns:
fintnp.ndarray

The internal force vector

calc_kA(size=None, row0=0, col0=0, silent=True, finalize=True)#

Calculate the aerodynamic matrix using the linear piston theory

calc_kC(size=None, row0=0, col0=0, silent=True, finalize=True, c=None, c_cte=None, nx=None, ny=None, ABDnxny=None, NLgeom=False)#

Calculate the constitutive stiffness matrix

If c is not given it calculates the linear constitutive stiffness matrix, otherwise the large displacement linear constitutive stiffness matrix is calculated. When using c the size of c must be the same as the attribute size.

In multi-domain semi-analytical models the sparse matrices that are calculated may have the size of the assembled global model, and the current constitutive matrix being calculated starts at position row0 and col0.

Parameters:
sizeint or str, optional

The size of the calculated sparse matrices. When using a string, for example, if ‘+1’ is given it will add 1 to the Shell`s size obtained by the Shell.get_size()

row0, col0: int or None, optional

Offset to populate the output sparse matrix (necessary when assemblying shells).

silentbool, optional

A boolean to tell whether the log messages should be printed.

finalizebool, optional

Asserts validity of output data and makes the output matrix symmetric, should be False when assemblying.

carray-like or None, optional

This must be the result of a static analysis, used to compute non-linear terms based on the actual displacement field.

c_ctearray-like or None, optional

This must be the result of a static analysis, used to compute initial stress state not affected by the load multiplier of the linear buckling eigenvalue analysis.

nx, nyint or None, optional

Number of integration points along \(x\) and \(y\), respectively, for the Legendre-Gauss quadrature rule applied in the numerical integration. Only used when c is given.

ABDnxny4-D array-like or None, optional

The constitutive relations for the laminate at each integration point. Must be a 4-D array of shape (nx, ny, 6, 6) when using classical laminated plate theory models.

NLgeombool, optional

Flag to indicate if geometrically non-linearities should be considered.

calc_kG(size=None, row0=0, col0=0, silent=True, finalize=True, c=None, nx=None, ny=None, ABDnxny=None, NLgeom=False)#

Calculate the (inital stress or) geometric stiffness matrix

See Shell.calc_kC() for details on each parameter.

calc_kM(size=None, row0=0, col0=0, h_nxny=None, rho_nxny=None, nx=None, ny=None, silent=True, finalize=True)#

Calculate the mass matrix

Parameters:
h_nxny(nx, ny) array-like or None, optional

The constitutive relations for the laminate at each integration point.

rho_nxny(nx, ny) array-like or None, optional

The material density for the laminate at each integration point. If multiple materials exist for the different plies, calculate rho using a weighted average.

calc_stiffness_point_constraint(x, y, u=True, v=True, w=True, phix=False, phiy=False, kuvw=1000000.0, kphi=100000.0)#

Add a point constraint

This can used to create different types of support and boundary conditions.

Parameters:
x, yfloat

Coordinates of the point contraint

u, v, wbool, optional

Translational degrees of freedom to be constrained

phix, phiybool, optional

Rotational degrees of freedom to be constrained

kuvwfloat, optional

Penalty constant used for the translational constraints

kphi

Penalty constant used for the rotational constraints

Returns:
kPCcsr_matrix

Stiffness matrix concenrning this point constraint. It must be added to the constitutive stiffness matrix in order to be taken into account in the calculations.

clear_disps()#
Used to clear exisiting displacements for the panels

Useful for non-linear runs where displacements are added for each increment

clear_loads()#
Used to clear exisiting loads for the panels

Useful for non-linear runs where loads are added for each increment

get_size()#

Calculate the size of the stiffness matrices

The size of the stiffness matrices can be interpreted as the number of rows or columns, recalling that this will be the size of the Ritz constants’ vector \(\{c\}\), the internal force vector \(\{F_{int}\}\) and the external force vector \(\{F_{ext}\}\).

ONLY RETURNS THE NUMBER OF ROWS ‘’OR’’ COLS

Returns:
sizeint

The size of the stiffness matrices. Can be the size of a global internal force vector of an assembly. When using a string, for example, if ‘+1’ is given it will add 1 to the Shell`s size obtained by the Shell.get_size()

save()#

Save the Shell object using pickle

Notes

The pickled file will have the name stored in Shell.name followed by a '.Shell' extension.

strain(c, xs=None, ys=None, gridx=300, gridy=300, NLgeom=True)#

Calculate the strain field

Parameters:
cnp.ndarray

The Ritz constants vector to be used for the strain field calculation.

xsnp.ndarray, optional

The \(x\) coordinates where to calculate the strains.

ysnp.ndarray, optional

The \(y\) coordinates where to calculate the strains, must have the same shape as xs.

gridxint, optional

When xs and ys are not supplied, gridx and gridy are used.

gridyint, optional

When xs and ys are not supplied, gridx and gridy are used.

NLgeombool

Flag to indicate whether non-linear strain components should be considered.

Returns:
resdict

A dictionary of np.ndarrays with the keys: (x, y, exx, eyy, gxy, kxx, kyy, kxy)

stress(c, ABD=None, xs=None, ys=None, gridx=300, gridy=300, NLgeom=True)#

Calculate the stress field

Parameters:
cnp.ndarray

The Ritz constants vector to be used for the strain field calculation.

ABDnp.ndarray, optional

The laminate stiffness matrix. Can be a 6 x 6 (ABD) matrix for homogeneous laminates over the whole domain.

xsnp.ndarray, optional

The \(x\) coordinates where to calculate the strains.

ysnp.ndarray, optional

The \(y\) coordinates where to calculate the strains, must have the same shape as xs.

gridxint, optional

When xs and ys are not supplied, gridx and gridy are used.

gridyint, optional

When xs and ys are not supplied, gridx and gridy are used.

NLgeombool

Flag to indicate whether non-linear strain components should be considered.

Returns:
resdict

A dictionary of np.ndarrays with the keys: (x, y, Nxx, Nyy, Nxy, Mxx, Myy, Mxy)

uvw(c, xs=None, ys=None, gridx=300, gridy=300)#

Calculate the displacement field

For a given full set of Ritz constants c, the displacement field is calculated and stored in the fields parameter of the Shell` object.

Parameters:
cfloat

The full set of Ritz constants

xsnp.ndarray

The \(x\) positions where to calculate the displacement field. Default is None and the method _default_field is used.

ysnp.ndarray

The y positions where to calculate the displacement field. Default is None and the method _default_field is used.

gridxint

Number of points along the \(x\) axis where to calculate the displacement field.

gridyint

Number of points along the \(y\) where to calculate the displacement field.

Returns:
outtuple

Containing plot_mesh and fields

panels.shell_fext.shell_fext(shell, inc, size, col0)#

Calculate the external force vector

The function reads the following attributes of the Shell object:

  • shell.point_loads : list of point loads, each described with [x, y, fx, fy, fz]. See Shell.add_point_load().

  • shell.point_loads_inc : similar to point_loads but this is affected by the load increment in nonlinear analyses.

  • shell.distr_loads : list of distributed loads, each described with [x, None, funcx, funcy, funcz] or [None, y, funcx, funcy, funcz] where x or y are the variable over which the load is distributed. See Shell.add_distr_load_fixed_x() or Shell.add_distr_load_fixed_y().

  • shell.distr_loads_inc : similar to distr_loads, but this is affected by the load increment in nonlinear analyses.

  • shell.point_pds : list of prescribed point displacements, each described with [x, y, ku*up, kv*vp, kw*wp]. See Shell.add_point_pd().

  • shell.point_pds_inc : similar to point_pds, but this is affected by the load increment in nonlinear analyses.

  • shell.distr_pds : list of distributed prescribed displacements, each described with [x, None, ku*funcu, kv*funcv, kw*funcw] or [None, y, ku*funcu, kv*funcv, kw*funcw] where x or y are the variable over which the displacement is distributed. See Shell.add_distr_pd_fixed_x() or Shell.add_distr_pd_fixed_y().

  • shell.distr_pds_inc : similar as distr_pds, but this is affected by the load increment in nonlinear analyses.

Parameters:
shellShell

The shell object.

incfloat, optional

Since this function is called during the non-linear analysis, inc will multiply the terms \(\{{F_{ext}}_\lambda\}\). col0 = starting col in the global matrix ?????

sizeint or str, optional

The size of the force vector. Can be the size of the total internal force vector of a multidomain assembly. When using a string, for example, if ‘+1’ is given it will add 1 to the Shell`s size obtained by the Shell.get_size()

col0int, optional

Offset in a global internal force vector of an assembly.

Returns:
fextnp.ndarray

The external force vector.

panels.plot_shell.plot_shell(shell, c, invert_y=False, vec='w', deform_u=False, deform_u_sf=100.0, filename='', ax=None, figsize=(3.5, 2.0), save=True, title='', colorbar=False, cbar_nticks=2, cbar_format=None, cbar_title='', cbar_fontsize=10, colormap='jet', aspect='equal', clean=True, dpi=400, texts=[], xs=None, ys=None, gridx=300, gridy=300, num_levels=400, vecmin=None, vecmax=None, plot_offset_x=0.0, plot_offset_y=0.0, NLgeom=True)#

Contour plot for a Ritz constants vector.

Parameters:
carray_like

The Ritz constants that will be used to compute the field contour.

vecstr, optional

Can be one of the components:

  • Displacement: 'u', 'v', 'w', 'phix', 'phiy'

  • Strain: 'exx', 'eyy', 'gxy', 'kxx', 'kyy', 'kxy', 'gyz', 'gxz'

  • Stress: 'Nxx', 'Nyy', 'Nxy', 'Mxx', 'Myy', 'Mxy', 'Qy', 'Qx'

deform_ubool, optional

If True the contour plot will look deformed.

deform_u_sffloat, optional

The scaling factor used to deform the contour.

invert_ybool, optional

Inverts the \(y\) axis of the plot.

savebool, optional

Flag telling whether the contour should be saved to an image file.

dpiint, optional

Resolution of the saved file in dots per inch.

filenamestr, optional

The file name for the generated image file. If no value is given, the \(name\) parameter of the Shell object will be used.

axAxesSubplot, optional

When ax is given, the contour plot will be created inside it.

figsizetuple, optional

The figure size given by (width, height).

titlestr, optional

If any string is given it is added as title to the contour plot.

colorbarbool, optional

If a colorbar should be added to the contour plot.

cbar_nticksint, optional

Number of ticks added to the colorbar.

cbar_format[ None | format string | Formatter object ], optional

See the matplotlib.pyplot.colorbar documentation.

cbar_titlestr, optional

Colorbar title. If cbar_title == '' no title is added.

cbar_fontsizeint, optional

Fontsize of the colorbar labels.

colormapstring, optional

Name of a matplotlib available colormap.

aspectstr, optional

String that will be passed to the AxesSubplot.set_aspect() method.

cleanbool, optional

Clean axes ticks, grids, spines etc.

xsarray_like, optional

The \(x\) positions where to calculate the displacement field. Default is None and the method _default_field is used.

ysarray_like, optional

The y positions where to calculate the displacement field. Default is None and the method _default_field is used.

gridxint, optional

Number of points along the \(x\) axis where to calculate the displacement field.

gridyint, optional

Number of points along the \(y\) where to calculate the displacement field.

num_levelsint, optional

Number of contour levels (higher values make the contour smoother).

vecminfloat, optional

Minimum value for the contour scale (useful to compare with other results). If not specified it will be taken from the calculated field.

vecmaxfloat, optional

Maximum value for the contour scale.

Returns:
axmatplotlib.axes.Axes

The Matplotlib object that can be used to modify the current plot if needed.