Skip to content
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

Bugfix DiscAdjFluid: DualTimeStepping 1st order #554

Merged
merged 7 commits into from
Jul 24, 2018
2 changes: 1 addition & 1 deletion SU2_CFD/src/driver_structure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3719,7 +3719,7 @@ void CDriver::Output(unsigned long ExtIter) {

/*--- Export Surface Solution File for Unsteady Simulations ---*/
/*--- When calculate mean/fluctuation option will be available, delete the following part ---*/
if ((config_container[ZONE_0]->GetUnsteady_Simulation() == DT_STEPPING_2ND) && (ExtIter % config_container[ZONE_0]->GetWrt_Surf_Freq_DualTime() == 0)) {
if ((config_container[ZONE_0]->GetUnsteady_Simulation() == DT_STEPPING_2ND) && (ExtIter % config_container[ZONE_0]->GetWrt_Surf_Freq_DualTime() == 0) && config_container[ZONE_0]->GetWrt_Csv_Sol()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch, thanks! We'll need to rework some of this, but it's good that csv files will no longer be forced to be written.

output->SetSurfaceCSV_Flow(config_container[ZONE_0], geometry_container[ZONE_0][INST_0][MESH_0], solver_container[ZONE_0][INST_0][MESH_0][FLOW_SOL], ExtIter, ZONE_0, INST_0);}

}
Expand Down
14 changes: 9 additions & 5 deletions SU2_CFD/src/iteration_structure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1825,9 +1825,13 @@ void CDiscAdjFluidIteration::Preprocess(COutput *output,

if ((ExtIter > 0) && dual_time){

/*--- Load solution timestep n - 2 ---*/

LoadUnsteady_Solution(geometry_container, solver_container,config_container, val_iInst, val_iZone, Direct_Iter - 2);
/*--- Load solution timestep n-1 | n-2 for DualTimestepping 1st | 2nd order ---*/
if (dual_time_1st){
LoadUnsteady_Solution(geometry_container, solver_container,config_container, val_iInst, val_iZone, Direct_Iter - 1);
} else {
LoadUnsteady_Solution(geometry_container, solver_container,config_container, val_iInst, val_iZone, Direct_Iter - 2);
}


/*--- Temporarily store the loaded solution in the Solution_Old array ---*/

Expand All @@ -1854,9 +1858,9 @@ void CDiscAdjFluidIteration::Preprocess(COutput *output,
/*--- Set Solution at timestep n-1 to the previously loaded solution ---*/
for (iMesh=0; iMesh<=config_container[val_iZone]->GetnMGLevels();iMesh++) {
for(iPoint=0; iPoint<geometry_container[val_iZone][val_iInst][iMesh]->GetnPoint();iPoint++) {
solver_container[val_iZone][val_iInst][iMesh][FLOW_SOL]->node[iPoint]->Set_Solution_time_n(solver_container[val_iZone][val_iInst][iMesh][FLOW_SOL]->node[iPoint]->GetSolution_time_n1());
solver_container[val_iZone][val_iInst][iMesh][FLOW_SOL]->node[iPoint]->Set_Solution_time_n(solver_container[val_iZone][val_iInst][iMesh][FLOW_SOL]->node[iPoint]->GetSolution_Old());
if (turbulent) {
solver_container[val_iZone][val_iInst][iMesh][TURB_SOL]->node[iPoint]->Set_Solution_time_n(solver_container[val_iZone][val_iInst][iMesh][TURB_SOL]->node[iPoint]->GetSolution_time_n1());
solver_container[val_iZone][val_iInst][iMesh][TURB_SOL]->node[iPoint]->Set_Solution_time_n(solver_container[val_iZone][val_iInst][iMesh][TURB_SOL]->node[iPoint]->GetSolution_Old());
}
}
}
Expand Down
Loading