From 60d7b6c94688db07f4a4116ef9d6b392641f7a48 Mon Sep 17 00:00:00 2001 From: Vaish-W Date: Fri, 3 Jan 2025 11:55:23 +0100 Subject: [PATCH] Handle temperature from the heat_solver --- SU2_CFD/include/solvers/CFEASolver.hpp | 1 - SU2_CFD/src/solvers/CFEASolver.cpp | 20 ++++++++++++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/SU2_CFD/include/solvers/CFEASolver.hpp b/SU2_CFD/include/solvers/CFEASolver.hpp index c003373f639..a7cc6901418 100644 --- a/SU2_CFD/include/solvers/CFEASolver.hpp +++ b/SU2_CFD/include/solvers/CFEASolver.hpp @@ -28,7 +28,6 @@ #pragma once #include "CFEASolverBase.hpp" -#include "CHeatSolver.hpp" /*! * \class CFEASolver diff --git a/SU2_CFD/src/solvers/CFEASolver.cpp b/SU2_CFD/src/solvers/CFEASolver.cpp index 520fb1e21c2..886da26df69 100644 --- a/SU2_CFD/src/solvers/CFEASolver.cpp +++ b/SU2_CFD/src/solvers/CFEASolver.cpp @@ -694,8 +694,8 @@ void CFEASolver::Compute_StiffMatrix(CGeometry *geometry, CNumerics **numerics, element->SetCurr_Coord(iNode, iDim, val_Sol); } if (heat_solver) { - auto nodal_temperatures = dynamic_cast(heat_solver)->GetNodalTemperature(); - element->SetTemperature(iNode, nodal_temperatures[indexNode[iNode]]); + const su2double temperature = heat_solver->GetNodes()->GetSolution(indexNode[iNode], 0); + element->SetTemperature(iNode, temperature); } } @@ -804,6 +804,14 @@ void CFEASolver::Compute_StiffMatrix_NodalStressRes(CGeometry *geometry, CNumeri de_elem->SetRef_Coord(iNode, iDim, val_Coord); } } + if (heat_solver) { + const su2double temperature = heat_solver->GetNodes()->GetSolution(indexNode[iNode], 0); + fea_elem->SetTemperature(iNode, temperature); + + if (de_effects) { + de_elem->SetTemperature(iNode, temperature); + } + } } /*--- In topology mode determine the penalty to apply to the stiffness. ---*/ @@ -1102,6 +1110,10 @@ void CFEASolver::Compute_NodalStressRes(CGeometry *geometry, CNumerics **numeric element->SetCurr_Coord(iNode, iDim, val_Sol); element->SetRef_Coord(iNode, iDim, val_Coord); } + if (heat_solver) { + const su2double temperature = heat_solver->GetNodes()->GetSolution(indexNode[iNode], 0); + element->SetTemperature(iNode, temperature); + } } /*--- In topology mode determine the penalty to apply to the stiffness ---*/ @@ -1218,6 +1230,10 @@ void CFEASolver::Compute_NodalStress(CGeometry *geometry, CNumerics **numerics, element->SetCurr_Coord(iNode, iDim, val_Sol); element->SetRef_Coord(iNode, iDim, val_Coord); } + if (heat_solver) { + const su2double temperature = heat_solver->GetNodes()->GetSolution(indexNode[iNode], 0); + element->SetTemperature(iNode, temperature); + } } /*--- In topology mode determine the penalty to apply to the stiffness ---*/