Skip to content

Commit 6c23298

Browse files
authored
Merge branch 'develop' into issue_2342
2 parents c675d73 + 2b6d97a commit 6c23298

File tree

81 files changed

+1449
-1185
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+1449
-1185
lines changed

Common/include/CConfig.hpp

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -700,6 +700,7 @@ class CConfig {
700700
unsigned long StartConv_Iter; /*!< \brief Start convergence criteria at iteration. */
701701
su2double Cauchy_Eps; /*!< \brief Epsilon used for the convergence. */
702702
bool Restart, /*!< \brief Restart solution (for direct, adjoint, and linearized problems).*/
703+
Wrt_Restart_Compact, /*!< \brief Write compact restart files with minimum nr. of variables. */
703704
Read_Binary_Restart, /*!< \brief Read binary SU2 native restart files.*/
704705
Wrt_Restart_Overwrite, /*!< \brief Overwrite restart files or append iteration number.*/
705706
Wrt_Surface_Overwrite, /*!< \brief Overwrite surface output files or append iteration number.*/
@@ -1004,7 +1005,7 @@ class CConfig {
10041005
bool ExtraOutput; /*!< \brief Check if extra output need. */
10051006
bool Wall_Functions; /*!< \brief Use wall functions with the turbulence model */
10061007
long ExtraHeatOutputZone; /*!< \brief Heat solver zone with extra screen output */
1007-
bool DeadLoad; /*!< \brief Application of dead loads to the FE analysis */
1008+
bool CentrifugalForce; /*!< \brief Application of centrifugal forces to the FE analysis */
10081009
bool PseudoStatic; /*!< \brief Application of dead loads to the FE analysis */
10091010
bool SteadyRestart; /*!< \brief Restart from a steady state for FSI problems. */
10101011
su2double Newmark_beta, /*!< \brief Parameter alpha for Newmark method. */
@@ -1013,10 +1014,13 @@ class CConfig {
10131014
su2double *Int_Coeffs; /*!< \brief Time integration coefficients for structural method. */
10141015
unsigned short nElasticityMod, /*!< \brief Number of different values for the elasticity modulus. */
10151016
nPoissonRatio, /*!< \brief Number of different values for the Poisson ratio modulus. */
1016-
nMaterialDensity; /*!< \brief Number of different values for the Material density. */
1017+
nMaterialDensity, /*!< \brief Number of different values for the Material density. */
1018+
nMaterialThermalExpansion; /*!< \brief Number of different values for thermal expansion coefficient. */
10171019
su2double *ElasticityMod, /*!< \brief Value of the elasticity moduli. */
10181020
*PoissonRatio, /*!< \brief Value of the Poisson ratios. */
1019-
*MaterialDensity; /*!< \brief Value of the Material densities. */
1021+
*MaterialDensity, /*!< \brief Value of the Material densities. */
1022+
*MaterialThermalExpansion, /*!< \brief Value of the thermal expansion coefficients. */
1023+
MaterialReferenceTemperature; /*!< \brief Value of the reference temperature for thermal expansion. */
10201024
unsigned short nElectric_Field, /*!< \brief Number of different values for the electric field in the membrane. */
10211025
nDim_Electric_Field; /*!< \brief Dimensionality of the problem. */
10221026
unsigned short nDim_RefNode; /*!< \brief Dimensionality of the vector . */
@@ -1109,7 +1113,7 @@ class CConfig {
11091113
bool Radiation; /*!< \brief Determines if a radiation model is incorporated. */
11101114
su2double CFL_Rad; /*!< \brief CFL Number for the radiation solver. */
11111115

1112-
array<su2double,5> default_cfl_adapt; /*!< \brief Default CFL adapt param array for the COption class. */
1116+
array<su2double,6> default_cfl_adapt; /*!< \brief Default CFL adapt param array for the COption class. */
11131117
su2double vel_init[3], /*!< \brief initial velocity array for the COption class. */
11141118
vel_inf[3], /*!< \brief freestream velocity array for the COption class. */
11151119
eng_cyl[7], /*!< \brief engine box array for the COption class. */
@@ -2389,6 +2393,16 @@ class CConfig {
23892393
*/
23902394
su2double GetMaterialDensity(unsigned short id_val) const { return MaterialDensity[id_val]; }
23912395

2396+
/*!
2397+
* \brief Get the thermal expansion coefficient.
2398+
*/
2399+
su2double GetMaterialThermalExpansion(unsigned short id_val) const { return MaterialThermalExpansion[id_val]; }
2400+
2401+
/*!
2402+
* \brief Temperature at which there is no stress from thermal expansion.
2403+
*/
2404+
su2double GetMaterialReferenceTemperature() const { return MaterialReferenceTemperature; }
2405+
23922406
/*!
23932407
* \brief Compressibility/incompressibility of the solids analysed using the structural solver.
23942408
* \return Compressible or incompressible.
@@ -5490,6 +5504,12 @@ class CConfig {
54905504
*/
54915505
bool GetRead_Binary_Restart(void) const { return Read_Binary_Restart; }
54925506

5507+
/*!
5508+
* \brief Flag for whether restart files contain only necessary variables.
5509+
* \return Flag <code>TRUE</code> then the code will write compact restart files.
5510+
*/
5511+
bool GetWrt_Restart_Compact(void) const { return Wrt_Restart_Compact; }
5512+
54935513
/*!
54945514
* \brief Flag for whether restart solution files are overwritten.
54955515
* \return Flag for overwriting. If Flag=false, iteration nr is appended to filename
@@ -8929,10 +8949,9 @@ class CConfig {
89298949
su2double GetAitkenDynMinInit(void) const { return AitkenDynMinInit; }
89308950

89318951
/*!
8932-
* \brief Decide whether to apply dead loads to the model.
8933-
* \return <code>TRUE</code> if the dead loads are to be applied, <code>FALSE</code> otherwise.
8952+
* \brief Decide whether to apply centrifugal forces to the model.
89348953
*/
8935-
bool GetDeadLoad(void) const { return DeadLoad; }
8954+
bool GetCentrifugalForce(void) const { return CentrifugalForce; }
89368955

89378956
/*!
89388957
* \brief Identifies if the mesh is matching or not (temporary, while implementing interpolation procedures).

Common/include/geometry/elements/CElement.hpp

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ class CElement {
6767
su2activematrix NodalExtrap; /*!< \brief Coordinates of the nodal points for Gaussian extrapolation. */
6868
su2activematrix NodalStress; /*!< \brief Stress at the nodes. */
6969

70+
su2activevector NodalTemperature; /*!< \brief Temperature at the nodes. */
71+
7072
/*--- Stiffness and load matrices. ---*/
7173
std::vector<su2activematrix> Kab; /*!< \brief Structure for the constitutive component of the tangent matrix. */
7274
su2activematrix Mab; /*!< \brief Structure for the nodal components of the mass matrix. */
@@ -151,7 +153,7 @@ class CElement {
151153
* \param[in] iDim - Dimension.
152154
* \param[in] val_CoordRef - Value of the coordinate.
153155
*/
154-
inline void SetRef_Coord(unsigned short iNode, unsigned short iDim, su2double val_CoordRef) {
156+
inline void SetRef_Coord(unsigned short iNode, unsigned short iDim, const su2double& val_CoordRef) {
155157
RefCoord(iNode, iDim) = val_CoordRef;
156158
}
157159

@@ -161,10 +163,22 @@ class CElement {
161163
* \param[in] iDim - Dimension.
162164
* \param[in] val_CoordRef - Value of the coordinate.
163165
*/
164-
inline void SetCurr_Coord(unsigned short iNode, unsigned short iDim, su2double val_CoordCurr) {
166+
inline void SetCurr_Coord(unsigned short iNode, unsigned short iDim, const su2double& val_CoordCurr) {
165167
CurrentCoord(iNode, iDim) = val_CoordCurr;
166168
}
167169

170+
/*!
171+
* \brief Set the value of the temperature of a node.
172+
*/
173+
inline void SetTemperature(unsigned short iNode, const su2double& val_Temperature) {
174+
NodalTemperature[iNode] = val_Temperature;
175+
}
176+
177+
/*!
178+
* \brief Set the value of the temperature of all nodes.
179+
*/
180+
inline void SetTemperature(const su2double& val_Temperature) { NodalTemperature = val_Temperature; }
181+
168182
/*!
169183
* \brief Get the value of the coordinate of the nodes in the reference configuration.
170184
* \param[in] iNode - Index of node.
@@ -181,6 +195,17 @@ class CElement {
181195
*/
182196
inline su2double GetCurr_Coord(unsigned short iNode, unsigned short iDim) const { return CurrentCoord(iNode, iDim); }
183197

198+
/*!
199+
* \brief Get the value of the temperature at a Gaussian integration point.
200+
*/
201+
inline su2double GetTemperature(unsigned short iGauss) const {
202+
su2double Temperature = 0;
203+
for (auto iNode = 0u; iNode < nNodes; ++iNode) {
204+
Temperature += GetNi(iNode, iGauss) * NodalTemperature[iNode];
205+
}
206+
return Temperature;
207+
}
208+
184209
/*!
185210
* \brief Get the weight of the corresponding Gaussian Point.
186211
* \param[in] iGauss - index of the Gaussian point.
@@ -214,7 +239,9 @@ class CElement {
214239
* \param[in] nodeB - index of Node b.
215240
* \param[in] val_Ks_ab - value of the term that will constitute the diagonal of the stress contribution.
216241
*/
217-
inline void Add_Mab(unsigned short nodeA, unsigned short nodeB, su2double val_Mab) { Mab(nodeA, nodeB) += val_Mab; }
242+
inline void Add_Mab(unsigned short nodeA, unsigned short nodeB, const su2double& val_Mab) {
243+
Mab(nodeA, nodeB) += val_Mab;
244+
}
218245

219246
/*!
220247
* \brief Add the value of a submatrix K relating nodes a and b, for the constitutive term.
@@ -243,7 +270,7 @@ class CElement {
243270
* \param[in] nodeB - index of Node b.
244271
* \param[in] val_Ks_ab - value of the term that will constitute the diagonal of the stress contribution.
245272
*/
246-
inline void Add_Ks_ab(unsigned short nodeA, unsigned short nodeB, su2double val_Ks_ab) {
273+
inline void Add_Ks_ab(unsigned short nodeA, unsigned short nodeB, const su2double& val_Ks_ab) {
247274
Ks_ab(nodeA, nodeB) += val_Ks_ab;
248275
}
249276

@@ -354,7 +381,7 @@ class CElement {
354381
* \param[in] iVar - Variable index.
355382
* \param[in] val_Stress - Value of the stress added.
356383
*/
357-
inline void Add_NodalStress(unsigned short iNode, unsigned short iVar, su2double val_Stress) {
384+
inline void Add_NodalStress(unsigned short iNode, unsigned short iVar, const su2double& val_Stress) {
358385
NodalStress(iNode, iVar) += val_Stress;
359386
}
360387

@@ -789,7 +816,7 @@ class CQUAD4 final : public CElementWithKnownSizes<4, 4, 2> {
789816
/*!
790817
* \brief Shape functions (Ni) evaluated at point Xi,Eta.
791818
*/
792-
inline static void ShapeFunctions(su2double Xi, su2double Eta, su2double* Ni) {
819+
inline static void ShapeFunctions(const su2double& Xi, const su2double& Eta, su2double* Ni) {
793820
Ni[0] = 0.25 * (1.0 - Xi) * (1.0 - Eta);
794821
Ni[1] = 0.25 * (1.0 + Xi) * (1.0 - Eta);
795822
Ni[2] = 0.25 * (1.0 + Xi) * (1.0 + Eta);
@@ -799,7 +826,7 @@ class CQUAD4 final : public CElementWithKnownSizes<4, 4, 2> {
799826
/*!
800827
* \brief Shape function Jacobian (dNi) evaluated at point Xi,Eta.
801828
*/
802-
inline static void ShapeFunctionJacobian(su2double Xi, su2double Eta, su2double dNi[][2]) {
829+
inline static void ShapeFunctionJacobian(const su2double& Xi, const su2double& Eta, su2double dNi[][2]) {
803830
dNi[0][0] = -0.25 * (1.0 - Eta);
804831
dNi[0][1] = -0.25 * (1.0 - Xi);
805832
dNi[1][0] = 0.25 * (1.0 - Eta);

Common/include/linear_algebra/CSysMatrix.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -805,10 +805,10 @@ class CSysMatrix {
805805
void EnforceSolutionAtNode(unsigned long node_i, const OtherType* x_i, CSysVector<OtherType>& b);
806806

807807
/*!
808-
* \brief Version of EnforceSolutionAtNode for a single degree of freedom.
808+
* \brief Similar to EnforceSolutionAtNode, but for 0 projection in a given direction.
809809
*/
810810
template <class OtherType>
811-
void EnforceSolutionAtDOF(unsigned long node_i, unsigned long iVar, OtherType x_i, CSysVector<OtherType>& b);
811+
void EnforceZeroProjection(unsigned long node_i, const OtherType* n, CSysVector<OtherType>& b);
812812

813813
/*!
814814
* \brief Sets the diagonal entries of the matrix as the sum of the blocks in the corresponding column.

Common/include/toolboxes/geometry_toolbox.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,14 @@ inline T Norm(Int nDim, const T* a) {
7979
return sqrt(SquaredNorm(nDim, a));
8080
}
8181

82+
/*! \brief dn = max(abs(n.(a-b)), 0.05 * ||a-b|| */
83+
template <class T, typename Int>
84+
inline T NormalDistance(Int nDim, const T* n, const T* a, const T* b) {
85+
T d[3] = {0};
86+
Distance(nDim, a, b, d);
87+
return fmax(fabs(DotProduct(nDim, n, d)), 0.05 * Norm(nDim, d));
88+
}
89+
8290
/*! \brief c = a x b */
8391
template <class T>
8492
inline void CrossProduct(const T* a, const T* b, T* c) {

0 commit comments

Comments
 (0)