Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions structuralcodes/sections/section_integrators/_shell_integrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,11 @@ def prepare_input(
prepared_input = []
IA = []
z_list = []

# A positive in-plane strain gives tension
# A positive curvature gives a negative strain for a positive z-value
for z in z_coords:
fiber_strain = strain[:3] + z * strain[3:]
fiber_strain = strain[:3] - z * strain[3:]
if integrate == 'stress':
integrand = material.constitutive_law.get_stress(fiber_strain)
elif integrate == 'modulus':
Expand All @@ -81,7 +84,7 @@ def prepare_input(
z_r = r.z
material = r.material

fiber_strain = strain[:3] + z_r * strain[3:]
fiber_strain = strain[:3] - z_r * strain[3:]
eps_sj = r.T @ fiber_strain

if integrate == 'stress':
Expand Down Expand Up @@ -118,9 +121,12 @@ def integrate_stress(
Nx = np.sum(fiber_stress[:, 0])
Ny = np.sum(fiber_stress[:, 1])
Nxy = np.sum(fiber_stress[:, 2])
Mx = np.sum(fiber_stress[:, 0] * z)
My = np.sum(fiber_stress[:, 1] * z)
Mxy = np.sum(fiber_stress[:, 2] * z)

# A positive stress at a positive z-value gives a negative moment
# contribution
Mx = -np.sum(fiber_stress[:, 0] * z)
My = -np.sum(fiber_stress[:, 1] * z)
Mxy = -np.sum(fiber_stress[:, 2] * z)
return Nx, Ny, Nxy, Mx, My, Mxy

def integrate_modulus(
Expand All @@ -142,7 +148,7 @@ def integrate_modulus(
D = np.zeros((3, 3))
for C_layer, z_i in zip(MA, z):
A += C_layer
B += z_i * C_layer
B -= z_i * C_layer
D += z_i**2 * C_layer

return np.block([[A, B], [B, D]])
Expand Down