Coupled solver for thermoelasticity#2404
Coupled solver for thermoelasticity#2404pcarruscag merged 8 commits intosu2code:coupled_thermoelasticityfrom
Conversation
…eGrid_Iteration in CFEAIteration
…o coupled_thermoelasticity Add nodal temperature integration in Compute_StiffMatrix
|
While working on Compute_StiffMatrix, I noticed that NodalTemperature is not being recognized in some parts of the code. Could you clarify how NodalTemperature should be properly defined or accessed in the context of CElement or other relevant classes? |
SU2_CFD/src/solvers/CFEASolver.cpp
Outdated
| auto nodal_temperatures = dynamic_cast<CSolver *>(heat_solver)->GetNodalTemperature(); | ||
| element->SetTemperature(iNode, nodal_temperatures[indexNode[iNode]]); |
There was a problem hiding this comment.
Temperature is the solution of the heat solver, the "solution" (and other fields) are stored in CVariable classes which are the "nodes" member of the solvers.
| auto nodal_temperatures = dynamic_cast<CSolver *>(heat_solver)->GetNodalTemperature(); | |
| element->SetTemperature(iNode, nodal_temperatures[indexNode[iNode]]); | |
| const su2double temperature = heat_solver->GetNodes()->GetSolution(indexNode[iNode], 0); | |
| element->SetTemperature(iNode, nodal_temperature); |
| #pragma once | ||
|
|
||
| #include "CFEASolverBase.hpp" | ||
| #include "CHeatSolver.hpp" |
There was a problem hiding this comment.
You don't need to include CHeatSolver anymore because you are only using the virtual interface (CSolver).
| #include "CHeatSolver.hpp" |
f48826a to
60d7b6c
Compare
Tutorials
Outdated
There was a problem hiding this comment.
I think you added this by mistake
SU2_CFD/src/solvers/CFEASolver.cpp
Outdated
|
|
||
| if (de_effects) { | ||
| de_elem->SetTemperature(iNode, temperature); | ||
| } |
There was a problem hiding this comment.
The DE elements don't use temperature
| if (de_effects) { | |
| de_elem->SetTemperature(iNode, temperature); | |
| } |
| class CElasticityOutput final: public COutput { | ||
| protected: | ||
|
|
||
| const CSolver *heat_solver = nullptr; //!< Pointer to the heat solver |
There was a problem hiding this comment.
This doesn't need to be a member variable, the output function have access to the solver container, see CElasticityOutput::LoadHistoryData
| /*! | ||
| * \brief Set the heat solver pointer for output integration. | ||
| * \param[in] solver - Pointer to the heat solver. | ||
| */ | ||
| void SetHeatSolver(const CSolver *solver) { | ||
| heat_solver = solver; | ||
| } | ||
|
|
There was a problem hiding this comment.
Also not necessary
| /*! | |
| * \brief Set the heat solver pointer for output integration. | |
| * \param[in] solver - Pointer to the heat solver. | |
| */ | |
| void SetHeatSolver(const CSolver *solver) { | |
| heat_solver = solver; | |
| } |
| AddHistoryOutput("RMS_TEMPERATURE", "rms[T]", ScreenOutputFormat::FIXED, "RMS_RES", "Root mean square residual of the temperature", HistoryFieldType::RESIDUAL); | ||
| AddHistoryOutput("MAX_TEMPERATURE", "max[T]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the temperature", HistoryFieldType::RESIDUAL); | ||
| AddHistoryOutput("AVG_TEMPERATURE", "avg[T]", ScreenOutputFormat::SCIENTIFIC, "HEAT", "Average temperature on all surfaces", HistoryFieldType::COEFFICIENT); | ||
| AddHistoryOutput("TOTAL_HEATFLUX", "HF", ScreenOutputFormat::SCIENTIFIC, "HEAT", "Total heat flux on all surfaces", HistoryFieldType::COEFFICIENT); | ||
| AddHistoryOutput("MAXIMUM_HEATFLUX", "MaxHF", ScreenOutputFormat::SCIENTIFIC, "HEAT", "Maximum heat flux on all surfaces", HistoryFieldType::COEFFICIENT); |
There was a problem hiding this comment.
You need to check if the heat solver exists here too
There was a problem hiding this comment.
Also in volume output fields right?
1fc88ac
into
su2code:coupled_thermoelasticity
|
I merged your branch into one in the SU2 repo, otherwise it's a pain for me to checkout from your repo and I can't push any fixes, use this to open a new PR for develop |
Proposed Changes
This pull request implements integration of a heat solver coupling with the FEA solver for thermoelasticity simulations.
Key Changes:
CSolverFactory:
(HEAT_SOL)conditionally whenWEAKLY_COUPLED_HEAT_EQUATIONis enabled in the configuration.CFEAIteration:
Iteratefunction to invoke theSingleGrid_Iterationmethod of the heat solver before solving the FEA equations.CFEASolver:
Preprocessingto store a pointer to the heat solver for use in FEA computations.Compute_StiffMatrixCompute_StiffMatrix_NodalStressResCompute_NodalStressResCompute_NodalStressOutput Enhancements:
CElasticityOutputto include temperature-related fields for coupled simulations.LoadVolumeDataandLoadHistoryDatainCElasticityOutputto retrieve and display heat solver output such as nodal temperatures and thermal residuals.Related Work
Continuation of work from PR #2398 and #2399
PR Checklist
Put an X by all that apply. You can fill this out after submitting the PR. If you have any questions, don't hesitate to ask! We want to help. These are a guide for you to know what the reviewers will be looking for in your contribution.
pre-commit run --allto format old commits.