Skip to content

Commit 4990753

Browse files
committed
Fix primal unsteady HEAT (and therefore CHT) restarts.
1 parent 49d3df2 commit 4990753

File tree

4 files changed

+15
-13
lines changed

4 files changed

+15
-13
lines changed

SU2_CFD/src/drivers/CDriver.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2921,18 +2921,6 @@ void CFluidDriver::Preprocess(unsigned long Iter) {
29212921
config_container[iZone]->SetPhysicalTime(0.0);
29222922
}
29232923

2924-
// /*--- Read the target pressure ---*/
2925-
2926-
// if (config_container[ZONE_0]->GetInvDesign_Cp() == YES)
2927-
// output[ZONE_0]->SetCp_InverseDesign(solver_container[ZONE_0][INST_0][MESH_0][FLOW_SOL],
2928-
// geometry_container[ZONE_0][INST_0][MESH_0], config_container[ZONE_0], ExtIter);
2929-
2930-
// /*--- Read the target heat flux ---*/
2931-
2932-
// if (config_container[ZONE_0]->GetInvDesign_HeatFlux() == YES)
2933-
// output[ZONE_0]->SetHeatFlux_InverseDesign(solver_container[ZONE_0][INST_0][MESH_0][FLOW_SOL],
2934-
// geometry_container[ZONE_0][INST_0][MESH_0], config_container[ZONE_0], ExtIter);
2935-
29362924
/*--- Set the initial condition for EULER/N-S/RANS and for a non FSI simulation ---*/
29372925

29382926
if(!fsi) {

SU2_CFD/src/drivers/CMultizoneDriver.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,12 @@ void CMultizoneDriver::Preprocess(unsigned long TimeIter) {
244244
solver_container[iZone][INST_0],
245245
config_container[iZone], TimeIter);
246246
}
247+
else if (!fsi && !config_container[iZone]->GetDiscrete_Adjoint() && config_container[iZone]->GetHeatProblem()) {
248+
/*--- Set the initial condition for HEAT equation ---------------------------------------------*/
249+
solver_container[iZone][INST_0][MESH_0][HEAT_SOL]->SetInitialCondition(geometry_container[iZone][INST_0],
250+
solver_container[iZone][INST_0],
251+
config_container[iZone], TimeIter);
252+
}
247253
}
248254

249255
SU2_MPI::Barrier(SU2_MPI::GetComm());

SU2_CFD/src/drivers/CSinglezoneDriver.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,12 @@ void CSinglezoneDriver::Preprocess(unsigned long TimeIter) {
129129
solver_container[ZONE_0][INST_0],
130130
config_container[ZONE_0], TimeIter);
131131
}
132+
else if ( config_container[ZONE_0]->GetHeatProblem()) {
133+
/*--- Set the initial condition for HEAT equation ---------------------------------------------*/
134+
solver_container[ZONE_0][INST_0][MESH_0][HEAT_SOL]->SetInitialCondition(geometry_container[ZONE_0][INST_0],
135+
solver_container[ZONE_0][INST_0],
136+
config_container[ZONE_0], TimeIter);
137+
}
132138

133139
SU2_MPI::Barrier(SU2_MPI::GetComm());
134140

SU2_CFD/src/solvers/CHeatSolver.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ CHeatSolver::CHeatSolver(CGeometry *geometry, CConfig *config, unsigned short iM
137137
config->SetHeat_Flux_Ref(config->GetViscosity_Ref()*config->GetSpecific_Heat_Cp());
138138
}
139139

140+
config->SetDelta_UnstTimeND(config->GetDelta_UnstTime() / config->GetTime_Ref());
141+
140142
/*--- Store the value of the temperature and the heat flux density at the boundaries,
141143
used for communications with donor cells ---*/
142144

@@ -1358,7 +1360,7 @@ void CHeatSolver::SetInitialCondition(CGeometry **geometry, CSolver ***solver_co
13581360

13591361
const bool restart = (config->GetRestart() || config->GetRestart_Flow());
13601362
const bool dual_time = ((config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST) ||
1361-
(config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND));
1363+
(config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND));
13621364

13631365
/*--- If restart solution, then interpolate the flow solution to
13641366
all the multigrid levels, this is important with the dual time strategy ---*/

0 commit comments

Comments
 (0)