b2api
B2000++ API Reference Manual, VERSION 4.6
 
Loading...
Searching...
No Matches
b2material_stress_3d_mesh_deform.H
1//------------------------------------------------------------------------
2// b2material_stress_3d_mesh_deform.H --
3//
4// Material used for 3D Mesh Deformation (Aero-Elasticity).
5//
6// written by Thomas Ludwig
7// Neda Ebrahimi Pour <neda.ebrahimipour@dlr.de>
8//
9// (c) 2009-2012,2016 SMR Engineering & Development SA
10// 2502 Bienne, Switzerland
11//
12// (c) 2023 Deutsches Zentrum für Luft- und Raumfahrt (DLR) e.V.
13// Linder Höhe, 51147 Köln
14//
15// All Rights Reserved. Proprietary source code. The contents of
16// this file may not be disclosed to third parties, copied or
17// duplicated in any form, in whole or in part, without the prior
18// written permission of SMR.
19//------------------------------------------------------------------------
20
21#ifndef B2MATERIAL_STRESS_3D_MESH_DEFORM_H_
22#define B2MATERIAL_STRESS_3D_MESH_DEFORM_H_
23
24#include "elements/properties/b2solid_mechanics.H"
26
27namespace b2000 {
28
29class MaterialStress3DMeshDeform : public SolidMechanics3D<double> {
30public:
31 void get_stress(
32 Model* model, const bool linear, const EquilibriumSolution equilibrium_solution,
33 const double time, const double delta_time, GradientContainer* gradient_container,
34 SolverHints* solver_hints, const Element* element, const double el_coordinates[3],
35 const int layer_id,
36 const b2linalg::Vector<double, b2linalg::Vdense_constref> nodes_interpolation,
37 const double bg_coordinates[3], const double covariant_base[3][3],
38 const bool use_covariant_base, const double volume,
39 const double displacement_gradient[3][3], const double strain[6],
40 const double strain_dot[6], const double velocity[3], const double acceleration[3],
41 double stress[6], double d_stress_d_strain[21], double d_stress_d_strain_dot[21],
42 double d_stress_d_time[6], double inertia_force[3], double& density) override;
43
44 inline void s_eq_c_mul_e(double s[6], const double c[21], const double e[6]) {
45 const int ind[6][6] = {{0, 1, 2, 3, 4, 5}, {1, 6, 7, 8, 9, 10},
46 {2, 7, 11, 12, 13, 14}, {3, 8, 12, 15, 16, 17},
47 {4, 9, 13, 16, 18, 19}, {5, 19, 14, 17, 19, 20}};
48
49 for (int i = 0; i < 6; ++i) {
50 double value = 0.0;
51
52 const int* iind = ind[i];
53 for (int j = 0; j < 6; ++j) { value += c[iind[j]] * e[j]; }
54 s[i] = value;
55 }
56 }
57
58 // Transform the 2nd Piola-Kirchhoff stress to the Cauchy
59 // stress. The stresses are in the Voight notation [sxx, syy,
60 // szz, sxy, syz, sxz].
61 static inline void piola_2_stress_to_cauchy_stress(
62 const double F[3][3], // Deformation gradient, column-major.
63 const double S[6], // 2nd Piola-Kirchhoff stress (Voight not.).
64 double T[6] // Cauchy stress (Voight notation).
65 ) {
66 const double f00 = F[0][0];
67 const double f01 = F[1][0];
68 const double f02 = F[2][0];
69 const double f10 = F[0][1];
70 const double f11 = F[1][1];
71 const double f12 = F[2][1];
72 const double f20 = F[0][2];
73 const double f21 = F[1][2];
74 const double f22 = F[2][2];
75
76 // Get the determinant of the deformation gradient tensor..
77 const double det = determinant_3_3(F);
78 const double det_inv = 1.0 / det;
79
80 T[0] = f00 * f00 * S[0] + f10 * f10 * S[1] + f20 * f20 * S[2] + 2 * f00 * f10 * S[3]
81 + 2 * f10 * f20 * S[4] + 2 * f20 * f00 * S[5];
82
83 T[1] = f01 * f01 * S[0] + f11 * f11 * S[1] + f21 * f21 * S[2] + 2 * f01 * f11 * S[3]
84 + 2 * f11 * f21 * S[4] + 2 * f21 * f01 * S[5];
85
86 T[2] = f02 * f02 * S[0] + f12 * f12 * S[1] + f22 * f22 * S[2] + 2 * f02 * f12 * S[3]
87 + 2 * f12 * f22 * S[4] + 2 * f22 * f02 * S[5];
88
89 T[3] = f00 * f01 * S[0] + f10 * f11 * S[1] + f20 * f21 * S[2]
90 + (f00 * f11 + f10 * f01) * S[3] + (f10 * f21 + f20 * f11) * S[4]
91 + (f20 * f01 + f00 * f21) * S[5];
92
93 T[4] = f01 * f02 * S[0] + f11 * f12 * S[1] + f21 * f22 * S[2]
94 + (f01 * f12 + f11 * f02) * S[3] + (f11 * f22 + f21 * f12) * S[4]
95 + (f21 * f02 + f01 * f22) * S[5];
96
97 T[5] = f02 * f00 * S[0] + f12 * f10 * S[1] + f22 * f20 * S[2]
98 + (f02 * f10 + f12 * f00) * S[3] + (f12 * f20 + f22 * f10) * S[4]
99 + (f22 * f00 + f02 * f20) * S[5];
100
101 for (int i = 0; i < 6; ++i) { T[i] *= det_inv; }
102 }
103
104public:
105 double mat_e;
106 double mat_p;
107 double mat_density;
108};
109
110} // namespace b2000
111
112#endif // B2_MATERIAL_STRESS_3D_MESH_DEFORM_H_
virtual LinearType linear(const int layer_id=-1) const
Definition b2solid_mechanics.H:124
Contains the base classes for implementing Finite Elements.
Definition b2boundary_condition.H:32
T determinant_3_3(const T a[3][3])
Definition b2tensor_calculus.H:669