Skip to content

Commit f48826a

Browse files
committed
Handle temperature from the heat_solver and use in calculating stress and stiffness
1 parent 46249b6 commit f48826a

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

SU2_CFD/include/solvers/CFEASolver.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#pragma once
2929

3030
#include "CFEASolverBase.hpp"
31-
#include "CHeatSolver.hpp"
3231

3332
/*!
3433
* \class CFEASolver

SU2_CFD/src/solvers/CFEASolver.cpp

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -694,8 +694,8 @@ void CFEASolver::Compute_StiffMatrix(CGeometry *geometry, CNumerics **numerics,
694694
element->SetCurr_Coord(iNode, iDim, val_Sol);
695695
}
696696
if (heat_solver) {
697-
auto nodal_temperatures = dynamic_cast<CSolver *>(heat_solver)->GetNodalTemperature();
698-
element->SetTemperature(iNode, nodal_temperatures[indexNode[iNode]]);
697+
const su2double temperature = heat_solver->GetNodes()->GetSolution(indexNode[iNode], 0);
698+
element->SetTemperature(iNode, temperature);
699699
}
700700
}
701701

@@ -804,6 +804,14 @@ void CFEASolver::Compute_StiffMatrix_NodalStressRes(CGeometry *geometry, CNumeri
804804
de_elem->SetRef_Coord(iNode, iDim, val_Coord);
805805
}
806806
}
807+
if (heat_solver) {
808+
const su2double temperature = heat_solver->GetNodes()->GetSolution(indexNode[iNode], 0);
809+
fea_elem->SetTemperature(iNode, temperature);
810+
811+
if (de_effects) {
812+
de_elem->SetTemperature(iNode, temperature);
813+
}
814+
}
807815
}
808816

809817
/*--- In topology mode determine the penalty to apply to the stiffness. ---*/
@@ -1102,6 +1110,10 @@ void CFEASolver::Compute_NodalStressRes(CGeometry *geometry, CNumerics **numeric
11021110
element->SetCurr_Coord(iNode, iDim, val_Sol);
11031111
element->SetRef_Coord(iNode, iDim, val_Coord);
11041112
}
1113+
if (heat_solver) {
1114+
const su2double temperature = heat_solver->GetNodes()->GetSolution(indexNode[iNode], 0);
1115+
element->SetTemperature(iNode, temperature);
1116+
}
11051117
}
11061118

11071119
/*--- In topology mode determine the penalty to apply to the stiffness ---*/
@@ -1218,6 +1230,10 @@ void CFEASolver::Compute_NodalStress(CGeometry *geometry, CNumerics **numerics,
12181230
element->SetCurr_Coord(iNode, iDim, val_Sol);
12191231
element->SetRef_Coord(iNode, iDim, val_Coord);
12201232
}
1233+
if (heat_solver) {
1234+
const su2double temperature = heat_solver->GetNodes()->GetSolution(indexNode[iNode], 0);
1235+
element->SetTemperature(iNode, temperature);
1236+
}
12211237
}
12221238

12231239
/*--- In topology mode determine the penalty to apply to the stiffness ---*/

0 commit comments

Comments
 (0)