Skip to content

Commit

Permalink
Adding element offsets to shell and beam elements (#250)
Browse files Browse the repository at this point in the history
* Adding thickness offset option to iso shell constitutive

* Adding thickness offset option to composite shell constitutive

* Fixing problem in generateBDFCard

* Fixing problem in generateBDFCard

* Adding thickness offset to smeared composite class

* Adding thickness offset to smeared rectangular beam class

* Fixing broken test

* test debug

* reducing real tolerance for failing test

* Adding offset terms to shell inertia

* clang format

* Initialization bug fix

* Minor comment edit

* Adding offset terms to beam inertia

* Adding beam offset integration test

* Moving beam transform to separate header file

* Updating test docstring

* Adding plate offset integration test

* Adding additional docstrings to offset parameters

* Updating include statement in cython file to reflect new beam transfer header

* Minor comment edit

* Fixing index in smeared composite mass moment

* Fixing bugs in offset routine for smeared composite

* Fixing bugs in dv sens for shell moment of inertia

* Adding more offset tests

* clang format

* Fixing sign issue on shell moment term

* Fixing sign issue on beam mass moment terms

* clang format

* switching from cte to alpha kwargs

* Adding missing quadrature weight to beam inertial force

* clang format

* Adding mass moment to centrifugal force

* Adding centrifugal offset test to shell integration test
  • Loading branch information
timryanb authored Oct 2, 2023
1 parent 2ba120b commit e57cfd2
Show file tree
Hide file tree
Showing 31 changed files with 1,460 additions and 412 deletions.
8 changes: 4 additions & 4 deletions src/constitutive/TACSBasicBeamConstitutive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ TACSBasicBeamConstitutive::TACSBasicBeamConstitutive(
C[0] = E * A;
C[6] = G * J;
C[11] = E * Iz;
C[12] = E * Iyz;
C[12] = -E * Iyz;
C[15] = E * Iy;
C[18] = ky * G * A;
C[20] = kz * G * A;
Expand All @@ -131,9 +131,9 @@ TACSBasicBeamConstitutive::TACSBasicBeamConstitutive(
rho[0] = density * A;
rho[1] = 0.0;
rho[2] = 0.0;
rho[3] = density * Iy;
rho[4] = density * Iz;
rho[5] = density * Iyz;
rho[3] = density * Iz;
rho[4] = density * Iy;
rho[5] = -density * Iyz;
}

TACSBasicBeamConstitutive::~TACSBasicBeamConstitutive() {
Expand Down
20 changes: 14 additions & 6 deletions src/constitutive/TACSCompositeShellConstitutive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const char *TACSCompositeShellConstitutive::constName =
TACSCompositeShellConstitutive::TACSCompositeShellConstitutive(
int _num_plies, TACSOrthotropicPly **_ply_props,
const TacsScalar *_ply_thickness, const TacsScalar *_ply_angles,
TacsScalar _kcorr) {
TacsScalar _kcorr, TacsScalar _tOffset) {
num_plies = _num_plies;
ply_thickness = new TacsScalar[num_plies];
ply_angles = new TacsScalar[num_plies];
Expand All @@ -42,6 +42,7 @@ TACSCompositeShellConstitutive::TACSCompositeShellConstitutive(
}

kcorr = _kcorr;
tOffset = _tOffset;
}

TACSCompositeShellConstitutive::~TACSCompositeShellConstitutive() {
Expand Down Expand Up @@ -83,7 +84,7 @@ void TACSCompositeShellConstitutive::evalMassMoments(int elemIndex,
}

// Compute the contribution to the mass moment from each layer
TacsScalar t0 = -0.5 * t;
TacsScalar t0 = -(0.5 + tOffset) * t;
for (int i = 0; i < num_plies; i++) {
TacsScalar rho_ply = ply_props[i]->getDensity();
TacsScalar t1 = t0 + ply_thickness[i];
Expand Down Expand Up @@ -131,7 +132,7 @@ void TACSCompositeShellConstitutive::evalStress(int elemIndex,
}

// Compute the contribution to the stiffness from each layer
TacsScalar t0 = -0.5 * t;
TacsScalar t0 = -(0.5 + tOffset) * t;
for (int k = 0; k < num_plies; k++) {
TacsScalar Qbar[6], Abar[3];
ply_props[k]->calculateQbar(ply_angles[k], Qbar);
Expand Down Expand Up @@ -174,7 +175,7 @@ TacsScalar TACSCompositeShellConstitutive::evalFailure(
for (int i = 0; i < num_plies; i++) {
t += ply_thickness[i];
}
TacsScalar t0 = -0.5 * t;
TacsScalar t0 = -(0.5 + tOffset) * t;

// Keep track of the maximum failure criterion
TacsScalar max = 0.0;
Expand Down Expand Up @@ -207,7 +208,7 @@ TacsScalar TACSCompositeShellConstitutive::evalFailureStrainSens(
for (int i = 0; i < num_plies; i++) {
t += ply_thickness[i];
}
TacsScalar t0 = -0.5 * t;
TacsScalar t0 = -(0.5 + tOffset) * t;

// Keep track of the maximum failure criterion
TacsScalar max = 0.0;
Expand Down Expand Up @@ -270,7 +271,7 @@ void TACSCompositeShellConstitutive::evalTangentStiffness(int elemIndex,
}

// Compute the contribution to the stiffness from each layer
TacsScalar t0 = -0.5 * t;
TacsScalar t0 = -(0.5 + tOffset) * t;
for (int k = 0; k < num_plies; k++) {
TacsScalar Qbar[6], Abar[3];
ply_props[k]->calculateQbar(ply_angles[k], Qbar);
Expand Down Expand Up @@ -353,3 +354,10 @@ void TACSCompositeShellConstitutive::getPlyAngles(TacsScalar *_ply_angles) {
_ply_angles[i] = ply_angles[i];
}
}

/*
Get thickness offset
*/
TacsScalar TACSCompositeShellConstitutive::getThicknessOffset() {
return tOffset;
}
6 changes: 4 additions & 2 deletions src/constitutive/TACSCompositeShellConstitutive.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ class TACSCompositeShellConstitutive : public TACSShellConstitutive {
TACSOrthotropicPly **_ply_props,
const TacsScalar *_ply_thickness,
const TacsScalar *_ply_angles,
TacsScalar _kcorr = 5.0 / 6.0);
TacsScalar _kcorr = 5.0 / 6.0,
TacsScalar _tOffset = 0.0);
~TACSCompositeShellConstitutive();

// Evaluate the material density
Expand Down Expand Up @@ -78,13 +79,14 @@ class TACSCompositeShellConstitutive : public TACSShellConstitutive {
// Get ply angles and thicknesses
void getPlyThicknesses(TacsScalar *_ply_thickness);
void getPlyAngles(TacsScalar *_ply_angles);
TacsScalar getThicknessOffset();

private:
// Store information about the design variable
int num_plies;
TACSOrthotropicPly **ply_props;
TacsScalar *ply_thickness, *ply_angles;
TacsScalar kcorr;
TacsScalar kcorr, tOffset;

// The object name
static const char *constName;
Expand Down
Loading

0 comments on commit e57cfd2

Please sign in to comment.