Documentation a537f1bdf2
Loading...
Searching...
No Matches
CFEANonlinearElasticity.hpp
Go to the documentation of this file.
1/*!
2 * \file CFEANonlinearElasticity.hpp
3 * \brief Declaration and inlines of the nonlinear elasticity FE numerics class.
4 * \author Ruben Sanchez
5 * \version 8.5.0 "Harrier"
6 *
7 * SU2 Project Website: https://su2code.github.io
8 *
9 * The SU2 Project is maintained by the SU2 Foundation
10 * (http://su2foundation.org)
11 *
12 * Copyright 2012-2026, SU2 Contributors (cf. AUTHORS.md)
13 *
14 * SU2 is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU Lesser General Public
16 * License as published by the Free Software Foundation; either
17 * version 2.1 of the License, or (at your option) any later version.
18 *
19 * SU2 is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 * Lesser General Public License for more details.
23 *
24 * You should have received a copy of the GNU Lesser General Public
25 * License along with SU2. If not, see <http://www.gnu.org/licenses/>.
26 */
27
28#pragma once
29
30#include "CFEAElasticity.hpp"
31
32/*!
33 * \class CFEANonlinearElasticity
34 * \brief Abstract class for computing the stiffness matrix of a nonlinear elasticity problem.
35 * This class does not implement a particular model, that will be done by its children.
36 * \note In addition to Compute_Constitutive_Matrix, derived classes MUST further implement
37 * Compute_Plane_Stress_Term and Compute_Stress_Tensor.
38 * \ingroup Elasticity_Equations
39 * \author R.Sanchez
40 * \version 8.5.0 "Harrier"
41 */
43
44protected:
45
46 su2double F_Mat[MAXNDIM][MAXNDIM]; /*!< \brief Deformation gradient. */
47 su2double b_Mat[MAXNDIM][MAXNDIM]; /*!< \brief Left Cauchy-Green Tensor. */
49
50 su2double J_F; /*!< \brief Jacobian of the transformation (determinant of F) */
51
52 su2double f33; /*!< \brief Plane stress term for non-linear 2D plane stress analysis */
53
54 bool nearly_incompressible; /*!< \brief Boolean to consider nearly_incompressible effects */
55
56 su2double b_Mat_Iso[MAXNDIM][MAXNDIM]; /*!< \brief Isocoric component of the left Cauchy-Green tensor. */
57
58 su2double cijkl[3][3][3][3]; /*!< \brief Constitutive tensor i,j,k,l (defined only for incompressibility - near inc.). */
59
60 bool maxwell_stress; /*!< \brief Consider the effects of the dielectric loads */
61
62 std::unique_ptr<su2double[]> EField_Ref_Unit; /*!< \brief Electric Field, unitary, in the reference configuration. */
63 std::unique_ptr<su2double[]> EField_Ref_Mod; /*!< \brief Electric Field, modulus, in the reference configuration. */
64 std::unique_ptr<su2double[]> EField_Curr_Unit; /*!< \brief Auxiliary vector for the unitary Electric Field in the current configuration. */
65 unsigned short nElectric_Field,
67
68 std::unique_ptr<su2double[]> ke_DE_i; /*!< \brief Electric Constant for Dielectric Elastomers. */
69
70 su2double ke_DE; /*!< \brief Electric Constant for Dielectric Elastomers. */
71 su2double EFieldMod_Ref; /*!< \brief Modulus of the electric field in the reference configuration. */
72
73public:
74 /*!
75 * \brief Default constructor deleted to avoid instantiation of derived classes without sizes.
76 */
78
79 /*!
80 * \brief Constructor of the class.
81 * \param[in] val_nDim - Number of dimensions of the problem.
82 * \param[in] val_nVar - Number of variables of the problem.
83 * \param[in] config - Definition of the particular problem.
84 */
85 CFEANonlinearElasticity(unsigned short val_nDim, unsigned short val_nVar, const CConfig *config);
86
87 /*!
88 * \brief Set element electric field.
89 * \param[in] i_DV - Index of the variable.
90 * \param[in] val_EField - Value of the field.
91 */
92 inline void Set_ElectricField(unsigned short i_DV, su2double val_EField) final {
93 EField_Ref_Mod[i_DV] = val_EField;
94 }
95
96 /*!
97 * \brief Build the tangent stiffness matrix of an element.
98 * \param[in,out] element_container - Element whose tangent matrix is being built.
99 * \param[in] config - Definition of the problem.
100 */
101 void Compute_Tangent_Matrix(CElement *element_container, const CConfig *config) final;
102
103 /*!
104 * \brief Compute the nodal stress terms for an element.
105 * \param[in,out] element_container - The finite element.
106 * \param[in] config - Definition of the problem.
107 */
108 void Compute_NodalStress_Term(CElement *element_container, const CConfig *config) final;
109
110 /*!
111 * \brief Compute averaged nodal stresses (for post processing).
112 * \param[in,out] element_container - The finite element.
113 * \param[in] config - Definition of the problem.
114 */
115 su2double Compute_Averaged_NodalStress(CElement *element_container, const CConfig *config) final;
116
117protected:
118 /*!
119 * \brief Compute the plane stress term.
120 * \param[in,out] element_container - The finite element.
121 * \param[in] config - Definition of the problem.
122 * \param[in] iGauss - Index of Gaussian integration point.
123 */
124 virtual void Compute_Plane_Stress_Term(CElement *element_container, const CConfig *config, unsigned short iGauss) = 0;
125
126 /*!
127 * \brief Compute the stress tensor.
128 * \param[in,out] element_container - The finite element.
129 * \param[in] config - Definition of the problem.
130 * \param[in] iGauss - Index of Gaussian integration point.
131 */
132 virtual void Compute_Stress_Tensor(CElement *element_container, const CConfig *config, unsigned short iGauss) = 0;
133
134 /*!
135 * \brief Update an element with Maxwell's stress.
136 * \param[in,out] element_container - The finite element.
137 * \param[in] config - Definition of the problem.
138 */
139 void Add_MaxwellStress(CElement *element_container, const CConfig *config);
140
141 /*!
142 * \brief Set element electric properties.
143 * \param[in] element_container - Element defining the properties.
144 * \param[in] config - Definition of the problem.
145 */
146 void SetElectric_Properties(const CElement *element_container, const CConfig *config);
147
148 /*!
149 * \brief Computes b_Mat.
150 */
152 for (unsigned short iVar = 0; iVar < MAXNDIM; iVar++) {
153 for (unsigned short jVar = 0; jVar < MAXNDIM; jVar++) {
154 b_Mat[iVar][jVar] = 0;
155 for (unsigned short kVar = 0; kVar < MAXNDIM; kVar++) {
156 b_Mat[iVar][jVar] += F_Mat[iVar][kVar]*F_Mat[jVar][kVar];
157 }
158 }
159 }
160 }
161
162 /*!
163 * \brief Computes the determinant of the deformation gradient.
164 */
165 void ComputeJ_F() {
166 J_F = F_Mat[0][0]*F_Mat[1][1]*F_Mat[2][2]+
167 F_Mat[0][1]*F_Mat[1][2]*F_Mat[2][0]+
168 F_Mat[0][2]*F_Mat[1][0]*F_Mat[2][1]-
169 F_Mat[0][2]*F_Mat[1][1]*F_Mat[2][0]-
170 F_Mat[1][2]*F_Mat[2][1]*F_Mat[0][0]-
171 F_Mat[2][2]*F_Mat[0][1]*F_Mat[1][0];
172 }
173
174 /*!
175 * \brief Computes the deformation gradient transpose inverse.
176 */
177 template <typename Mat>
178 void Compute_FmT_Mat(const Mat& F_Mat, const su2double& J_F, Mat& FmT_Mat) const {
179 FmT_Mat[0][0] = (F_Mat[1][1]*F_Mat[2][2] - F_Mat[1][2]*F_Mat[2][1]) / J_F;
180 FmT_Mat[0][1] = (F_Mat[1][2]*F_Mat[2][0] - F_Mat[2][2]*F_Mat[1][0]) / J_F;
181 FmT_Mat[0][2] = (F_Mat[1][0]*F_Mat[2][1] - F_Mat[1][1]*F_Mat[2][0]) / J_F;
182
183 FmT_Mat[1][0] = (F_Mat[0][2]*F_Mat[2][1] - F_Mat[0][1]*F_Mat[2][2]) / J_F;
184 FmT_Mat[1][1] = (F_Mat[0][0]*F_Mat[2][2] - F_Mat[2][0]*F_Mat[0][2]) / J_F;
185 FmT_Mat[1][2] = (F_Mat[0][1]*F_Mat[2][1] - F_Mat[0][0]*F_Mat[2][0]) / J_F;
186
187 FmT_Mat[2][0] = (F_Mat[0][1]*F_Mat[1][2] - F_Mat[0][2]*F_Mat[1][1]) / J_F;
188 FmT_Mat[2][1] = (F_Mat[0][2]*F_Mat[1][0] - F_Mat[0][0]*F_Mat[1][2]) / J_F;
189 FmT_Mat[2][2] = (F_Mat[0][0]*F_Mat[1][1] - F_Mat[0][1]*F_Mat[1][0]) / J_F;
190 }
191
192 /*!
193 * \brief TODO: Describe what this does.
194 */
195 void Compute_Isochoric_F_b(void);
196
197 /*!
198 * \brief Assign elements of constitutive tensor to matrix D.
199 */
200 void Assign_cijkl_D_Mat(void);
201
202};
Declaration and inlines of the base class for elasticity problems.
Main class for defining the problem; basically this class reads the configuration file,...
Definition CConfig.hpp:64
Abstract class for defining finite elements.
Definition CElement.hpp:58
Abstract class for computing the tangent matrix and the residual for structural problems.
Definition CFEAElasticity.hpp:44
Abstract class for computing the stiffness matrix of a nonlinear elasticity problem....
Definition CFEANonlinearElasticity.hpp:42
void Compute_Tangent_Matrix(CElement *element_container, const CConfig *config) final
Build the tangent stiffness matrix of an element.
Definition CFEANonlinearElasticity.cpp:126
su2double cijkl[3][3][3][3]
Constitutive tensor i,j,k,l (defined only for incompressibility - near inc.).
Definition CFEANonlinearElasticity.hpp:58
void Compute_Isochoric_F_b(void)
TODO: Describe what this does.
Definition CFEANonlinearElasticity.cpp:476
su2double f33
Plane stress term for non-linear 2D plane stress analysis.
Definition CFEANonlinearElasticity.hpp:52
void SetElectric_Properties(const CElement *element_container, const CConfig *config)
Set element electric properties.
Definition CFEANonlinearElasticity.cpp:460
su2double b_Mat[MAXNDIM][MAXNDIM]
Left Cauchy-Green Tensor.
Definition CFEANonlinearElasticity.hpp:47
su2double J_F
Jacobian of the transformation (determinant of F)
Definition CFEANonlinearElasticity.hpp:50
su2double b_Mat_Iso[MAXNDIM][MAXNDIM]
Isocoric component of the left Cauchy-Green tensor.
Definition CFEANonlinearElasticity.hpp:56
su2double EFieldMod_Ref
Modulus of the electric field in the reference configuration.
Definition CFEANonlinearElasticity.hpp:71
void Compute_FmT_Mat(const Mat &F_Mat, const su2double &J_F, Mat &FmT_Mat) const
Computes the deformation gradient transpose inverse.
Definition CFEANonlinearElasticity.hpp:178
su2double Compute_Averaged_NodalStress(CElement *element_container, const CConfig *config) final
Compute averaged nodal stresses (for post processing).
Definition CFEANonlinearElasticity.cpp:554
su2double ke_DE
Electric Constant for Dielectric Elastomers.
Definition CFEANonlinearElasticity.hpp:70
bool maxwell_stress
Consider the effects of the dielectric loads.
Definition CFEANonlinearElasticity.hpp:60
std::unique_ptr< su2double[]> EField_Curr_Unit
Auxiliary vector for the unitary Electric Field in the current configuration.
Definition CFEANonlinearElasticity.hpp:64
CFEANonlinearElasticity()=delete
Default constructor deleted to avoid instantiation of derived classes without sizes.
void Assign_cijkl_D_Mat(void)
Assign elements of constitutive tensor to matrix D.
Definition CFEANonlinearElasticity.cpp:500
void Add_MaxwellStress(CElement *element_container, const CConfig *config)
Update an element with Maxwell's stress.
Definition CFEANonlinearElasticity.cpp:430
std::unique_ptr< su2double[]> ke_DE_i
Electric Constant for Dielectric Elastomers.
Definition CFEANonlinearElasticity.hpp:68
void Compute_NodalStress_Term(CElement *element_container, const CConfig *config) final
Compute the nodal stress terms for an element.
Definition CFEANonlinearElasticity.cpp:311
unsigned short nDim_Electric_Field
Definition CFEANonlinearElasticity.hpp:66
std::unique_ptr< su2double[]> EField_Ref_Mod
Electric Field, modulus, in the reference configuration.
Definition CFEANonlinearElasticity.hpp:63
virtual void Compute_Stress_Tensor(CElement *element_container, const CConfig *config, unsigned short iGauss)=0
Compute the stress tensor.
void Set_ElectricField(unsigned short i_DV, su2double val_EField) final
Set element electric field.
Definition CFEANonlinearElasticity.hpp:92
su2double Stress_Tensor[MAXNDIM][MAXNDIM]
Definition CFEANonlinearElasticity.hpp:48
void ComputeLeftCauchyGreenTensor()
Computes b_Mat.
Definition CFEANonlinearElasticity.hpp:151
bool nearly_incompressible
Boolean to consider nearly_incompressible effects.
Definition CFEANonlinearElasticity.hpp:54
virtual void Compute_Plane_Stress_Term(CElement *element_container, const CConfig *config, unsigned short iGauss)=0
Compute the plane stress term.
su2double F_Mat[MAXNDIM][MAXNDIM]
Deformation gradient.
Definition CFEANonlinearElasticity.hpp:46
void ComputeJ_F()
Computes the determinant of the deformation gradient.
Definition CFEANonlinearElasticity.hpp:165
std::unique_ptr< su2double[]> EField_Ref_Unit
Electric Field, unitary, in the reference configuration.
Definition CFEANonlinearElasticity.hpp:62
unsigned short nElectric_Field
Definition CFEANonlinearElasticity.hpp:65
static constexpr size_t MAXNDIM
Max number of space dimensions, used in some static arrays.
Definition CNumerics.hpp:50
passivedouble su2double
Definition code_config.hpp:181