Skip to content

Commit 46405cd

Browse files
committed
add thermal expansion to CConfig
1 parent 72632af commit 46405cd

File tree

7 files changed

+44
-21
lines changed

7 files changed

+44
-21
lines changed

Common/include/CConfig.hpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,10 +1013,12 @@ class CConfig {
10131013
su2double *Int_Coeffs; /*!< \brief Time integration coefficients for structural method. */
10141014
unsigned short nElasticityMod, /*!< \brief Number of different values for the elasticity modulus. */
10151015
nPoissonRatio, /*!< \brief Number of different values for the Poisson ratio modulus. */
1016-
nMaterialDensity; /*!< \brief Number of different values for the Material density. */
1016+
nMaterialDensity, /*!< \brief Number of different values for the Material density. */
1017+
nMaterialThermalExpansion; /*!< \brief Number of different values for thermal expansion coefficient. */
10171018
su2double *ElasticityMod, /*!< \brief Value of the elasticity moduli. */
10181019
*PoissonRatio, /*!< \brief Value of the Poisson ratios. */
1019-
*MaterialDensity; /*!< \brief Value of the Material densities. */
1020+
*MaterialDensity, /*!< \brief Value of the Material densities. */
1021+
*MaterialThermalExpansion; /*!< \brief Value of the thermal expansion coefficients. */
10201022
unsigned short nElectric_Field, /*!< \brief Number of different values for the electric field in the membrane. */
10211023
nDim_Electric_Field; /*!< \brief Dimensionality of the problem. */
10221024
unsigned short nDim_RefNode; /*!< \brief Dimensionality of the vector . */
@@ -2389,6 +2391,11 @@ class CConfig {
23892391
*/
23902392
su2double GetMaterialDensity(unsigned short id_val) const { return MaterialDensity[id_val]; }
23912393

2394+
/*!
2395+
* \brief Get the thermal expansion coefficient.
2396+
*/
2397+
su2double GetMaterialThermalExpansion(unsigned short id_val) const { return MaterialThermalExpansion[id_val]; }
2398+
23922399
/*!
23932400
* \brief Compressibility/incompressibility of the solids analysed using the structural solver.
23942401
* \return Compressible or incompressible.

Common/src/CConfig.cpp

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2440,6 +2440,8 @@ void CConfig::SetConfig_Options() {
24402440
addDoubleListOption("POISSON_RATIO", nPoissonRatio, PoissonRatio);
24412441
/* DESCRIPTION: Material density */
24422442
addDoubleListOption("MATERIAL_DENSITY", nMaterialDensity, MaterialDensity);
2443+
/* DESCRIPTION: Material thermal expansion coefficient */
2444+
addDoubleListOption("MATERIAL_THERMAL_EXPANSION_COEFF", nMaterialThermalExpansion, MaterialThermalExpansion);
24432445
/* DESCRIPTION: Knowles B constant */
24442446
addDoubleOption("KNOWLES_B", Knowles_B, 1.0);
24452447
/* DESCRIPTION: Knowles N constant */
@@ -4834,9 +4836,15 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i
48344836
MaterialDensity = new su2double[1]; MaterialDensity[0] = 7854;
48354837
}
48364838

4837-
if (nElasticityMod != nPoissonRatio || nElasticityMod != nMaterialDensity) {
4838-
SU2_MPI::Error("ELASTICITY_MODULUS, POISSON_RATIO, and MATERIAL_DENSITY need to have the same number "
4839-
"of entries (the number of materials).", CURRENT_FUNCTION);
4839+
if (nMaterialThermalExpansion == 0) {
4840+
nMaterialThermalExpansion = 1;
4841+
MaterialThermalExpansion = new su2double[1]();
4842+
}
4843+
4844+
if (nElasticityMod != nPoissonRatio || nElasticityMod != nMaterialDensity ||
4845+
nElasticityMod != nMaterialThermalExpansion) {
4846+
SU2_MPI::Error("ELASTICITY_MODULUS, POISSON_RATIO, MATERIAL_DENSITY, and THERMAL_EXPANSION_COEFF need "
4847+
"to have the same number of entries (the number of materials).", CURRENT_FUNCTION);
48404848
}
48414849

48424850
if (nElectric_Constant == 0) {

SU2_CFD/include/numerics/elasticity/CFEAElasticity.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ class CFEAElasticity : public CNumerics {
5454
su2double Nu = 0.0; /*!< \brief Aux. variable, Poisson's ratio. */
5555
su2double Rho_s = 0.0; /*!< \brief Aux. variable, Structural density. */
5656
su2double Rho_s_DL = 0.0; /*!< \brief Aux. variable, Structural density (for dead loads). */
57+
su2double Alpha = 0.0; /*!< \brief Aux. variable, thermal expansion coefficient. */
5758

5859
su2double Mu = 0.0; /*!< \brief Aux. variable, Lame's coeficient. */
5960
su2double Lambda = 0.0; /*!< \brief Aux. variable, Lame's coeficient. */
@@ -63,6 +64,7 @@ class CFEAElasticity : public CNumerics {
6364
su2double *Nu_i = nullptr; /*!< \brief Poisson's ratio. */
6465
su2double *Rho_s_i = nullptr; /*!< \brief Structural density. */
6566
su2double *Rho_s_DL_i = nullptr; /*!< \brief Structural density (for dead loads). */
67+
su2double *Alpha_i = nullptr; /*!< \brief Thermal expansion coefficient. */
6668

6769
su2double **Ba_Mat = nullptr; /*!< \brief Matrix B for node a - Auxiliary. */
6870
su2double **Bb_Mat = nullptr; /*!< \brief Matrix B for node b - Auxiliary. */

SU2_CFD/src/numerics/elasticity/CFEAElasticity.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,26 +44,24 @@ CFEAElasticity::CFEAElasticity(unsigned short val_nDim, unsigned short val_nVar,
4444
const auto nProp = config->GetnElasticityMat();
4545

4646
E_i = new su2double[nProp];
47-
for (iVar = 0; iVar < nProp; iVar++)
48-
E_i[iVar] = config->GetElasticyMod(iVar);
49-
5047
Nu_i = new su2double[nProp];
51-
for (iVar = 0; iVar < nProp; iVar++)
52-
Nu_i[iVar] = config->GetPoissonRatio(iVar);
53-
5448
Rho_s_i = new su2double[nProp]; // For inertial effects
5549
Rho_s_DL_i = new su2double[nProp]; // For dead loads
56-
50+
Alpha_i = new su2double[nProp];
5751
for (iVar = 0; iVar < nProp; iVar++) {
52+
E_i[iVar] = config->GetElasticyMod(iVar);
53+
Nu_i[iVar] = config->GetPoissonRatio(iVar);
5854
Rho_s_DL_i[iVar] = config->GetMaterialDensity(iVar);
5955
Rho_s_i[iVar] = pseudo_static ? 0.0 : config->GetMaterialDensity(iVar);
56+
Alpha_i[iVar] = config->GetMaterialThermalExpansion(iVar);
6057
}
6158

6259
// Initialization
6360
E = E_i[0];
6461
Nu = Nu_i[0];
6562
Rho_s = Rho_s_i[0];
6663
Rho_s_DL = Rho_s_DL_i[0];
64+
Alpha = Alpha_i[0];
6765

6866
Compute_Lame_Parameters();
6967

@@ -302,6 +300,7 @@ void CFEAElasticity::SetElement_Properties(const CElement *element, const CConfi
302300
Nu = Nu_i[element->Get_iProp()];
303301
Rho_s = Rho_s_i[element->Get_iProp()];
304302
Rho_s_DL = Rho_s_DL_i[element->Get_iProp()];
303+
Alpha = Alpha_i[element->Get_iProp()];
305304

306305
switch (config->GetDV_FEA()) {
307306
case YOUNG_MODULUS:

SU2_CFD/src/numerics/elasticity/CFEALinearElasticity.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,13 @@ void CFEALinearElasticity::Compute_Tangent_Matrix(CElement *element, const CConf
9999

100100
for (iNode = 0; iNode < nNode; iNode++) {
101101

102+
su2double KAux_t_a[3] = {0.0};
103+
const su2double thermalStress = -E * 2e-4 / (1 - 2 * Nu);
104+
for (iVar = 0; iVar < nDim; iVar++) {
105+
KAux_t_a[iVar] += Weight * thermalStress * GradNi_Ref_Mat[iNode][iVar] * Jac_X;
106+
}
107+
element->Add_Kt_a(iNode, KAux_t_a);
108+
102109
if (nDim == 2) {
103110
Ba_Mat[0][0] = GradNi_Ref_Mat[iNode][0];
104111
Ba_Mat[1][1] = GradNi_Ref_Mat[iNode][1];

SU2_CFD/src/numerics/elasticity/nonlinear_models.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ void CFEM_NeoHookean_Comp::Compute_Stress_Tensor(CElement *element, const CConfi
112112
for (iVar = 0; iVar < 3; iVar++) {
113113
for (jVar = 0; jVar < 3; jVar++) {
114114
su2double dij = deltaij(iVar,jVar);
115-
Stress_Tensor[iVar][jVar] = Mu_J * (b_Mat[iVar][jVar] - dij) + Lambda_J * log(J_F) * dij;
115+
Stress_Tensor[iVar][jVar] = Mu_J * (b_Mat[iVar][jVar] - dij) + (Lambda_J * log(J_F) - E * 2e-4 / (1 - 2 * Nu)) * dij;
116116
}
117117
}
118118

TestCases/fea_fsi/StatBeam_3d/configBeam_3d.cfg

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,18 @@ MESH_FILENAME= meshBeam_3d.su2
1515
ELASTICITY_MODULUS=3E7
1616
POISSON_RATIO=0.3
1717
MATERIAL_DENSITY=7854
18-
MARKER_CLAMPED = ( left , right )
19-
MARKER_PRESSURE= ( lower, 0 , symleft, 0, symright, 0)
20-
MARKER_LOAD= ( upper, 1, 1000, 0, -1, 0)
21-
LINEAR_SOLVER= FGMRES
22-
LINEAR_SOLVER_PREC= LU_SGS
23-
LINEAR_SOLVER_ERROR= 1E-8
24-
LINEAR_SOLVER_ITER= 500
18+
MARKER_CLAMPED = ( left )
19+
MARKER_PRESSURE= ( lower, 0 , symleft, 0, symright, 0, upper, 0, right, 0)
20+
%MARKER_LOAD= ( upper, 1, 1000, 0, -1, 0)
21+
LINEAR_SOLVER= CONJUGATE_GRADIENT
22+
LINEAR_SOLVER_PREC= ILU
23+
LINEAR_SOLVER_ERROR= 1E-9
24+
LINEAR_SOLVER_ITER= 1000
2525
MESH_FORMAT= SU2
2626
TABULAR_FORMAT= CSV
2727
CONV_FILENAME= history_beam
2828
VOLUME_FILENAME= beam
2929
RESTART_FILENAME= restart_beam.dat
3030
SOLUTION_FILENAME= restart_beam.dat
3131
OUTPUT_WRT_FREQ= 1
32-
INNER_ITER=1
32+
INNER_ITER=10

0 commit comments

Comments
 (0)