diff --git a/Common/include/dual_grid_structure.hpp b/Common/include/dual_grid_structure.hpp index 4c984f31371..d749a0a5570 100644 --- a/Common/include/dual_grid_structure.hpp +++ b/Common/include/dual_grid_structure.hpp @@ -152,20 +152,20 @@ class CPoint : public CDualGrid { Boundary, /*!< \brief To see if a point belong to the boundary (including MPI). */ PhysicalBoundary, /*!< \brief To see if a point belong to the physical boundary (without includin MPI). */ SolidBoundary, /*!< \brief To see if a point belong to the physical boundary (without includin MPI). */ - PeriodicBoundary; /*!< \brief To see if a point belongs to a periodic boundary (without including MPI). */ + PeriodicBoundary; /*!< \brief To see if a point belongs to a periodic boundary (without including MPI). */ long *Vertex; /*!< \brief Index of the vertex that correspond which the control volume (we need one for each marker in the same node). */ su2double *Coord, /*!< \brief vector with the coordinates of the node. */ - *Coord_Old, /*!< \brief Old coordinates vector for geometry smoothing. */ - *Coord_Sum, /*!< \brief Sum of coordinates vector for geometry smoothing. */ - *Coord_n, /*!< \brief Coordinates at time n for use with dynamic meshes. */ - *Coord_n1, /*!< \brief Coordinates at time n-1 for use with dynamic meshes. */ - *Coord_p1; /*!< \brief Coordinates at time n+1 for use with dynamic meshes. */ + *Coord_Old, /*!< \brief Old coordinates vector for primal solution reloading for Disc.Adj. with dynamic grid. */ + *Coord_Sum, /*!< \brief Sum of coordinates vector for geometry smoothing. */ + *Coord_n, /*!< \brief Coordinates at time n for use with dynamic meshes. */ + *Coord_n1, /*!< \brief Coordinates at time n-1 for use with dynamic meshes. */ + *Coord_p1; /*!< \brief Coordinates at time n+1 for use with dynamic meshes. */ su2double *GridVel; /*!< \brief Velocity of the grid for dynamic mesh cases. */ su2double **GridVel_Grad; /*!< \brief Gradient of the grid velocity for dynamic meshes. */ unsigned long Parent_CV; /*!< \brief Index of the parent control volume in the agglomeration process. */ unsigned short nChildren_CV; /*!< \brief Number of children in the agglomeration process. */ vector Children_CV; /*!< \brief Index of the children control volumes in the agglomeration process. */ - bool Agglomerate_Indirect, /*!< \brief This flag indicates if the indirect points can be agglomerated. */ + bool Agglomerate_Indirect, /*!< \brief This flag indicates if the indirect points can be agglomerated. */ Agglomerate; /*!< \brief This flag indicates if the element has been agglomerated. */ bool Move; /*!< \brief This flag indicates if the point is going to be move in the grid deformation process. */ unsigned long color; /*!< \brief Color of the point in the partitioning strategy. */ @@ -567,12 +567,12 @@ class CPoint : public CDualGrid { su2double* GetCoord_p1(void); /*! - * \brief Set the coordinates of the control volume at time n. + * \brief Set the coordinates of the control volume at time n to the ones in Coord. */ void SetCoord_n(void); /*! - * \brief Set the coordinates of the control volume at time n-1. + * \brief Set the coordinates of the control volume at time n-1 to the ones in Coord_n. */ void SetCoord_n1(void); @@ -708,6 +708,11 @@ class CPoint : public CDualGrid { * \param[in] val_coord_old - Value of the coordinates. */ void SetCoord_Old(su2double *val_coord_old); + + /*! + * \brief Set the value of the vector Coord_Old to Coord. + */ + void SetCoord_Old(void); /*! * \brief Set the value of the grid velocity at the point. @@ -718,6 +723,7 @@ class CPoint : public CDualGrid { /*! * \overload + * \brief Set the value of the grid velocity at the point. * \param[in] val_gridvel - Value of the grid velocity. */ void SetGridVel(su2double *val_gridvel); diff --git a/Common/include/dual_grid_structure.inl b/Common/include/dual_grid_structure.inl index 48c6103a615..7878e909cc6 100644 --- a/Common/include/dual_grid_structure.inl +++ b/Common/include/dual_grid_structure.inl @@ -172,8 +172,8 @@ inline void CPoint::SetnChildren_CV (unsigned short val_nchildren_CV) { nChildre inline void CPoint::SetParent_CV (unsigned long val_parent_CV) { Parent_CV = val_parent_CV; Agglomerate = true; } inline void CPoint::SetGridVel(su2double *val_gridvel) { - for (unsigned short iDim = 0; iDim < nDim; iDim++) - GridVel[iDim] = val_gridvel[iDim]; + for (unsigned short iDim = 0; iDim < nDim; iDim++) + GridVel[iDim] = val_gridvel[iDim]; } inline void CPoint::SetVolume_n (void) { Volume[1] = Volume[0]; } @@ -184,6 +184,11 @@ inline su2double CPoint::GetVolume_n (void) { return Volume[1]; } inline su2double CPoint::GetVolume_nM1 (void) { return Volume[2]; } +inline void CPoint::SetCoord_Old (void) { + for (unsigned short iDim = 0; iDim < nDim; iDim++) + Coord_Old[iDim] = Coord[iDim]; +} + inline void CPoint::SetCoord_n (void) { for (unsigned short iDim = 0; iDim < nDim; iDim++) Coord_n[iDim] = Coord[iDim]; diff --git a/Common/src/config_structure.cpp b/Common/src/config_structure.cpp index 62c68a51a64..096bb7c00e4 100644 --- a/Common/src/config_structure.cpp +++ b/Common/src/config_structure.cpp @@ -4451,10 +4451,17 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ Restart_Flow = false; - if (GetGrid_Movement()) { - SU2_MPI::Error("Dynamic mesh movement currently not supported for the discrete adjoint solver.", CURRENT_FUNCTION); + if (GetKind_GridMovement() != RIGID_MOTION && + GetKind_GridMovement() != NO_MOVEMENT) { + SU2_MPI::Error(string("Dynamic mesh movement currently only supported for the discrete adjoint solver for\n") + + string("GRID_MOVEMENT = RIGID_MOTION."), CURRENT_FUNCTION); } + /*--- Quickfix to not trigger the error message below if SINGLEZONE_DRIVER is used. + Once the old driver (i.e. EXT_ITER with it) is removed, the Error conditional + can be changed. ---*/ + if (SinglezoneDriver) nExtIter = Time_Iter; + if (Unst_AdjointIter- long(nExtIter) < 0){ SU2_MPI::Error(string("Invalid iteration number requested for unsteady adjoint.\n" ) + string("Make sure EXT_ITER is larger or equal than UNST_ADJOINT_ITER."), diff --git a/Common/src/dual_grid_structure.cpp b/Common/src/dual_grid_structure.cpp index 0ae1d1ac3c1..2054f7c9771 100644 --- a/Common/src/dual_grid_structure.cpp +++ b/Common/src/dual_grid_structure.cpp @@ -137,6 +137,7 @@ CPoint::CPoint(unsigned short val_nDim, unsigned long val_globalindex, CConfig * Coord_p1 = new su2double[nDim]; Coord_n = new su2double[nDim]; Coord_n1 = new su2double[nDim]; + Coord_Old = new su2double[nDim]; } } @@ -241,6 +242,7 @@ CPoint::CPoint(su2double val_coord_0, su2double val_coord_1, unsigned long val_g Coord_p1 = new su2double[nDim]; Coord_n = new su2double[nDim]; Coord_n1 = new su2double[nDim]; + Coord_Old = new su2double[nDim]; for (iDim = 0; iDim < nDim; iDim ++) { Coord_p1[iDim] = Coord[iDim]; Coord_n[iDim] = Coord[iDim]; @@ -351,6 +353,7 @@ CPoint::CPoint(su2double val_coord_0, su2double val_coord_1, su2double val_coord Coord_p1 = new su2double[nDim]; Coord_n = new su2double[nDim]; Coord_n1 = new su2double[nDim]; + Coord_Old = new su2double[nDim]; for (iDim = 0; iDim < nDim; iDim ++) { Coord_p1[iDim] = Coord[iDim]; Coord_n[iDim] = Coord[iDim]; diff --git a/Common/src/geometry_structure.cpp b/Common/src/geometry_structure.cpp index 40798af9342..999db1d47c1 100644 --- a/Common/src/geometry_structure.cpp +++ b/Common/src/geometry_structure.cpp @@ -13464,7 +13464,6 @@ void CPhysicalGeometry::SetSensitivity(CConfig *config) { bool sa = (config->GetKind_Turb_Model() == SA) || (config->GetKind_Turb_Model() == SA_NEG) || (config->GetKind_Turb_Model() == SA_E) || (config->GetKind_Turb_Model() == SA_COMP) || (config->GetKind_Turb_Model() == SA_E_COMP); - bool grid_movement = config->GetGrid_Movement(); bool frozen_visc = config->GetFrozen_Visc_Disc(); unsigned short Kind_Solver = config->GetKind_Solver(); bool flow = ((Kind_Solver == DISC_ADJ_EULER) || @@ -13499,7 +13498,6 @@ void CPhysicalGeometry::SetSensitivity(CConfig *config) { skipVar += skipMult*(nDim+2); if (sst && !frozen_visc) { skipVar += skipMult*2;} if (sa && !frozen_visc) { skipVar += skipMult*1;} - if (grid_movement) { skipVar += nDim;} } else if (Kind_Solver == DISC_ADJ_HEAT) { skipVar += 1; diff --git a/Common/src/grid_movement_structure.cpp b/Common/src/grid_movement_structure.cpp index e3e80763059..0ce080ccbe6 100644 --- a/Common/src/grid_movement_structure.cpp +++ b/Common/src/grid_movement_structure.cpp @@ -1904,7 +1904,7 @@ void CVolumetricMovement::Rigid_Rotation(CGeometry *geometry, CConfig *config, su2double dtheta, dphi, dpsi, cosTheta, sinTheta; su2double cosPhi, sinPhi, cosPsi, sinPsi; bool harmonic_balance = (config->GetUnsteady_Simulation() == HARMONIC_BALANCE); - bool adjoint = config->GetContinuous_Adjoint(); + bool adjoint = (config->GetContinuous_Adjoint() || config->GetDiscrete_Adjoint()); /*--- Problem dimension and physical time step ---*/ @@ -2067,7 +2067,7 @@ void CVolumetricMovement::Rigid_Pitching(CGeometry *geometry, CConfig *config, u unsigned short nDim = geometry->GetnDim(); unsigned long iPoint; bool harmonic_balance = (config->GetUnsteady_Simulation() == HARMONIC_BALANCE); - bool adjoint = config->GetContinuous_Adjoint(); + bool adjoint = (config->GetContinuous_Adjoint() || config->GetDiscrete_Adjoint()); /*--- Retrieve values from the config file ---*/ @@ -2214,7 +2214,7 @@ void CVolumetricMovement::Rigid_Plunging(CGeometry *geometry, CConfig *config, u unsigned short iDim, nDim = geometry->GetnDim(); unsigned long iPoint; bool harmonic_balance = (config->GetUnsteady_Simulation() == HARMONIC_BALANCE); - bool adjoint = config->GetContinuous_Adjoint(); + bool adjoint = (config->GetContinuous_Adjoint() || config->GetDiscrete_Adjoint()); /*--- Retrieve values from the config file ---*/ @@ -2346,7 +2346,7 @@ void CVolumetricMovement::Rigid_Translation(CGeometry *geometry, CConfig *config unsigned short iDim, nDim = geometry->GetnDim(); unsigned long iPoint; bool harmonic_balance = (config->GetUnsteady_Simulation() == HARMONIC_BALANCE); - bool adjoint = config->GetContinuous_Adjoint(); + bool adjoint = (config->GetContinuous_Adjoint() || config->GetDiscrete_Adjoint()); /*--- Retrieve values from the config file ---*/ @@ -6347,7 +6347,7 @@ void CSurfaceMovement::SetBoundary_Flutter3D(CGeometry *geometry, CConfig *confi su2double time_new, time_old; su2double Omega[3], Ampl[3]; su2double DEG2RAD = PI_NUMBER/180.0; - bool adjoint = config->GetContinuous_Adjoint(); + bool adjoint = (config->GetContinuous_Adjoint() || config->GetDiscrete_Adjoint()); unsigned short iDim = 0; /*--- Retrieve values from the config file ---*/ @@ -6441,7 +6441,7 @@ void CSurfaceMovement::SetExternal_Deformation(CGeometry *geometry, CConfig *con string DV_Filename, UnstExt, text_line; ifstream surface_positions; bool unsteady = config->GetUnsteady_Simulation(); - bool adjoint = config->GetContinuous_Adjoint(); + bool adjoint = (config->GetContinuous_Adjoint() || config->GetDiscrete_Adjoint()); /*--- Load stuff from config ---*/ diff --git a/SU2_CFD/src/drivers/CDiscAdjSinglezoneDriver.cpp b/SU2_CFD/src/drivers/CDiscAdjSinglezoneDriver.cpp index bdaeac3b719..912aa50da10 100644 --- a/SU2_CFD/src/drivers/CDiscAdjSinglezoneDriver.cpp +++ b/SU2_CFD/src/drivers/CDiscAdjSinglezoneDriver.cpp @@ -152,18 +152,6 @@ void CDiscAdjSinglezoneDriver::Run() { if(!config->GetTime_Domain() && (MainVariables == FLOW_CONS_VARS)) config->SetExtIter(Adjoint_Iter); - /*--- Secondary sensitivities must be computed with a certain frequency. ---*/ - /*--- It is also done at the beginning so all memory gets allocated. ---*/ - if ((Adjoint_Iter % config->GetWrt_Sol_Freq() == 0) && (SecondaryVariables != NONE)){ - - /*--- Computes secondary sensitivities ---*/ - SecondaryRecording(); - - /*--- Recompute main sensitivities ---*/ - MainRecording(); - - } - iteration->InitializeAdjoint(solver_container, geometry_container, config_container, ZONE_0, INST_0); /*--- Initialize the adjoint of the objective function with 1.0. ---*/ @@ -201,29 +189,24 @@ void CDiscAdjSinglezoneDriver::Run() { void CDiscAdjSinglezoneDriver::Postprocess() { + switch(config->GetKind_Solver()) + { + case DISC_ADJ_EULER : case DISC_ADJ_NAVIER_STOKES : case DISC_ADJ_RANS : + case DISC_ADJ_INC_EULER : case DISC_ADJ_INC_NAVIER_STOKES : case DISC_ADJ_INC_RANS : + /*--- Compute the geometrical sensitivities ---*/ + SecondaryRecording(); + break; - if (config->GetKind_Solver() == DISC_ADJ_EULER || - config->GetKind_Solver() == DISC_ADJ_NAVIER_STOKES || - config->GetKind_Solver() == DISC_ADJ_RANS || - config->GetKind_Solver() == DISC_ADJ_INC_EULER || - config->GetKind_Solver() == DISC_ADJ_INC_NAVIER_STOKES || - config->GetKind_Solver() == DISC_ADJ_INC_RANS){ - - /*--- Compute the geometrical sensitivities ---*/ - SecondaryRecording(); - - } - - if (config->GetKind_Solver() == DISC_ADJ_FEM){ - - /*--- Apply the boundary condition to clamped nodes ---*/ - iteration->Postprocess(output,integration_container,geometry_container,solver_container,numerics_container, - config_container,surface_movement,grid_movement,FFDBox,ZONE_0,INST_0); + case DISC_ADJ_FEM : - RecordingState = NONE; + /*--- Apply the boundary condition to clamped nodes ---*/ + iteration->Postprocess(output,integration_container,geometry_container,solver_container,numerics_container, + config_container,surface_movement,grid_movement,FFDBox,ZONE_0,INST_0); - } + RecordingState = NONE; + break; + }//switch } diff --git a/SU2_CFD/src/drivers/CDriver.cpp b/SU2_CFD/src/drivers/CDriver.cpp index 1f3b2228484..96b3ede80b0 100644 --- a/SU2_CFD/src/drivers/CDriver.cpp +++ b/SU2_CFD/src/drivers/CDriver.cpp @@ -3831,10 +3831,12 @@ void CDriver::StartSolver(){ PreprocessExtIter(ExtIter); /*--- Perform a dynamic mesh update if required. ---*/ - - if (!fem_solver && !(config_container[ZONE_0]->GetGrid_Movement() && config_container[ZONE_0]->GetDiscrete_Adjoint())) { - DynamicMeshUpdate(ExtIter); - } + /*--- For the Disc.Adj. of a case with (rigidly) moving grid, the appropriate + mesh cordinates are read from the restart files. ---*/ + if (!fem_solver && + !(config_container[ZONE_0]->GetGrid_Movement() && config_container[ZONE_0]->GetDiscrete_Adjoint())) { + DynamicMeshUpdate(ExtIter); + } /*--- Run a single iteration of the problem (fluid, elasticity, heat, ...). ---*/ diff --git a/SU2_CFD/src/drivers/CSinglezoneDriver.cpp b/SU2_CFD/src/drivers/CSinglezoneDriver.cpp index c6e5f0e7c11..1ae8e86bcc0 100644 --- a/SU2_CFD/src/drivers/CSinglezoneDriver.cpp +++ b/SU2_CFD/src/drivers/CSinglezoneDriver.cpp @@ -155,8 +155,10 @@ void CSinglezoneDriver::Preprocess(unsigned long TimeIter) { numerics_container, config_container, surface_movement, grid_movement, FFDBox, ZONE_0, INST_0); /*--- Perform a dynamic mesh update if required. ---*/ - - DynamicMeshUpdate(TimeIter); + /*--- For the Disc.Adj. of a case with (rigidly) moving grid, the appropriate + mesh cordinates are read from the restart files. ---*/ + if (!(config_container[ZONE_0]->GetGrid_Movement() && config_container[ZONE_0]->GetDiscrete_Adjoint())) + DynamicMeshUpdate(TimeIter); } diff --git a/SU2_CFD/src/iteration_structure.cpp b/SU2_CFD/src/iteration_structure.cpp index 137cbed4b78..bde0f7cee0e 100644 --- a/SU2_CFD/src/iteration_structure.cpp +++ b/SU2_CFD/src/iteration_structure.cpp @@ -2159,6 +2159,7 @@ void CDiscAdjFluidIteration::Preprocess(COutput *output, unsigned short iMesh; int Direct_Iter; bool heat = config[val_iZone]->GetWeakly_Coupled_Heat(); + bool grid_IsMoving = config[val_iZone]->GetGrid_Movement(); /*--- Read the target pressure for inverse design. ---------------------------------------------*/ if (config[val_iZone]->GetInvDesign_Cp() == YES) @@ -2185,7 +2186,6 @@ void CDiscAdjFluidIteration::Preprocess(COutput *output, if (dual_time_2nd) { /*--- Load solution at timestep n-2 ---*/ - LoadUnsteady_Solution(geometry, solver,config, val_iZone, val_iInst, Direct_Iter-2); /*--- Push solution back to correct array ---*/ @@ -2194,6 +2194,10 @@ void CDiscAdjFluidIteration::Preprocess(COutput *output, for(iPoint=0; iPointGetnPoint();iPoint++) { solver[val_iZone][val_iInst][iMesh][FLOW_SOL]->node[iPoint]->Set_Solution_time_n(); solver[val_iZone][val_iInst][iMesh][FLOW_SOL]->node[iPoint]->Set_Solution_time_n1(); + if (grid_IsMoving) { + geometry[val_iZone][val_iInst][iMesh]->node[iPoint]->SetCoord_n(); + geometry[val_iZone][val_iInst][iMesh]->node[iPoint]->SetCoord_n1(); + } if (turbulent) { solver[val_iZone][val_iInst][iMesh][TURB_SOL]->node[iPoint]->Set_Solution_time_n(); solver[val_iZone][val_iInst][iMesh][TURB_SOL]->node[iPoint]->Set_Solution_time_n1(); @@ -2208,7 +2212,6 @@ void CDiscAdjFluidIteration::Preprocess(COutput *output, if (dual_time) { /*--- Load solution at timestep n-1 ---*/ - LoadUnsteady_Solution(geometry, solver,config, val_iZone, val_iInst, Direct_Iter-1); /*--- Push solution back to correct array ---*/ @@ -2216,6 +2219,9 @@ void CDiscAdjFluidIteration::Preprocess(COutput *output, for (iMesh=0; iMesh<=config[val_iZone]->GetnMGLevels();iMesh++) { for(iPoint=0; iPointGetnPoint();iPoint++) { solver[val_iZone][val_iInst][iMesh][FLOW_SOL]->node[iPoint]->Set_Solution_time_n(); + if (grid_IsMoving) { + geometry[val_iZone][val_iInst][iMesh]->node[iPoint]->SetCoord_n(); + } if (turbulent) { solver[val_iZone][val_iInst][iMesh][TURB_SOL]->node[iPoint]->Set_Solution_time_n(); } @@ -2230,10 +2236,14 @@ void CDiscAdjFluidIteration::Preprocess(COutput *output, LoadUnsteady_Solution(geometry, solver,config, val_iInst, val_iZone, Direct_Iter); - } - + } else if ((ExtIter > 0) && dual_time) { - if ((ExtIter > 0) && dual_time){ + /*--- + Here the primal solutions (only working variables) are loaded and put in the correct order + into containers. For ALE the mesh coordinates have to be put into the + correct containers as well, i.e. follow the same logic for the solution. + Afterwards the GridVelocity is computed based on the Coordinates. + ---*/ /*--- Load solution timestep n-1 | n-2 for DualTimestepping 1st | 2nd order ---*/ if (dual_time_1st){ @@ -2247,13 +2257,16 @@ void CDiscAdjFluidIteration::Preprocess(COutput *output, for (iMesh=0; iMesh<=config[val_iZone]->GetnMGLevels();iMesh++) { for(iPoint=0; iPointGetnPoint();iPoint++) { - solver[val_iZone][val_iInst][iMesh][FLOW_SOL]->node[iPoint]->Set_OldSolution(); - if (turbulent){ - solver[val_iZone][val_iInst][iMesh][TURB_SOL]->node[iPoint]->Set_OldSolution(); - } - if (heat){ - solver[val_iZone][val_iInst][iMesh][HEAT_SOL]->node[iPoint]->Set_OldSolution(); - } + solver[val_iZone][val_iInst][iMesh][FLOW_SOL]->node[iPoint]->Set_OldSolution(); + if (grid_IsMoving) { + geometry[val_iZone][val_iInst][iMesh]->node[iPoint]->SetCoord_Old(); + } + if (turbulent){ + solver[val_iZone][val_iInst][iMesh][TURB_SOL]->node[iPoint]->Set_OldSolution(); + } + if (heat){ + solver[val_iZone][val_iInst][iMesh][HEAT_SOL]->node[iPoint]->Set_OldSolution(); + } } } @@ -2262,6 +2275,9 @@ void CDiscAdjFluidIteration::Preprocess(COutput *output, for (iMesh=0; iMesh<=config[val_iZone]->GetnMGLevels();iMesh++) { for(iPoint=0; iPointGetnPoint();iPoint++) { solver[val_iZone][val_iInst][iMesh][FLOW_SOL]->node[iPoint]->SetSolution(solver[val_iZone][val_iInst][iMesh][FLOW_SOL]->node[iPoint]->GetSolution_time_n()); + if (grid_IsMoving) { + geometry[val_iZone][val_iInst][iMesh]->node[iPoint]->SetCoord(geometry[val_iZone][val_iInst][iMesh]->node[iPoint]->GetCoord_n()); + } if (turbulent) { solver[val_iZone][val_iInst][iMesh][TURB_SOL]->node[iPoint]->SetSolution(solver[val_iZone][val_iInst][iMesh][TURB_SOL]->node[iPoint]->GetSolution_time_n()); } @@ -2271,10 +2287,13 @@ void CDiscAdjFluidIteration::Preprocess(COutput *output, } } if (dual_time_1st){ - /*--- Set Solution at timestep n-1 to the previously loaded solution ---*/ + /*--- Set Solution at timestep n-1 to the previously loaded solution ---*/ for (iMesh=0; iMesh<=config[val_iZone]->GetnMGLevels();iMesh++) { for(iPoint=0; iPointGetnPoint();iPoint++) { solver[val_iZone][val_iInst][iMesh][FLOW_SOL]->node[iPoint]->Set_Solution_time_n(solver[val_iZone][val_iInst][iMesh][FLOW_SOL]->node[iPoint]->GetSolution_Old()); + if (grid_IsMoving) { + geometry[val_iZone][val_iInst][iMesh]->node[iPoint]->SetCoord_n(geometry[val_iZone][val_iInst][iMesh]->node[iPoint]->GetCoord_Old()); + } if (turbulent) { solver[val_iZone][val_iInst][iMesh][TURB_SOL]->node[iPoint]->Set_Solution_time_n(solver[val_iZone][val_iInst][iMesh][TURB_SOL]->node[iPoint]->GetSolution_Old()); } @@ -2289,6 +2308,9 @@ void CDiscAdjFluidIteration::Preprocess(COutput *output, for (iMesh=0; iMesh<=config[val_iZone]->GetnMGLevels();iMesh++) { for(iPoint=0; iPointGetnPoint();iPoint++) { solver[val_iZone][val_iInst][iMesh][FLOW_SOL]->node[iPoint]->Set_Solution_time_n(solver[val_iZone][val_iInst][iMesh][FLOW_SOL]->node[iPoint]->GetSolution_time_n1()); + if (grid_IsMoving) { + geometry[val_iZone][val_iInst][iMesh]->node[iPoint]->SetCoord_n(geometry[val_iZone][val_iInst][iMesh]->node[iPoint]->GetCoord_n1()); + } if (turbulent) { solver[val_iZone][val_iInst][iMesh][TURB_SOL]->node[iPoint]->Set_Solution_time_n(solver[val_iZone][val_iInst][iMesh][TURB_SOL]->node[iPoint]->GetSolution_time_n1()); } @@ -2301,6 +2323,9 @@ void CDiscAdjFluidIteration::Preprocess(COutput *output, for (iMesh=0; iMesh<=config[val_iZone]->GetnMGLevels();iMesh++) { for(iPoint=0; iPointGetnPoint();iPoint++) { solver[val_iZone][val_iInst][iMesh][FLOW_SOL]->node[iPoint]->Set_Solution_time_n1(solver[val_iZone][val_iInst][iMesh][FLOW_SOL]->node[iPoint]->GetSolution_Old()); + if (grid_IsMoving) { + geometry[val_iZone][val_iInst][iMesh]->node[iPoint]->SetCoord_n1(geometry[val_iZone][val_iInst][iMesh]->node[iPoint]->GetCoord_Old()); + } if (turbulent) { solver[val_iZone][val_iInst][iMesh][TURB_SOL]->node[iPoint]->Set_Solution_time_n1(solver[val_iZone][val_iInst][iMesh][TURB_SOL]->node[iPoint]->GetSolution_Old()); } @@ -2310,8 +2335,15 @@ void CDiscAdjFluidIteration::Preprocess(COutput *output, } } } - } - } + + }//else if Ext_Iter > 0 + + /*--- Compute & set Grid Velocity via finite differences of the Coordinates. ---*/ + if (grid_IsMoving) + for (iMesh=0; iMesh<=config[val_iZone]->GetnMGLevels();iMesh++) + geometry[val_iZone][val_iInst][iMesh]->SetGridVelocity(config[val_iZone], ExtIter); + + }//if unsteady /*--- Store flow solution also in the adjoint solver in order to be able to reset it later ---*/ diff --git a/SU2_CFD/src/solver_direct_mean.cpp b/SU2_CFD/src/solver_direct_mean.cpp index 71729acf56c..6d2c572994c 100644 --- a/SU2_CFD/src/solver_direct_mean.cpp +++ b/SU2_CFD/src/solver_direct_mean.cpp @@ -13005,8 +13005,8 @@ void CEulerSolver::LoadRestart(CGeometry **geometry, CSolver ***solver, CConfig } - /*--- Update the old geometry (coordinates n and n-1) in dual time-stepping strategy ---*/ - if (dual_time && config->GetGrid_Movement()) + /*--- Update the old geometry (coordinates n and n-1) in dual time-stepping strategy. ---*/ + if (dual_time && config->GetGrid_Movement() && (config->GetKind_GridMovement() != RIGID_MOTION)) Restart_OldGeometry(geometry[MESH_0], config); delete [] Coord; diff --git a/TestCases/disc_adj_euler/naca0012_pitching/inv_NACA0012_pitching.cfg b/TestCases/disc_adj_euler/naca0012_pitching/inv_NACA0012_pitching.cfg new file mode 100644 index 00000000000..fd053af31a3 --- /dev/null +++ b/TestCases/disc_adj_euler/naca0012_pitching/inv_NACA0012_pitching.cfg @@ -0,0 +1,360 @@ +% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% +% +% Physical governing equations (EULER, NAVIER_STOKES, +% WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, +% POISSON_EQUATION) +SOLVER= EULER +% +% Mathematical problem (DIRECT, CONTINUOUS_ADJOINT) +MATH_PROBLEM= DISCRETE_ADJOINT +% +% Restart solution (NO, YES) +RESTART_SOL= NO +SINGLEZONE_DRIVER= YES +TIME_ITER= 151 +ITER= 350 + +%EXT_ITER= 151 +%UNST_INT_ITER= 110 +% ------------------------- UNSTEADY SIMULATION -------------------------------% +% +% Unsteady simulation (NO, TIME_STEPPING, DUAL_TIME_STEPPING-1ST_ORDER, +% DUAL_TIME_STEPPING-2ND_ORDER) +TIME_DOMAIN= YES +UNSTEADY_SIMULATION= DUAL_TIME_STEPPING-2ND_ORDER +% +% Time Step for dual time stepping simulations (s) +UNST_TIMESTEP= 0.0023555025613149587 +% 24 steps per period: 0.0024536485013697488 +% 25 steps per period: 0.0023555025613149587 +% +% Total Physical Time for dual time stepping simulations (s) +% 150 steps +UNST_TIME= 0.354 +% +% Iteration number to begin unsteady restarts +UNST_RESTART_ITER= 151 +% +% Starting direct iteration for unsteady adjoint +UNST_ADJOINT_ITER= 151 + +% ----------------------- DYNAMIC MESH DEFINITION -----------------------------% +% +% Dynamic mesh simulation (NO, YES) +GRID_MOVEMENT= RIGID_MOTION +% +% Motion mach number (non-dimensional). Used for initializing a viscous flow +% with the Reynolds number and for computing force coeffs. with dynamic meshes. +MACH_MOTION= 0.796 +% +% Coordinates of the rigid motion origin +MOTION_ORIGIN= (0.248 0.0 0.0) +% +% Pitching angular freq. (rad/s) about x, y, & z axes (RIGID_MOTION only) +PITCHING_OMEGA= (0.0 0.0 106.69842) +% +% Pitching amplitude (degrees) about x, y, & z axes (RIGID_MOTION only) +PITCHING_AMPL= (0.0 0.0 1.01) + +% -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% +% +% Mach number (non-dimensional, based on the free-stream values) +MACH_NUMBER= 0.8 +% +% Angle of attack (degrees) +AOA= 1.25 +% +% Free-stream pressure (101325.0 N/m^2 by default, only Euler flows) +FREESTREAM_PRESSURE= 101325.0 +% +% Free-stream temperature (288.15 K by default) +FREESTREAM_TEMPERATURE= 288.15 + +% ---------------------- REFERENCE VALUE DEFINITION ---------------------------% +% +% Reference origin for moment computation +REF_ORIGIN_MOMENT_X = 0.25 +REF_ORIGIN_MOMENT_Y = 0.00 +REF_ORIGIN_MOMENT_Z = 0.00 +% +% Reference length for pitching, rolling, and yawing non-dimensional moment +REF_LENGTH= 1.0 +% +% Reference area for force coefficients (0 implies automatic calculation) +REF_AREA= 1.0 +% +% Flow non-dimensionalization (DIMENSIONAL, FREESTREAM_PRESS_EQ_ONE, +% FREESTREAM_VEL_EQ_MACH, FREESTREAM_VEL_EQ_ONE) +REF_DIMENSIONALIZATION= FREESTREAM_PRESS_EQ_ONE + +% ----------------------- BOUNDARY CONDITION DEFINITION -----------------------% +% +% Marker of the Euler boundary (0 = no marker) +MARKER_EULER= ( airfoil ) +% +% Marker of the far field (0 = no marker) +MARKER_FAR= ( farfield ) + +% ------------------------ SURFACES IDENTIFICATION ----------------------------% +% +% Marker of the surface which is going to be plotted or designed +MARKER_PLOTTING= ( airfoil ) +% +% Marker of the surface where the functional (Cd, Cl, etc.) will be evaluated +MARKER_MONITORING= ( airfoil ) + +% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% +% +% Numerical method for spatial gradients (GREEN_GAUSS, WEIGHTED_LEAST_SQUARES) +NUM_METHOD_GRAD= GREEN_GAUSS +% +% Courant-Friedrichs-Lewy condition of the finest grid +CFL_NUMBER= 10.0 +% +% Adaptive CFL number (NO, YES) +CFL_ADAPT= NO +% +% Parameters of the adaptive CFL number (factor down, factor up, CFL min value, +% CFL max value ) +CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) +% +% Runge-Kutta alpha coefficients +RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) +% + +% ------------------------ LINEAR SOLVER DEFINITION ---------------------------% +% +% Linear solver for the implicit (or discrete adjoint) formulation (LU_SGS, +% SYM_GAUSS_SEIDEL, BCGSTAB, GMRES) +LINEAR_SOLVER= FGMRES +% +% Preconditioner of the Krylov linear solver (NONE, JACOBI, LINELET, LUSGS) +LINEAR_SOLVER_PREC= ILU +% +% Min error of the linear solver for the implicit formulation +LINEAR_SOLVER_ERROR= 1E-4 +% +% Max number of iterations of the linear solver for the implicit formulation +LINEAR_SOLVER_ITER= 2 + +% -------------------------- MULTIGRID PARAMETERS -----------------------------% +% +% Multi-Grid Levels (0 = no multi-grid) +MGLEVEL= 2 +% +% Multi-grid cycle (V_CYCLE, W_CYCLE, FULLMG_CYCLE) +MGCYCLE= V_CYCLE +% +% Multi-Grid PreSmoothing Level +MG_PRE_SMOOTH= ( 1, 2, 3, 3 ) +% +% Multi-Grid PostSmoothing Level +MG_POST_SMOOTH= ( 0, 0, 0, 0 ) +% +% Jacobi implicit smoothing of the correction +MG_CORRECTION_SMOOTH= ( 0, 0, 0, 0 ) +% +% Damping factor for the residual restriction +MG_DAMP_RESTRICTION= 1.0 +% +% Damping factor for the correction prolongation +MG_DAMP_PROLONGATION= 1.0 + +% --------------------- FLOW NUMERICAL METHOD DEFINITION ----------------------% +% Convective numerical method (JST, LAX-FRIEDRICH, ROE-1ST_ORDER, +% ROE-2ND_ORDER) +CONV_NUM_METHOD_FLOW= JST +% +% Slope limiter (VENKATAKRISHNAN) +SLOPE_LIMITER_FLOW= VENKATAKRISHNAN +% +% 2nd and 4th order artificial dissipation coefficients +JST_SENSOR_COEFF= ( 0.5, 0.02 ) +% +% Time discretization (RUNGE-KUTTA_EXPLICIT, EULER_IMPLICIT, EULER_EXPLICIT) +TIME_DISCRE_FLOW= EULER_IMPLICIT + +% ---------------- ADJOINT-FLOW NUMERICAL METHOD DEFINITION -------------------% +% Adjoint problem boundary condition (DRAG, LIFT, SIDEFORCE, MOMENT_X, +% MOMENT_Y, MOMENT_Z, EFFICIENCY, +% EQUIVALENT_AREA, NEARFIELD_PRESSURE, +% FORCE_X, FORCE_Y, FORCE_Z, THRUST, +% TORQUE, FREE_SURFACE) +OBJECTIVE_FUNCTION= EFFICIENCY +OPT_OBJECTIVE= EFFICIENCY +% +% Convective numerical method (JST, LAX-FRIEDRICH, ROE-1ST_ORDER, +% ROE-2ND_ORDER) +CONV_NUM_METHOD_ADJFLOW= JST +% +% Slope limiter (VENKATAKRISHNAN, SHARP_EDGES) +SLOPE_LIMITER_ADJFLOW= VENKATAKRISHNAN +% +% 2nd, and 4th order artificial dissipation coefficients +ADJ_JST_SENSOR_COEFF= ( 0.0, 0.02 ) +% +% Time discretization (RUNGE-KUTTA_EXPLICIT, EULER_IMPLICIT) +TIME_DISCRE_ADJFLOW= EULER_IMPLICIT +% +% Reduction factor of the CFL coefficient in the adjoint problem +CFL_REDUCTION_ADJFLOW= 0.8 +% +% Limit value for the adjoint variable +LIMIT_ADJFLOW= 1E6 + +% -------------------- FREE-FORM DEFORMATION PARAMETERS -----------------------% +% +% Tolerance of the Free-Form Deformation point inversion +FFD_TOLERANCE= 1E-10 +% +% Maximum number of iterations in the Free-Form Deformation point inversion +FFD_ITERATIONS= 500 +% +% FFD box definition: 3D case (FFD_BoxTag, X1, Y1, Z1, X2, Y2, Z2, X3, Y3, Z3, X4, Y4, Z4, +% X5, Y5, Z5, X6, Y6, Z6, X7, Y7, Z7, X8, Y8, Z8) +% 2D case (FFD_BoxTag, X1, Y1, 0.0, X2, Y2, 0.0, X3, Y3, 0.0, X4, Y4, 0.0, +% 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) +FFD_DEFINITION= (airfoil_box, -0.1, -0.25, 0, 1.1, -0.25, 0, 1.1, 0.25, 0, -0.1, 0.25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) +% +% FFD box degree: 3D case (x_degree, y_degree, z_degree) +% 2D case (x_degree, y_degree, 0) +FFD_DEGREE= (10, 1, 0) +% +% Surface continuity at the intersection with the FFD (1ST_DERIVATIVE, 2ND_DERIVATIVE) +FFD_CONTINUITY= 2ND_DERIVATIVE + +% ----------------------- DESIGN VARIABLE PARAMETERS --------------------------% +% +% Kind of deformation (FFD_SETTING, FFD_CONTROL_POINT_2D, FFD_CAMBER_2D, FFD_THICKNESS_2D, +% HICKS_HENNE, COSINE_BUMP, PARABOLIC, +% NACA_4DIGITS, DISPLACEMENT, ROTATION, FFD_CONTROL_POINT, +% FFD_DIHEDRAL_ANGLE, FFD_TWIST_ANGLE, FFD_ROTATION, +% FFD_CAMBER, FFD_THICKNESS, FFD_CONTROL_SURFACE, SURFACE_FILE, AIRFOIL) +%DV_KIND= FFD_CONTROL_POINT, FFD_CONTROL_POINT, FFD_CONTROL_POINT, FFD_CONTROL_POINT, FFD_CONTROL_POINT, FFD_CONTROL_POINT, FFD_CONTROL_POINT, FFD_CONTROL_POINT, FFD_CONTROL_POINT, FFD_CONTROL_POINT, FFD_CONTROL_POINT, FFD_CONTROL_POINT, FFD_CONTROL_POINT, FFD_CONTROL_POINT, FFD_CONTROL_POINT, FFD_CONTROL_POINT, FFD_CONTROL_POINT, FFD_CONTROL_POINT, FFD_CONTROL_POINT, FFD_CONTROL_POINT, FFD_CONTROL_POINT, FFD_CONTROL_POINT +DV_KIND= FFD_SETTING +% +% Marker of the surface in which we are going apply the shape deformation +DV_MARKER= ( airfoil ) +% +% Parameters of the shape deformation +% - FFD_CONTROL_POINT ( FFD_BoxTag, i_Ind, j_Ind, k_Ind, x_Disp, y_Disp, z_Disp ) +% - FFD_DIHEDRAL_ANGLE ( FFD_BoxTag, x_Orig, y_Orig, z_Orig, x_End, y_End, z_End ) +% - FFD_TWIST_ANGLE ( FFD_BoxTag, x_Orig, y_Orig, z_Orig, x_End, y_End, z_End ) +% - FFD_ROTATION ( FFD_BoxTag, x_Orig, y_Orig, z_Orig, x_End, y_End, z_End ) +% - FFD_CAMBER ( FFD_BoxTag, i_Ind, j_Ind ) +% - FFD_THICKNESS ( FFD_BoxTag, i_Ind, j_Ind ) +% - FFD_VOLUME ( FFD_BoxTag, i_Ind, j_Ind ) +%DV_PARAM= ( airfoil_box, 0, 0, 0, 0.0, 1.0, 0.0 ); ( airfoil_box, 1, 0, 0, 0.0, 1.0, 0.0 ); ( airfoil_box, 2, 0, 0, 0.0, 1.0, 0.0 ); ( airfoil_box, 3, 0, 0, 0.0, 1.0, 0.0 ); ( airfoil_box, 4, 0, 0, 0.0, 1.0, 0.0 ); ( airfoil_box, 5, 0, 0, 0.0, 1.0, 0.0 ); ( airfoil_box, 6, 0, 0, 0.0, 1.0, 0.0 ); ( airfoil_box, 7, 0, 0, 0.0, 1.0, 0.0 ); ( airfoil_box, 8, 0, 0, 0.0, 1.0, 0.0 ); ( airfoil_box, 9, 0, 0, 0.0, 1.0, 0.0 ); ( airfoil_box, 10, 0, 0, 0.0, 1.0, 0.0 ); ( airfoil_box, 0, 1, 0, 0.0, 1.0, 0.0 ); ( airfoil_box, 1, 1, 0, 0.0, 1.0, 0.0 ); ( airfoil_box, 2, 1, 0, 0.0, 1.0, 0.0 ); ( airfoil_box, 3, 1, 0, 0.0, 1.0, 0.0 ); ( airfoil_box, 4, 1, 0, 0.0, 1.0, 0.0 ); ( airfoil_box, 5, 1, 0, 0.0, 1.0, 0.0 ); ( airfoil_box, 6, 1, 0, 0.0, 1.0, 0.0 ); ( airfoil_box, 7, 1, 0, 0.0, 1.0, 0.0 ); ( airfoil_box, 8, 1, 0, 0.0, 1.0, 0.0 ); ( airfoil_box, 9, 1, 0, 0.0, 1.0, 0.0 ); ( airfoil_box, 10, 1, 0, 0.0, 1.0, 0.0 ) +DV_PARAM= ( airfoil_box, 5, 0, 0, 0.0, 1.0, 0.0 ) +% +% New value of the shape deformation +%DV_VALUE= 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05 +DV_VALUE= 0.05 + +% ------------------------ GRID DEFORMATION PARAMETERS ------------------------% +% +% Number of smoothing iterations for FEA mesh deformation +DEFORM_LINEAR_ITER= 500 +% +% Number of nonlinear deformation iterations (surface deformation increments) +DEFORM_NONLINEAR_ITER= 1 +% +% Print the residuals during mesh deformation to the console (YES, NO) +DEFORM_CONSOLE_OUTPUT= YES +% +% Factor to multiply smallest cell volume for deform tolerance (0.001 default) +DEFORM_LINEAR_SOLVER_ERROR = 0.000000001 +% +% Type of element stiffness imposed for FEA mesh deformation (INVERSE_VOLUME, +% WALL_DISTANCE, CONSTANT_STIFFNESS) +DEFORM_STIFFNESS_TYPE= INVERSE_VOLUME + +% --------------------------- CONVERGENCE PARAMETERS --------------------------% +% Convergence criteria (CAUCHY, RESIDUAL) +% +CONV_CRITERIA= RESIDUAL +% +% Residual reduction (order of magnitude with respect to the initial value) +RESIDUAL_REDUCTION= 16 +% +% Min value of the residual (log10 of the residual) +RESIDUAL_MINVAL= -20 +% +% Start Cauchy criteria at iteration number +STARTCONV_ITER= 10 +% +% Number of elements to apply the criteria +CAUCHY_ELEMS= 100 +% +% Epsilon to control the series convergence +CAUCHY_EPS= 1E-6 +% +% Direct function to apply the convergence criteria (LIFT, DRAG, NEARFIELD_PRESS) +CAUCHY_FUNC_FLOW= DRAG +% +% Adjoint function to apply the convergence criteria (SENS_GEOMETRY, SENS_MACH) +CAUCHY_FUNC_ADJFLOW= SENS_GEOMETRY + +% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% +% +% Mesh input file +MESH_FILENAME= mesh_NACA0012_inv_FFD.su2 +% +% Mesh input file format (SU2, CGNS, NETCDF_ASCII) +MESH_FORMAT= SU2 +% +% Mesh output file +MESH_OUT_FILENAME= mesh_out.su2 +% +% Restart flow input file +SOLUTION_FLOW_FILENAME= solution_flow.dat +% +% Restart adjoint input file +SOLUTION_ADJ_FILENAME= solution_adj.dat +% +% Output file format (PARAVIEW, TECPLOT) +OUTPUT_FORMAT= PARAVIEW_BINARY +% +% Output file convergence history (w/o extension) +CONV_FILENAME= history +% +% Output file restart flow +RESTART_FLOW_FILENAME= restart_flow.dat +% +% Output file restart adjoint +RESTART_ADJ_FILENAME= restart_adj.dat +% +% Output file flow (w/o extension) variables +VOLUME_FLOW_FILENAME= flow +% +% Output file adjoint (w/o extension) variables +VOLUME_ADJ_FILENAME= adjoint +% +% Output Objective function gradient (using continuous adjoint) +GRAD_OBJFUNC_FILENAME= of_grad.dat +% +% Output file surface flow coefficient (w/o extension) +SURFACE_FLOW_FILENAME= surface_flow +% +% Output file surface adjoint coefficient (w/o extension) +SURFACE_ADJ_FILENAME= surface_adjoint +% +% Writing solution file frequency +WRT_SOL_FREQ= 250 +% +% Writing solution file frequency for physical time steps (dual time) +WRT_SOL_FREQ_DUALTIME= 1 +% +% Writing convergence history frequency +WRT_CON_FREQ= 1 +% +% Writing convergence history frequency (dual time, only written to screen) +WRT_CON_FREQ_DUALTIME= 10 +% +% Output rind layers in the solution files +WRT_HALO= NO + +% Optimization design variables, separated by semicolons +% FFD_CONTROL_POINT (Y) +DEFINITION_DV= ( 11, 1.0 | airfoil | airfoil_box, 0, 0, 0, 0.0, 1.0, 0.0 ); ( 11, 1.0 | airfoil | airfoil_box, 1, 0, 0, 0.0, 1.0, 0.0 ); ( 11, 1.0 | airfoil | airfoil_box, 2, 0, 0, 0.0, 1.0, 0.0 ); ( 11, 1.0 | airfoil | airfoil_box, 3, 0, 0, 0.0, 1.0, 0.0 ); ( 11, 1.0 | airfoil | airfoil_box, 4, 0, 0, 0.0, 1.0, 0.0 ); ( 11, 1.0 | airfoil | airfoil_box, 5, 0, 0, 0.0, 1.0, 0.0 ); ( 11, 1.0 | airfoil | airfoil_box, 6, 0, 0, 0.0, 1.0, 0.0 ); ( 11, 1.0 | airfoil | airfoil_box, 7, 0, 0, 0.0, 1.0, 0.0 ); ( 11, 1.0 | airfoil | airfoil_box, 8, 0, 0, 0.0, 1.0, 0.0 ); ( 11, 1.0 | airfoil | airfoil_box, 9, 0, 0, 0.0, 1.0, 0.0 ); ( 11, 1.0 | airfoil | airfoil_box, 10, 0, 0, 0.0, 1.0, 0.0 ); ( 11, 1.0 | airfoil | airfoil_box, 0, 1, 0, 0.0, 1.0, 0.0 ); ( 11, 1.0 | airfoil | airfoil_box, 1, 1, 0, 0.0, 1.0, 0.0 ); ( 11, 1.0 | airfoil | airfoil_box, 2, 1, 0, 0.0, 1.0, 0.0 ); ( 11, 1.0 | airfoil | airfoil_box, 3, 1, 0, 0.0, 1.0, 0.0 ); ( 11, 1.0 | airfoil | airfoil_box, 4, 1, 0, 0.0, 1.0, 0.0 ); ( 11, 1.0 | airfoil | airfoil_box, 5, 1, 0, 0.0, 1.0, 0.0 ); ( 11, 1.0 | airfoil | airfoil_box, 6, 1, 0, 0.0, 1.0, 0.0 ); ( 11, 1.0 | airfoil | airfoil_box, 7, 1, 0, 0.0, 1.0, 0.0 ); ( 11, 1.0 | airfoil | airfoil_box, 8, 1, 0, 0.0, 1.0, 0.0 ); ( 11, 1.0 | airfoil | airfoil_box, 9, 1, 0, 0.0, 1.0, 0.0 ); ( 11, 1.0 | airfoil | airfoil_box, 10, 1, 0, 0.0, 1.0, 0.0 ) + diff --git a/TestCases/parallel_regression_AD.py b/TestCases/parallel_regression_AD.py index 4aa4b65e6d6..1e0b4e6c53f 100644 --- a/TestCases/parallel_regression_AD.py +++ b/TestCases/parallel_regression_AD.py @@ -199,6 +199,22 @@ def main(): discadj_DT_1ST_cylinder.unsteady = True test_list.append(discadj_DT_1ST_cylinder) + ###################################################### + ### Unsteady Disc. adj. compressible pitching NACA ### + ###################################################### + + # compressible pitching NACA0012 + discadj_pitchingNACA0012 = TestCase('pitchingNACA0012') + discadj_pitchingNACA0012.cfg_dir = "disc_adj_euler/naca0012_pitching" + discadj_pitchingNACA0012.cfg_file = "inv_NACA0012_pitching.cfg" + discadj_pitchingNACA0012.test_iter = 4 + discadj_pitchingNACA0012.test_vals = [-2.638190, -3.106640, -7.0756e-04, 1.6333e-06] #last 4 columns + discadj_pitchingNACA0012.su2_exec = "parallel_computation.py -f" + discadj_pitchingNACA0012.timeout = 1600 + discadj_pitchingNACA0012.tol = 0.00001 + discadj_pitchingNACA0012.unsteady = True + test_list.append(discadj_pitchingNACA0012) + ####################################################### ### Disc. adj. turbomachinery ### ####################################################### diff --git a/TestCases/serial_regression_AD.py b/TestCases/serial_regression_AD.py index 318c8f0e31f..3f639d84bfe 100644 --- a/TestCases/serial_regression_AD.py +++ b/TestCases/serial_regression_AD.py @@ -199,6 +199,22 @@ def main(): discadj_DT_1ST_cylinder.unsteady = True test_list.append(discadj_DT_1ST_cylinder) + ###################################################### + ### Unsteady Disc. adj. compressible pitching NACA ### + ###################################################### + + # compressible pitching NACA0012 + discadj_pitchingNACA0012 = TestCase('pitchingNACA0012') + discadj_pitchingNACA0012.cfg_dir = "disc_adj_euler/naca0012_pitching" + discadj_pitchingNACA0012.cfg_file = "inv_NACA0012_pitching.cfg" + discadj_pitchingNACA0012.test_iter = 4 + discadj_pitchingNACA0012.test_vals = [-2.641237, -3.110423, -7.0498e-04, 1.2996e-06] #last 4 columns + discadj_pitchingNACA0012.su2_exec = "SU2_CFD_AD" + discadj_pitchingNACA0012.timeout = 1600 + discadj_pitchingNACA0012.tol = 0.00001 + discadj_pitchingNACA0012.unsteady = True + test_list.append(discadj_pitchingNACA0012) + ################################### ### Structural Adjoint ### ###################################