-
Notifications
You must be signed in to change notification settings - Fork 847
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Coupled solver for thermoelasticity #2404
base: develop
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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); |
@@ -28,6 +28,7 @@ | |||
#pragma once | |||
|
|||
#include "CFEASolverBase.hpp" | |||
#include "CHeatSolver.hpp" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you added this by mistake
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, does it work?
SU2_CFD/src/solvers/CFEASolver.cpp
Outdated
|
||
if (de_effects) { | ||
de_elem->SetTemperature(iNode, temperature); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The DE elements don't use temperature
if (de_effects) { | |
de_elem->SetTemperature(iNode, temperature); | |
} |
@@ -37,6 +37,7 @@ | |||
class CElasticityOutput final: public COutput { | |||
protected: | |||
|
|||
const CSolver *heat_solver = nullptr; //!< Pointer to the heat solver |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to check if the heat solver exists here too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also in volume output fields right?
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_EQUATION
is enabled in the configuration.CFEAIteration:
Iterate
function to invoke theSingleGrid_Iteration
method of the heat solver before solving the FEA equations.CFEASolver:
Preprocessing
to store a pointer to the heat solver for use in FEA computations.Compute_StiffMatrix
Compute_StiffMatrix_NodalStressRes
Compute_NodalStressRes
Compute_NodalStress
Output Enhancements:
CElasticityOutput
to include temperature-related fields for coupled simulations.LoadVolumeData
andLoadHistoryData
inCElasticityOutput
to 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 --all
to format old commits.