Skip to content

Commit d1be013

Browse files
authored
Correct the sign of calculated strain, stress resultant, and modulus (#310)
1 parent cff3144 commit d1be013

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

structuralcodes/sections/section_integrators/_shell_integrator.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,11 @@ def prepare_input(
6565
prepared_input = []
6666
IA = []
6767
z_list = []
68+
69+
# A positive in-plane strain gives tension
70+
# A positive curvature gives a negative strain for a positive z-value
6871
for z in z_coords:
69-
fiber_strain = strain[:3] + z * strain[3:]
72+
fiber_strain = strain[:3] - z * strain[3:]
7073
if integrate == 'stress':
7174
integrand = material.constitutive_law.get_stress(fiber_strain)
7275
elif integrate == 'modulus':
@@ -81,7 +84,7 @@ def prepare_input(
8184
z_r = r.z
8285
material = r.material
8386

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

8790
if integrate == 'stress':
@@ -118,9 +121,12 @@ def integrate_stress(
118121
Nx = np.sum(fiber_stress[:, 0])
119122
Ny = np.sum(fiber_stress[:, 1])
120123
Nxy = np.sum(fiber_stress[:, 2])
121-
Mx = np.sum(fiber_stress[:, 0] * z)
122-
My = np.sum(fiber_stress[:, 1] * z)
123-
Mxy = np.sum(fiber_stress[:, 2] * z)
124+
125+
# A positive stress at a positive z-value gives a negative moment
126+
# contribution
127+
Mx = -np.sum(fiber_stress[:, 0] * z)
128+
My = -np.sum(fiber_stress[:, 1] * z)
129+
Mxy = -np.sum(fiber_stress[:, 2] * z)
124130
return Nx, Ny, Nxy, Mx, My, Mxy
125131

126132
def integrate_modulus(
@@ -142,7 +148,7 @@ def integrate_modulus(
142148
D = np.zeros((3, 3))
143149
for C_layer, z_i in zip(MA, z):
144150
A += C_layer
145-
B += z_i * C_layer
151+
B -= z_i * C_layer
146152
D += z_i**2 * C_layer
147153

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

0 commit comments

Comments
 (0)