From 64a6c80c2040492c8a3830fd61ae03026873fa33 Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi <60700515+Nicola-Fonzi@users.noreply.github.com> Date: Mon, 22 Feb 2021 10:41:40 +0100 Subject: [PATCH 01/10] Develop (#6) * new function inside existing sst source term class (no new class since never needed alone) * implement function to compute residual * update authors * one more duplicate * fix typo k2 not k1 * fix error * add production * Update AUTHORS.md * update authors - alphabetical, duplication * first attempt complete * add diffusion terms to jacobian * small change * Corrections based on PR comments * cosmetics * remove else * add AD::SetPreaccIn * cleanup, try to make vertex tractions more general * Removing old setInitialMesh * Compute the interface mapping starting from the undeformed mesh * Loads computed for all the solid markers * Tentative modification of test case * Introduced start time for forced motion * Final version of new test case * Updated values in regression * Complete reorganisation of the interface * Fixes to vector data * minor changes and correction * Better initialisation of variables * Small typo in parallel regression * comment out jacobian to conserve diagonal dominance * spaces and comments * error * geometry was modified twice for RANS problems in SetDualTime_Solver * update dual time weakly coupled heat * small fix for aeroelastic, update rigid motion regressions * forgot to save * Fixed regression values after PR#1199 * array deleted twice * Multiple superposed forced motions * Error with array dimension * add test case and regression list entry * remove jacobian contribution and test case config file options * Introduced condition on mesh boundary * Update SU2_CFD/src/solvers/CMeshSolver.cpp * fix_typoLinael * constification, remove legacy python FSI * fix #1202 * more const Co-authored-by: emanresu Co-authored-by: Pedro Gomes Co-authored-by: Florian <55834287+FlorianDm@users.noreply.github.com> Co-authored-by: cvencro Co-authored-by: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com> Co-authored-by: TobiKattmann Co-authored-by: TobiKattmann <31306376+TobiKattmann@users.noreply.github.com> --- AUTHORS.md | 27 +- Common/include/CConfig.hpp | 4 +- Common/include/option_structure.hpp | 4 - Common/src/CConfig.cpp | 15 +- SU2_CFD/include/drivers/CDriver.hpp | 285 +------ SU2_CFD/include/integration/CIntegration.hpp | 12 +- .../integration/CStructuralIntegration.hpp | 8 + SU2_CFD/include/iteration/CFluidIteration.hpp | 9 + .../numerics/turbulent/turb_sources.hpp | 43 +- SU2_CFD/include/solvers/CFEASolver.hpp | 18 +- .../include/solvers/CFVMFlowSolverBase.inl | 19 +- SU2_CFD/include/solvers/CSolver.hpp | 36 +- SU2_CFD/src/integration/CIntegration.cpp | 127 +-- .../integration/CStructuralIntegration.cpp | 36 + SU2_CFD/src/iteration/CAdjFluidIteration.cpp | 5 + .../src/iteration/CDiscAdjFluidIteration.cpp | 6 +- SU2_CFD/src/iteration/CFEAIteration.cpp | 5 +- SU2_CFD/src/iteration/CFluidIteration.cpp | 90 +- SU2_CFD/src/iteration/CHeatIteration.cpp | 5 + SU2_CFD/src/iteration/CIteration.cpp | 31 - SU2_CFD/src/iteration/CIterationFactory.cpp | 2 +- .../src/numerics/turbulent/turb_sources.cpp | 16 +- SU2_CFD/src/output/CFlowCompOutput.cpp | 7 - SU2_CFD/src/output/CFlowOutput.cpp | 4 + SU2_CFD/src/output/CNEMOCompOutput.cpp | 7 - SU2_CFD/src/python_wrapper_structure.cpp | 806 +++++------------- SU2_CFD/src/solvers/CFEASolver.cpp | 18 +- SU2_CFD/src/solvers/CMeshSolver.cpp | 4 +- SU2_CFD/src/solvers/CSolver.cpp | 168 ++-- SU2_CFD/src/solvers/CTurbSSTSolver.cpp | 7 + SU2_PY/FSI_tools/FSIInterface.py | 12 +- SU2_PY/SU2_Nastran/pysu2_nastran.py | 92 +- .../air_nozzle/air_nozzle.cfg | 214 +++++ .../cont_adj_euler/naca0012/inv_NACA0012.cfg | 2 +- .../naca0012/inv_NACA0012_FD.cfg | 2 +- .../wedge/inv_wedge_ROE_multiobj.cfg | 2 +- .../cont_adj_rans/oneram6/turb_ONERAM6.cfg | 7 +- .../coupled_cht/comp_2d/flow_cylinder.cfg | 2 +- .../coupled_cht/comp_2d/solid_cylinder1.cfg | 2 +- .../coupled_cht/comp_2d/solid_cylinder2.cfg | 2 +- .../coupled_cht/comp_2d/solid_cylinder3.cfg | 2 +- .../disc_adj_incomp_2d/flow_cylinder.cfg | 2 +- .../disc_adj_incomp_2d/solid_cylinder1.cfg | 2 +- .../disc_adj_incomp_2d/solid_cylinder2.cfg | 2 +- .../disc_adj_incomp_2d/solid_cylinder3.cfg | 2 +- .../coupled_cht/incomp_2d/flow_cylinder.cfg | 2 +- .../coupled_cht/incomp_2d/solid_cylinder1.cfg | 2 +- .../coupled_cht/incomp_2d/solid_cylinder2.cfg | 2 +- .../coupled_cht/incomp_2d/solid_cylinder3.cfg | 2 +- .../incomp_2d_unsteady/flow_cylinder.cfg | 2 +- .../incomp_2d_unsteady/solid_cylinder1.cfg | 2 +- .../incomp_2d_unsteady/solid_cylinder2.cfg | 2 +- .../incomp_2d_unsteady/solid_cylinder3.cfg | 2 +- .../disc_adj_euler/arina2k/Arina2KRS.cfg | 2 +- .../cylinder3D/inv_cylinder3D.cfg | 2 +- .../cylinder/heated_cylinder.cfg | 2 +- .../naca0012/turb_naca0012_sa.cfg | 2 +- .../naca0012/turb_naca0012_sst.cfg | 2 +- TestCases/gust/inv_gust_NACA0012.cfg | 2 +- TestCases/hybrid_regression.py | 12 + TestCases/incomp_euler/nozzle/inv_nozzle.cfg | 2 +- .../buoyancy_cavity/lam_buoyancy_cavity.cfg | 2 +- .../cylinder/poly_cylinder.cfg | 2 +- .../rough_flatplate_incomp.cfg | 2 +- .../mms/fvm_incomp_euler/inv_mms_jst.cfg | 2 +- .../fvm_incomp_navierstokes/lam_mms_fds.cfg | 2 +- .../mms/fvm_navierstokes/lam_mms_roe.cfg | 2 +- TestCases/moving_wall/cavity/lam_cavity.cfg | 3 +- .../spinning_cylinder/spinning_cylinder.cfg | 2 +- .../inv_wedge_ROE_2surf_1obj.cfg | 2 +- .../inv_wedge_ROE_multiobj.cfg | 2 +- .../inv_wedge_ROE_multiobj_1surf.cfg | 2 +- .../inv_wedge_ROE_multiobj_combo.cfg | 2 +- .../pitching_NACA64A010.cfg | 2 +- .../pitching_oneram6/pitching_ONERAM6.cfg | 2 +- .../rotating_naca0012/rotating_NACA0012.cfg | 2 +- TestCases/parallel_regression.py | 19 +- .../flatPlate_rigidMotion_Conf.cfg | 310 +------ .../launch_flatPlate_rigidMotion.py | 56 +- .../launch_unsteady_CHT_FlatPlate.py | 48 +- .../unsteady_CHT_FlatPlate_Conf.cfg | 2 +- TestCases/serial_regression.py | 21 +- config_template.cfg | 2 +- 83 files changed, 1010 insertions(+), 1692 deletions(-) create mode 100644 TestCases/axisymmetric_rans/air_nozzle/air_nozzle.cfg diff --git a/AUTHORS.md b/AUTHORS.md index b223314f1cf4..9ac39ec05e9c 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -43,6 +43,7 @@ Copyright holders might be the individual person or their respective employer. I ``` Akshay.K.R Alejandro +Alessandro Gastaldi Aman uz zaman Baig Amit Sachdeva Ana Lourenco @@ -53,19 +54,23 @@ Antonio Rubino Arne Bachmann Beckett Y. Zhou Benjamin S. Kirk -Brandon Tracey +Brendan Tracey +Brian Munguía Carsten Othmer +Catarina Garbacz +Charanya Venkatesan-Crome Clark Pederson Daumantas Kavolis Dave Taflin Eduardo Molina Ethan Alan Hereth -FlorianDm +Florian Dittmann Francisco D. Palacios Gaurav Bansal Giulio Gori Guillaume Bâty Harichand M V +HL Kline IndianaStokes J. Sinsay JSmith36 @@ -75,13 +80,19 @@ Jayant Mukhopadhaya Jeffrey van Oostrom Jessie Lauzon João Loureiro +Johannes Blühdorn +JonathanSmith1936 Kedar Naik LaSerpe +Lennaert Tol Matteo Pini +Max Aehle Max Le Max Sagebaum Michele Gaffuri Mickael Philit +Mladen Banovic +Nicola Fonzi Ole Burghardt Patrick Mischke Paul Urbanczyk @@ -91,6 +102,7 @@ Pete Bachant RaulFeijo55 Ruben Sanchez Ryan Barrett +SaettaE Salvatore Vitale Samet Cakmakcioglu Scott Imlay @@ -104,25 +116,26 @@ Trent Lukaczyk VivaanKhatri Wally Maier aaronyicongfu +aeroamit anilvar +band-a-prend +bigfootedrockmidget bmunguia chamsolli costat -cr109 -cvencro daniel-linton demanosalvas dmudiger erangit flo -hlkline +fmpmorgado +garcgutierrez +jtneedels juliendm jvanoostrom -koodlyakshay mcolonno minkwankim padronas -sametcaka sravya91 srcopela tobadavid diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index 3aa76c0faa40..91684f20d32d 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -657,7 +657,7 @@ class CConfig { nMarker_ZoneInterface, /*!< \brief Number of markers in the zone interface. */ nMarker_Plotting, /*!< \brief Number of markers to plot. */ nMarker_Analyze, /*!< \brief Number of markers to analyze. */ - nMarker_Moving, /*!< \brief Number of markers in motion (DEFORMING, MOVING_WALL, or FLUID_STRUCTURE). */ + nMarker_Moving, /*!< \brief Number of markers in motion (DEFORMING, MOVING_WALL). */ nMarker_PyCustom, /*!< \brief Number of markers that are customizable in Python. */ nMarker_DV, /*!< \brief Number of markers affected by the design variables. */ nMarker_WallFunctions; /*!< \brief Number of markers for which wall functions must be applied. */ @@ -667,7 +667,7 @@ class CConfig { *Marker_Plotting, /*!< \brief Markers to plot. */ *Marker_Analyze, /*!< \brief Markers to analyze. */ *Marker_ZoneInterface, /*!< \brief Markers in the FSI interface. */ - *Marker_Moving, /*!< \brief Markers in motion (DEFORMING, MOVING_WALL, or FLUID_STRUCTURE). */ + *Marker_Moving, /*!< \brief Markers in motion (DEFORMING, MOVING_WALL). */ *Marker_PyCustom, /*!< \brief Markers that are customizable in Python. */ *Marker_DV, /*!< \brief Markers affected by the design variables. */ *Marker_WallFunctions; /*!< \brief Markers for which wall functions must be applied. */ diff --git a/Common/include/option_structure.hpp b/Common/include/option_structure.hpp index 5a3c8213c379..c7044f8b75ea 100644 --- a/Common/include/option_structure.hpp +++ b/Common/include/option_structure.hpp @@ -176,7 +176,6 @@ enum ENUM_MAIN_SOLVER { INC_NAVIER_STOKES =5, /*!< \brief Definition of the incompressible Navier-Stokes' solver. */ INC_RANS = 6, /*!< \brief Definition of the incompressible Reynolds-averaged Navier-Stokes' (RANS) solver. */ HEAT_EQUATION = 7, /*!< \brief Definition of the finite volume heat solver. */ - FLUID_STRUCTURE_INTERACTION = 8, /*!< \brief Definition of a FSI solver. */ FEM_ELASTICITY = 9, /*!< \brief Definition of a FEM solver. */ ADJ_EULER = 10, /*!< \brief Definition of the continuous adjoint Euler's solver. */ ADJ_NAVIER_STOKES = 11, /*!< \brief Definition of the continuous adjoint Navier-Stokes' solver. */ @@ -231,7 +230,6 @@ static const MapType Solver_Map = { MakePair("DISC_ADJ_FEM_RANS", DISC_ADJ_FEM_RANS) MakePair("DISC_ADJ_FEM_NS", DISC_ADJ_FEM_NS) MakePair("DISC_ADJ_FEM", DISC_ADJ_FEM) - MakePair("FLUID_STRUCTURE_INTERACTION", FLUID_STRUCTURE_INTERACTION) MakePair("TEMPLATE_SOLVER", TEMPLATE_SOLVER) MakePair("MULTIPHYSICS", MULTIPHYSICS) }; @@ -699,7 +697,6 @@ enum ENUM_SURFACEMOVEMENT { MOVING_WALL = 2, /*!< \brief Simulation with moving wall. */ AEROELASTIC = 3, /*!< \brief Simulation with aeroelastic motion. */ AEROELASTIC_RIGID_MOTION = 4, /*!< \brief Simulation with rotation and aeroelastic motion. */ - FLUID_STRUCTURE = 5, /*!< \brief Fluid structure deformation. */ EXTERNAL = 6, /*!< \brief Simulation with external motion. */ EXTERNAL_ROTATION = 7, /*!< \brief Simulation with external rotation motion. */ }; @@ -708,7 +705,6 @@ static const MapType SurfaceMovement_Map = { MakePair("MOVING_WALL", MOVING_WALL) MakePair("AEROELASTIC_RIGID_MOTION", AEROELASTIC_RIGID_MOTION) MakePair("AEROELASTIC", AEROELASTIC) - MakePair("FLUID_STRUCTURE", FLUID_STRUCTURE) MakePair("EXTERNAL", EXTERNAL) MakePair("EXTERNAL_ROTATION", EXTERNAL_ROTATION) }; diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index 01137a94aae3..b434a2f6edd2 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -3114,13 +3114,6 @@ void CConfig::SetnZone(){ } - /*--- Temporary fix until Multizone Disc. Adj. solver is ready ---- */ - - if (Kind_Solver == FLUID_STRUCTURE_INTERACTION){ - - nZone = GetnZone(Mesh_FileName, Mesh_FileFormat); - - } } void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_izone, unsigned short val_nDim) { @@ -3563,11 +3556,7 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ } } - if ((nKind_SurfaceMovement > 1) && GetSurface_Movement(FLUID_STRUCTURE)) { - SU2_MPI::Error("FSI in combination with moving surfaces is currently not supported.", CURRENT_FUNCTION); - } - - if ((nKind_SurfaceMovement != nMarker_Moving) && !GetSurface_Movement(FLUID_STRUCTURE)) { + if (nKind_SurfaceMovement != nMarker_Moving) { SU2_MPI::Error("Number of KIND_SURFACE_MOVEMENT must match number of MARKER_MOVING", CURRENT_FUNCTION); } @@ -5590,7 +5579,6 @@ void CConfig::SetOutput(unsigned short val_software, unsigned short val_izone) { case RIGID_MOTION: cout << "rigid mesh motion." << endl; break; case MOVING_HTP: cout << "HTP moving." << endl; break; case ROTATING_FRAME: cout << "rotating reference frame." << endl; break; - case FLUID_STRUCTURE: cout << "fluid-structure motion." << endl; break; case EXTERNAL: cout << "externally prescribed motion." << endl; break; } } @@ -8302,7 +8290,6 @@ bool CConfig::GetVolumetric_Movement() const { if (GetSurface_Movement(AEROELASTIC) || GetSurface_Movement(AEROELASTIC_RIGID_MOTION)|| - GetSurface_Movement(FLUID_STRUCTURE) || GetSurface_Movement(EXTERNAL) || GetSurface_Movement(EXTERNAL_ROTATION)){ volumetric_movement = true; diff --git a/SU2_CFD/include/drivers/CDriver.hpp b/SU2_CFD/include/drivers/CDriver.hpp index 82bedff1ddc9..954f943036fd 100644 --- a/SU2_CFD/include/drivers/CDriver.hpp +++ b/SU2_CFD/include/drivers/CDriver.hpp @@ -97,10 +97,6 @@ class CDriver { vector > > interpolator_container; /*!< \brief Definition of the interpolation method between non-matching discretizations of the interface. */ CInterface ***interface_container; /*!< \brief Definition of the interface of information and physics. */ - su2double PyWrapVarCoord[3], /*!< \brief This is used to store the VarCoord of each vertex. */ - PyWrapNodalForce[3], /*!< \brief This is used to store the force at each vertex. */ - PyWrapNodalForceDensity[3], /*!< \brief This is used to store the force density at each vertex. */ - PyWrapNodalHeatFlux[3]; /*!< \brief This is used to store the heat flux at each vertex. */ bool dry_run; /*!< \brief Flag if SU2_CFD was started as dry-run via "SU2_CFD -d .cfg" */ public: @@ -360,11 +356,6 @@ class CDriver { */ virtual void DynamicMeshUpdate(unsigned short val_iZone, unsigned long TimeIter) { } - /*! - * \brief Perform a static mesh deformation, without considering grid velocity. - */ - virtual void StaticMeshUpdate() { } - /*! * \brief Perform a mesh deformation as initial condition. */ @@ -373,69 +364,63 @@ class CDriver { /*! * \brief Process the boundary conditions and update the multigrid structure. */ - virtual void BoundaryConditionsUpdate() { } + void BoundaryConditionsUpdate(); /*! * \brief Get the total drag. * \return Total drag. */ - passivedouble Get_Drag(); + passivedouble Get_Drag() const; /*! * \brief Get the total lift. * \return Total lift. */ - passivedouble Get_Lift(); + passivedouble Get_Lift() const; /*! * \brief Get the total x moment. * \return Total x moment. */ - passivedouble Get_Mx(); + passivedouble Get_Mx() const; /*! * \brief Get the total y moment. * \return Total y moment. */ - passivedouble Get_My(); + passivedouble Get_My() const; /*! * \brief Get the total z moment. * \return Total z moment. */ - passivedouble Get_Mz(); + passivedouble Get_Mz() const; /*! * \brief Get the total drag coefficient. * \return Total drag coefficient. */ - passivedouble Get_DragCoeff(); + passivedouble Get_DragCoeff() const; /*! * \brief Get the total lift coefficient. * \return Total lift coefficient. */ - passivedouble Get_LiftCoeff(); - - /*! - * \brief Get the moving marker identifier. - * \return Moving marker identifier. - */ - unsigned short GetMovingMarker(); + passivedouble Get_LiftCoeff() const; /*! * \brief Get the number of vertices (halo nodes included) from a specified marker. * \param[in] iMarker - Marker identifier. * \return Number of vertices. */ - unsigned long GetNumberVertices(unsigned short iMarker); + unsigned long GetNumberVertices(unsigned short iMarker) const; /*! * \brief Get the number of halo vertices from a specified marker. * \param[in] iMarker - Marker identifier. * \return Number of vertices. */ - unsigned long GetNumberHaloVertices(unsigned short iMarker); + unsigned long GetNumberHaloVertices(unsigned short iMarker) const; /*! * \brief Check if a vertex is physical or not (halo node) on a specified marker. @@ -443,13 +428,13 @@ class CDriver { * \param[in] iVertex - Vertex identifier. * \return True if the specified vertex is a halo node. */ - bool IsAHaloNode(unsigned short iMarker, unsigned long iVertex); + bool IsAHaloNode(unsigned short iMarker, unsigned long iVertex) const; /*! * \brief Get the number of external iterations. * \return Number of external iterations. */ - unsigned long GetnTimeIter(); + unsigned long GetnTimeIter() const; /*! * \brief Get the current external iteration. @@ -461,7 +446,7 @@ class CDriver { * \brief Get the unsteady time step. * \return Unsteady time step. */ - passivedouble GetUnsteady_TimeStep(); + passivedouble GetUnsteady_TimeStep() const; /*! * \brief Get the global index of a vertex on a specified marker. @@ -469,119 +454,15 @@ class CDriver { * \param[in] iVertex - Vertex identifier. * \return Vertex global index. */ - unsigned long GetVertexGlobalIndex(unsigned short iMarker, unsigned long iVertex); - - /*! - * \brief Get the x coordinate of a vertex on a specified marker. - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \return x coordinate of the vertex. - */ - passivedouble GetVertexCoordX(unsigned short iMarker, unsigned long iVertex); - - /*! - * \brief Get the y coordinate of a vertex on a specified marker. - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \return y coordinate of the vertex. - */ - passivedouble GetVertexCoordY(unsigned short iMarker, unsigned long iVertex); - - /*! - * \brief Get the z coordinate of a vertex on a specified marker. - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \return z coordinate of the vertex. - */ - passivedouble GetVertexCoordZ(unsigned short iMarker, unsigned long iVertex); - - /*! - * \brief Compute the total force (pressure and shear stress) at a vertex on a specified marker (3 components). - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \return True if the vertex is a halo node (non physical force). - */ - bool ComputeVertexForces(unsigned short iMarker, unsigned long iVertex); - - /*! - * \brief Get the x component of the force at a vertex on a specified marker. - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \return x component of the force at the vertex. - */ - passivedouble GetVertexForceX(unsigned short iMarker, unsigned long iVertex); - - /*! - * \brief Get the y component of the force at a vertex on a specified marker. - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \return y component of the force at the vertex. - */ - passivedouble GetVertexForceY(unsigned short iMarker, unsigned long iVertex); - - /*! - * \brief Get the z component of the force at a vertex on a specified marker. - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \return z component of the force at the vertex. - */ - passivedouble GetVertexForceZ(unsigned short iMarker, unsigned long iVertex); - - /*! - * \brief Get the x component of the force density at a vertex on a specified marker. - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \return x component of the force density at the vertex. - */ - passivedouble GetVertexForceDensityX(unsigned short iMarker, unsigned long iVertex); - - /*! - * \brief Get the y component of the force density at a vertex on a specified marker. - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \return y component of the force density at the vertex. - */ - passivedouble GetVertexForceDensityY(unsigned short iMarker, unsigned long iVertex); - - /*! - * \brief Get the z component of the force density at a vertex on a specified marker. - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \return z component of the force density at the vertex. - */ - passivedouble GetVertexForceDensityZ(unsigned short iMarker, unsigned long iVertex); + unsigned long GetVertexGlobalIndex(unsigned short iMarker, unsigned long iVertex) const; /*! - * \brief Set the x coordinate of a vertex on a specified marker. + * \brief Get undeformed coordinates from the mesh solver. * \param[in] iMarker - Marker identifier. * \param[in] iVertex - Vertex identifier. - * \param[in] newPosX - New x coordinate of the vertex. + * \return x,y,z coordinates of the vertex. */ - void SetVertexCoordX(unsigned short iMarker, unsigned long iVertex, passivedouble newPosX); - - /*! - * \brief Set the y coordinate of a vertex on a specified marker. - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \param[in] newPosY - New y coordinate of the vertex. - */ - void SetVertexCoordY(unsigned short iMarker, unsigned long iVertex, passivedouble newPosY); - - /*! - * \brief Set the z coordinate of a vertex on a specified marker. - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \param[in] newPosZ - New z coordinate of the vertex. - */ - void SetVertexCoordZ(unsigned short iMarker, unsigned long iVertex, passivedouble newPosZ); - - /*! - * \brief Set the VarCoord of a vertex on a specified marker. - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \return Norm of the VarCoord. - */ - passivedouble SetVertexVarCoord(unsigned short iMarker, unsigned long iVertex); + vector GetInitialMeshCoord(unsigned short iMarker, unsigned long iVertex) const; /*! * \brief Get the temperature at a vertex on a specified marker. @@ -589,7 +470,7 @@ class CDriver { * \param[in] iVertex - Vertex identifier. * \return Temperature of the vertex. */ - passivedouble GetVertexTemperature(unsigned short iMarker, unsigned long iVertex); + passivedouble GetVertexTemperature(unsigned short iMarker, unsigned long iVertex) const; /*! * \brief Set the temperature of a vertex on a specified marker. @@ -600,36 +481,12 @@ class CDriver { void SetVertexTemperature(unsigned short iMarker, unsigned long iVertex, passivedouble val_WallTemp); /*! - * \brief Compute the heat flux at a vertex on a specified marker (3 components). + * \brief Get the heat flux at a vertex on a specified marker (3 components). * \param[in] iMarker - Marker identifier. * \param[in] iVertex - Vertex identifier. * \return True if the vertex is a halo node. */ - bool ComputeVertexHeatFluxes(unsigned short iMarker, unsigned long iVertex); - - /*! - * \brief Get the x component of the heat flux at a vertex on a specified marker. - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \return x component of the heat flux at the vertex. - */ - passivedouble GetVertexHeatFluxX(unsigned short iMarker, unsigned long iVertex); - - /*! - * \brief Get the y component of the heat flux at a vertex on a specified marker. - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \return y component of the heat flux at the vertex. - */ - passivedouble GetVertexHeatFluxY(unsigned short iMarker, unsigned long iVertex); - - /*! - * \brief Get the z component of the heat flux at a vertex on a specified marker. - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \return z component of the heat flux at the vertex. - */ - passivedouble GetVertexHeatFluxZ(unsigned short iMarker, unsigned long iVertex); + vector GetVertexHeatFluxes(unsigned short iMarker, unsigned long iVertex) const; /*! * \brief Get the wall normal component of the heat flux at a vertex on a specified marker. @@ -637,7 +494,7 @@ class CDriver { * \param[in] iVertex - Vertex identifier. * \return Wall normal component of the heat flux at the vertex. */ - passivedouble GetVertexNormalHeatFlux(unsigned short iMarker, unsigned long iVertex); + passivedouble GetVertexNormalHeatFlux(unsigned short iMarker, unsigned long iVertex) const; /*! * \brief Set the wall normal component of the heat flux at a vertex on a specified marker. @@ -653,7 +510,7 @@ class CDriver { * \param[in] iVertex - Vertex identifier. * \return Thermal conductivity at the vertex. */ - passivedouble GetThermalConductivity(unsigned short iMarker, unsigned long iVertex); + passivedouble GetThermalConductivity(unsigned short iMarker, unsigned long iVertex) const; /*! * \brief Preprocess the inlets via file input for all solvers. @@ -661,8 +518,7 @@ class CDriver { * \param[in] geometry - Geometrical definition of the problem. * \param[in] config - Definition of the particular problem. */ - void Inlet_Preprocessing(CSolver ***solver, CGeometry **geometry, - CConfig *config) const; + void Inlet_Preprocessing(CSolver ***solver, CGeometry **geometry, CConfig *config) const; /*! * \brief Get the unit normal (vector) at a vertex on a specified marker. @@ -670,55 +526,43 @@ class CDriver { * \param[in] iVertex - Vertex identifier. * \return Unit normal (vector) at the vertex. */ - vector GetVertexUnitNormal(unsigned short iMarker, unsigned long iVertex); + vector GetVertexUnitNormal(unsigned short iMarker, unsigned long iVertex) const; /*! * \brief Get all the boundary markers tags. * \return List of boundary markers tags. */ - vector GetAllBoundaryMarkersTag(); - - /*! - * \brief Get all the moving boundary markers tags. - * \return List of moving boundary markers tags. - */ - vector GetAllMovingMarkersTag(); + vector GetAllBoundaryMarkersTag() const; /*! * \brief Get all the deformable boundary marker tags. * \return List of deformable boundary markers tags. */ - vector GetAllDeformMeshMarkersTag(); - - /*! - * \brief Get all the fluid load boundary marker tags. - * \return List of fluid load boundary markers tags. - */ - vector GetAllFluidLoadMarkersTag(); + vector GetAllDeformMeshMarkersTag() const; /*! * \brief Get all the heat transfer boundary markers tags. * \return List of heat transfer boundary markers tags. */ - vector GetAllCHTMarkersTag(); + vector GetAllCHTMarkersTag() const; /*! * \brief Get all the (subsonic) inlet boundary markers tags. * \return List of inlet boundary markers tags. */ - vector GetAllInletMarkersTag(); + vector GetAllInletMarkersTag() const; /*! * \brief Get all the boundary markers tags with their associated indices. * \return List of boundary markers tags with their indices. */ - map GetAllBoundaryMarkers(); + map GetAllBoundaryMarkers() const; /*! * \brief Get all the boundary markers tags with their associated types. * \return List of boundary markers tags with their types. */ - map GetAllBoundaryMarkersType(); + map GetAllBoundaryMarkersType() const; /*! * \brief Set the mesh displacement for the elasticity mesh solver. @@ -741,7 +585,7 @@ class CDriver { * \param[in] iVertex - Vertex identifier. * \return Vector of sensitivities. */ - vector GetMeshDisp_Sensitivity(unsigned short iMarker, unsigned long iVertex); + vector GetMeshDisp_Sensitivity(unsigned short iMarker, unsigned long iVertex) const; /*! * \brief Set the load in X direction for the structural solver. @@ -760,7 +604,7 @@ class CDriver { * \param[in] iVertex - Vertex identifier. * \return Vector of displacements. */ - vector GetFEA_Displacements(unsigned short iMarker, unsigned long iVertex); + vector GetFEA_Displacements(unsigned short iMarker, unsigned long iVertex) const; /*! * \brief Return the velocities from the FEA Solver. @@ -768,7 +612,7 @@ class CDriver { * \param[in] iVertex - Vertex identifier. * \return Vector of velocities. */ - vector GetFEA_Velocity(unsigned short iMarker, unsigned long iVertex); + vector GetFEA_Velocity(unsigned short iMarker, unsigned long iVertex) const; /*! * \brief Return the velocities from the FEA Solver. @@ -776,7 +620,7 @@ class CDriver { * \param[in] iVertex - Vertex identifier. * \return Vector of velocities at time n. */ - vector GetFEA_Velocity_n(unsigned short iMarker, unsigned long iVertex); + vector GetFEA_Velocity_n(unsigned short iMarker, unsigned long iVertex) const; /*! * \brief Get the sensitivity of the flow loads for the structural solver. @@ -786,7 +630,7 @@ class CDriver { * \param[in] LoadX - Value of the load in the direction Y. * \param[in] LoadX - Value of the load in the direction Z. */ - vector GetFlowLoad_Sensitivity(unsigned short iMarker, unsigned long iVertex); + vector GetFlowLoad_Sensitivity(unsigned short iMarker, unsigned long iVertex) const; /*! * \brief Get the flow load (from the extra step - the repeated methods should be unified once the postprocessing @@ -794,7 +638,7 @@ class CDriver { * \param[in] iMarker - Marker identifier. * \param[in] iVertex - Vertex identifier. */ - vector GetFlowLoad(unsigned short iMarker, unsigned long iVertex); + vector GetFlowLoad(unsigned short iMarker, unsigned long iVertex) const; /*! * \brief Set the adjoint of the flow tractions (from the extra step - @@ -819,14 +663,6 @@ class CDriver { void SetSourceTerm_DispAdjoint(unsigned short iMarker, unsigned long iVertex, passivedouble val_AdjointX, passivedouble val_AdjointY, passivedouble val_AdjointZ); - /*! - * \brief Get the undeformed mesh coordinates - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \return Undeformed Vertex Coordinates - */ - vector GetVertex_UndeformedCoord(unsigned short iMarker, unsigned long iVertex); - /*! * \brief Set the position of the heat source. * \param[in] alpha - Angle of rotation respect to Z axis. @@ -962,60 +798,11 @@ class CFluidDriver : public CDriver { */ void DynamicMeshUpdate(unsigned long TimeIter) override; - /*! - * \brief Perform a static mesh deformation, without considering grid velocity (multiple zone). - */ - void StaticMeshUpdate() override; - - /*! - * \brief Perform a mesh deformation as initial condition (multiple zone). - */ - void SetInitialMesh() override; - - /*! - * \brief Process the boundary conditions and update the multigrid structure. - */ - void BoundaryConditionsUpdate() override; - /*! * \brief Transfer data among different zones (multiple zone). */ void Transfer_Data(unsigned short donorZone, unsigned short targetZone); - /*! - * \brief Set the total temperature of a vertex on a specified inlet marker. - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \param[in] val_Ttotal - Value of the total (stagnation) temperature. - */ - void SetVertexTtotal(unsigned short iMarker, unsigned long iVertex, passivedouble val_Ttotal); - - /*! - * \brief Set the total pressure of a vertex on a specified inlet marker. - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \param[in] val_Ptotal - Value of the total (stagnation) pressure. - */ - void SetVertexPtotal(unsigned short iMarker, unsigned long iVertex, passivedouble val_Ptotal); - - /*! - * \brief Set the flow direction of a vertex on a specified inlet marker. - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \param[in] iDim - Index of the flow direction unit vector - * \param[in] val_FlowDir - Component of a unit vector representing the flow direction - */ - void SetVertexFlowDir(unsigned short iMarker, unsigned long iVertex, unsigned short iDim, passivedouble val_FlowDir); - - /*! - * \brief Set a turbulence variable on a specified inlet marker. - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \param[in] iDim - Index of the turbulence variable (i.e. k is 0 in SST) - * \param[in] val_turb_var - Value of the turbulence variable to be used. - */ - void SetVertexTurbVar(unsigned short iMarker, unsigned long iVertex, unsigned short iDim, passivedouble val_tub_var); - }; diff --git a/SU2_CFD/include/integration/CIntegration.hpp b/SU2_CFD/include/integration/CIntegration.hpp index 0c88a5d05596..2062713e718a 100644 --- a/SU2_CFD/include/integration/CIntegration.hpp +++ b/SU2_CFD/include/integration/CIntegration.hpp @@ -125,20 +125,20 @@ class CIntegration { inline bool GetConvergence_FullMG(void) const { return Convergence_FullMG; } /*! - * \brief Save the solution, and volume at different time steps. + * \brief Save the geometry at different time steps. * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solution - Flow solution. + * \param[in] solver - Mesh solver. * \param[in] config - Definition of the particular problem. */ - void SetDualTime_Solver(CGeometry *geometry, CSolver *solver, CConfig *config, unsigned short iMesh); + void SetDualTime_Geometry(CGeometry *geometry, CSolver *mesh_solver, const CConfig *config, unsigned short iMesh); /*! - * \brief Save the structural solution at different time steps. + * \brief Save the solution at different time steps, and reset certain fields for the next timestep. * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Structural solution. + * \param[in] solver - Some solver. * \param[in] config - Definition of the particular problem. */ - void SetStructural_Solver(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh); + virtual void SetDualTime_Solver(const CGeometry *geometry, CSolver *solver, const CConfig *config, unsigned short iMesh); /*! * \brief A virtual member. diff --git a/SU2_CFD/include/integration/CStructuralIntegration.hpp b/SU2_CFD/include/integration/CStructuralIntegration.hpp index 845167a3d4b2..bcd446935803 100644 --- a/SU2_CFD/include/integration/CStructuralIntegration.hpp +++ b/SU2_CFD/include/integration/CStructuralIntegration.hpp @@ -51,6 +51,14 @@ class CStructuralIntegration final : public CIntegration { CNumerics ******numerics_container, CConfig **config, unsigned short RunTime_EqSystem, unsigned short iZone, unsigned short iInst) override; + /*! + * \brief Save the solution at different time steps, and reset certain fields for the next timestep. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] solver - Structural solver. + * \param[in] config - Definition of the problem. + */ + void SetDualTime_Solver(const CGeometry *geometry, CSolver *solver, const CConfig *config, unsigned short iMesh) override; + private: /*! * \brief Do the space integration of the numerical system on a FEM framework. diff --git a/SU2_CFD/include/iteration/CFluidIteration.hpp b/SU2_CFD/include/iteration/CFluidIteration.hpp index 82cd95628be0..9271ef475a16 100644 --- a/SU2_CFD/include/iteration/CFluidIteration.hpp +++ b/SU2_CFD/include/iteration/CFluidIteration.hpp @@ -115,6 +115,8 @@ class CFluidIteration : public CIteration { CVolumetricMovement*** grid_movement, CFreeFormDefBox*** FFDBox, unsigned short val_iZone, unsigned short val_iInst) override; + private: + /*! * \brief Imposes a gust via the grid velocities. * \author S. Padron @@ -146,4 +148,11 @@ class CFluidIteration : public CIteration { * \return Boolean indicating weather calculation should be stopped */ bool MonitorFixed_CL(COutput* output, CGeometry* geometry, CSolver** solver, CConfig* config); + + /*! + * \brief Store old aeroelastic solutions + * \param[in,out] config - Definition of the particular problem. + */ + void SetDualTime_Aeroelastic(CConfig* config) const; + }; diff --git a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp index f8fa6bab7111..55f5ba658425 100644 --- a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp +++ b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp @@ -305,8 +305,10 @@ class CSourcePieceWise_TurbSST final : public CNumerics { alfa_2, beta_1, beta_2, - sigma_omega_1, - sigma_omega_2, + sigma_k_1, + sigma_k_2, + sigma_w_1, + sigma_w_2, beta_star, a1; @@ -320,12 +322,49 @@ class CSourcePieceWise_TurbSST final : public CNumerics { bool incompressible; bool sustaining_terms; + bool axisymmetric; /*! * \brief A virtual member. Get strain magnitude based on perturbed reynolds stress matrix * \param[in] turb_ke: turbulent kinetic energy of the node */ void SetPerturbedStrainMag(su2double turb_ke); + + /*! + * \brief Add contribution due to axisymmetric formulation to 2D residual + */ + inline void ResidualAxisymmetric(su2double alfa_blended, su2double zeta){ + + if (Coord_i[1] < EPS) return; + + su2double yinv, rhov, k, w; + su2double sigma_k_i, sigma_w_i; + su2double pk_axi, pw_axi, cdk_axi, cdw_axi; + + AD::SetPreaccIn(Coord_i[1]); + + yinv = 1.0/Coord_i[1]; + rhov = Density_i*V_i[2]; + k = TurbVar_i[0]; + w = TurbVar_i[1]; + + /*--- Compute blended constants ---*/ + sigma_k_i = F1_i*sigma_k_1+(1.0-F1_i)*sigma_k_2; + sigma_w_i = F1_i*sigma_w_1+(1.0-F1_i)*sigma_w_2; + + /*--- Production ---*/ + pk_axi = max(0.0,2.0/3.0*rhov*k*(2.0/zeta*(yinv*V_i[2]-PrimVar_Grad_i[2][1]-PrimVar_Grad_i[1][0])-1.0)); + pw_axi = alfa_blended*zeta/k*pk_axi; + + /*--- Convection-Diffusion ---*/ + cdk_axi = rhov*k-(Laminar_Viscosity_i+sigma_k_i*Eddy_Viscosity_i)*TurbVar_Grad_i[0][1]; + cdw_axi = rhov*w-(Laminar_Viscosity_i+sigma_w_i*Eddy_Viscosity_i)*TurbVar_Grad_i[1][1]; + + /*--- Add terms to the residuals ---*/ + Residual[0] += yinv*Volume*(pk_axi-cdk_axi); + Residual[1] += yinv*Volume*(pw_axi-cdw_axi); + + } public: /*! diff --git a/SU2_CFD/include/solvers/CFEASolver.hpp b/SU2_CFD/include/solvers/CFEASolver.hpp index d845127be60d..2e3cee9e5e09 100644 --- a/SU2_CFD/include/solvers/CFEASolver.hpp +++ b/SU2_CFD/include/solvers/CFEASolver.hpp @@ -314,7 +314,7 @@ class CFEASolver : public CSolver { * \param[in] numerics - Description of the numerical method. * \param[in] config - Definition of the particular problem. */ - void Compute_MassMatrix(CGeometry *geometry, + void Compute_MassMatrix(const CGeometry *geometry, CNumerics **numerics, const CConfig *config) final; @@ -324,7 +324,7 @@ class CFEASolver : public CSolver { * \param[in] numerics - Description of the numerical method. * \param[in] config - Definition of the particular problem. */ - void Compute_MassRes(CGeometry *geometry, + void Compute_MassRes(const CGeometry *geometry, CNumerics **numerics, const CConfig *config) final; @@ -472,7 +472,7 @@ class CFEASolver : public CSolver { * \param[in] numerics - Numerical methods. * \param[in] config - Definition of the particular problem. */ - void ImplicitNewmark_Iteration(CGeometry *geometry, + void ImplicitNewmark_Iteration(const CGeometry *geometry, CNumerics **numerics, const CConfig *config) final; @@ -481,14 +481,14 @@ class CFEASolver : public CSolver { * \param[in] geometry - Geometrical definition of the problem. * \param[in] config - Definition of the particular problem. */ - void ImplicitNewmark_Update(CGeometry *geometry, CConfig *config) final; + void ImplicitNewmark_Update(const CGeometry *geometry, const CConfig *config) final; /*! * \brief A virtual member. * \param[in] geometry - Geometrical definition of the problem. * \param[in] config - Definition of the particular problem. */ - void ImplicitNewmark_Relaxation(CGeometry *geometry, CConfig *config) final; + void ImplicitNewmark_Relaxation(const CGeometry *geometry, const CConfig *config) final; /*! * \brief Iterate using an implicit Generalized Alpha solver. @@ -496,7 +496,7 @@ class CFEASolver : public CSolver { * \param[in] numerics - Numerical methods. * \param[in] config - Definition of the particular problem. */ - void GeneralizedAlpha_Iteration(CGeometry *geometry, + void GeneralizedAlpha_Iteration(const CGeometry *geometry, CNumerics **numerics, const CConfig *config) final; @@ -505,21 +505,21 @@ class CFEASolver : public CSolver { * \param[in] geometry - Geometrical definition of the problem. * \param[in] config - Definition of the particular problem. */ - void GeneralizedAlpha_UpdateDisp(CGeometry *geometry, CConfig *config) final; + void GeneralizedAlpha_UpdateDisp(const CGeometry *geometry, const CConfig *config) final; /*! * \brief Update the solution using an implicit Generalized Alpha solver. * \param[in] geometry - Geometrical definition of the problem. * \param[in] config - Definition of the particular problem. */ - void GeneralizedAlpha_UpdateSolution(CGeometry *geometry, CConfig *config) final; + void GeneralizedAlpha_UpdateSolution(const CGeometry *geometry, const CConfig *config) final; /*! * \brief Update the solution using an implicit Generalized Alpha solver. * \param[in] geometry - Geometrical definition of the problem. * \param[in] config - Definition of the particular problem. */ - void GeneralizedAlpha_UpdateLoads(CGeometry *geometry, const CConfig *config) final; + void GeneralizedAlpha_UpdateLoads(const CGeometry *geometry, const CConfig *config) final; /*! * \brief Postprocessing. diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl index f17b2bb21777..865b6b216a02 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl @@ -225,11 +225,20 @@ void CFVMFlowSolverBase::Allocate(const CConfig& config) { } } - /*--- Only initialize when there is a Marker_Fluid_Load defined - *--- (this avoids overhead in all other cases while a more permanent structure is being developed) ---*/ - if ((config.GetnMarker_Fluid_Load() > 0) && (MGLevel == MESH_0)) { - Alloc3D(nMarker, nVertex, nDim, VertexTraction); - if (config.GetDiscrete_Adjoint()) Alloc3D(nMarker, nVertex, nDim, VertexTractionAdjoint); + if (MGLevel == MESH_0) { + VertexTraction.resize(nMarker); + for (iMarker = 0; iMarker < nMarker; iMarker++) { + if (config.GetSolid_Wall(iMarker)) + VertexTraction[iMarker].resize(nVertex[iMarker], nDim) = su2double(0.0); + } + + if (config.GetDiscrete_Adjoint()) { + VertexTractionAdjoint.resize(nMarker); + for (iMarker = 0; iMarker < nMarker; iMarker++) { + if (config.GetSolid_Wall(iMarker)) + VertexTractionAdjoint[iMarker].resize(nVertex[iMarker], nDim) = su2double(0.0); + } + } } /*--- Initialize the BGS residuals in FSI problems. ---*/ diff --git a/SU2_CFD/include/solvers/CSolver.hpp b/SU2_CFD/include/solvers/CSolver.hpp index 062711cb47b6..e8d108e6d218 100644 --- a/SU2_CFD/include/solvers/CSolver.hpp +++ b/SU2_CFD/include/solvers/CSolver.hpp @@ -133,8 +133,8 @@ class CSolver { bool dynamic_grid; /*!< \brief Flag that determines whether the grid is dynamic (moving or deforming + grid velocities). */ - su2double ***VertexTraction; /*- Temporary, this will be moved to a new postprocessing structure once in place -*/ - su2double ***VertexTractionAdjoint; /*- Also temporary -*/ + vector VertexTraction; /*- Temporary, this will be moved to a new postprocessing structure once in place -*/ + vector VertexTractionAdjoint; /*- Also temporary -*/ string SolverName; /*!< \brief Store the name of the solver for output purposes. */ @@ -1557,7 +1557,7 @@ class CSolver { * \param[in] numerics - Numerical methods. * \param[in] config - Definition of the particular problem. */ - inline virtual void ImplicitNewmark_Iteration(CGeometry *geometry, + inline virtual void ImplicitNewmark_Iteration(const CGeometry *geometry, CNumerics **numerics, const CConfig *config) { } @@ -1567,8 +1567,8 @@ class CSolver { * \param[in] solver_container - Container vector with all the solutions. * \param[in] config - Definition of the particular problem. */ - inline virtual void ImplicitNewmark_Update(CGeometry *geometry, - CConfig *config) { } + inline virtual void ImplicitNewmark_Update(const CGeometry *geometry, + const CConfig *config) { } /*! * \brief A virtual member. @@ -1576,8 +1576,8 @@ class CSolver { * \param[in] solver_container - Container vector with all the solutions. * \param[in] config - Definition of the particular problem. */ - inline virtual void ImplicitNewmark_Relaxation(CGeometry *geometry, - CConfig *config) { } + inline virtual void ImplicitNewmark_Relaxation(const CGeometry *geometry, + const CConfig *config) { } /*! * \brief A virtual member. @@ -1585,7 +1585,7 @@ class CSolver { * \param[in] numerics - Numerical methods. * \param[in] config - Definition of the particular problem. */ - inline virtual void GeneralizedAlpha_Iteration(CGeometry *geometry, + inline virtual void GeneralizedAlpha_Iteration(const CGeometry *geometry, CNumerics **numerics, const CConfig *config) { } @@ -1595,8 +1595,8 @@ class CSolver { * \param[in] solver_container - Container vector with all the solutions. * \param[in] config - Definition of the particular problem. */ - inline virtual void GeneralizedAlpha_UpdateDisp(CGeometry *geometry, - CConfig *config) { } + inline virtual void GeneralizedAlpha_UpdateDisp(const CGeometry *geometry, + const CConfig *config) { } /*! * \brief A virtual member. @@ -1604,8 +1604,8 @@ class CSolver { * \param[in] solver_container - Container vector with all the solutions. * \param[in] config - Definition of the particular problem. */ - inline virtual void GeneralizedAlpha_UpdateSolution(CGeometry *geometry, - CConfig *config) { } + inline virtual void GeneralizedAlpha_UpdateSolution(const CGeometry *geometry, + const CConfig *config) { } /*! * \brief A virtual member. @@ -1613,7 +1613,7 @@ class CSolver { * \param[in] solver_container - Container vector with all the solutions. * \param[in] config - Definition of the particular problem. */ - inline virtual void GeneralizedAlpha_UpdateLoads(CGeometry *geometry, + inline virtual void GeneralizedAlpha_UpdateLoads(const CGeometry *geometry, const CConfig *config) { } /*! @@ -3770,7 +3770,7 @@ class CSolver { * \param[in] numerics - Description of the numerical method. * \param[in] config - Definition of the particular problem. */ - inline virtual void Compute_MassMatrix(CGeometry *geometry, + inline virtual void Compute_MassMatrix(const CGeometry *geometry, CNumerics **numerics, const CConfig *config) { } @@ -3780,7 +3780,7 @@ class CSolver { * \param[in] numerics - Description of the numerical method. * \param[in] config - Definition of the particular problem. */ - inline virtual void Compute_MassRes(CGeometry *geometry, + inline virtual void Compute_MassRes(const CGeometry *geometry, CNumerics **numerics, const CConfig *config) { } @@ -4339,7 +4339,7 @@ class CSolver { * \param[in] geometry - Geometrical definition. * \param[in] config - Definition of the particular problem. */ - void ComputeVertexTractions(CGeometry *geometry, CConfig *config); + void ComputeVertexTractions(CGeometry *geometry, const CConfig *config); /*! * \brief Set the adjoints of the vertex tractions. @@ -4356,7 +4356,7 @@ class CSolver { * \param[in] geometry - Geometrical definition. * \param[in] config - Definition of the particular problem. */ - void RegisterVertexTractions(CGeometry *geometry, CConfig *config); + void RegisterVertexTractions(CGeometry *geometry, const CConfig *config); /*! * \brief Store the adjoints of the vertex tractions. @@ -4377,7 +4377,7 @@ class CSolver { * \param[in] geometry - Geometrical definition. * \param[in] config - Definition of the particular problem. */ - void SetVertexTractionsAdjoint(CGeometry *geometry, CConfig *config); + void SetVertexTractionsAdjoint(CGeometry *geometry, const CConfig *config); /*! * \brief Get minimun volume in the mesh diff --git a/SU2_CFD/src/integration/CIntegration.cpp b/SU2_CFD/src/integration/CIntegration.cpp index 811b1b5608cd..c2699c9eb560 100644 --- a/SU2_CFD/src/integration/CIntegration.cpp +++ b/SU2_CFD/src/integration/CIntegration.cpp @@ -208,14 +208,10 @@ void CIntegration::Time_Integration(CGeometry *geometry, CSolver **solver_contai } -void CIntegration::SetDualTime_Solver(CGeometry *geometry, CSolver *solver, CConfig *config, unsigned short iMesh) { +void CIntegration::SetDualTime_Geometry(CGeometry *geometry, CSolver *mesh_solver, const CConfig *config, unsigned short iMesh) { SU2_OMP_PARALLEL { - /*--- Store old solution, volumes and coordinates (in case there is grid movement). ---*/ - - solver->GetNodes()->Set_Solution_time_n1(); - solver->GetNodes()->Set_Solution_time_n(); geometry->nodes->SetVolume_nM1(); geometry->nodes->SetVolume_n(); @@ -225,6 +221,19 @@ void CIntegration::SetDualTime_Solver(CGeometry *geometry, CSolver *solver, CCon geometry->nodes->SetCoord_n(); } + if ((iMesh==MESH_0) && config->GetDeform_Mesh()) mesh_solver->SetDualTime_Mesh(); + + } // end SU2_OMP_PARALLEL +} + +void CIntegration::SetDualTime_Solver(const CGeometry *geometry, CSolver *solver, const CConfig *config, unsigned short iMesh) { + + SU2_OMP_PARALLEL + { + /*--- Store old solution ---*/ + solver->GetNodes()->Set_Solution_time_n1(); + solver->GetNodes()->Set_Solution_time_n(); + SU2_OMP_MASTER solver->ResetCFLAdapt(); SU2_OMP_BARRIER @@ -239,113 +248,5 @@ void CIntegration::SetDualTime_Solver(CGeometry *geometry, CSolver *solver, CCon solver->GetNodes()->SetLocalCFL(iPoint, config->GetCFL(iMesh)); } - /*--- Store old aeroelastic solutions ---*/ - SU2_OMP_MASTER - if (config->GetGrid_Movement() && config->GetAeroelastic_Simulation() && (iMesh == MESH_0)) { - - config->SetAeroelastic_n1(); - config->SetAeroelastic_n(); - - /*--- Also communicate plunge and pitch to the master node. Needed for output in case of parallel run ---*/ - -#ifdef HAVE_MPI - su2double plunge, pitch, *plunge_all = NULL, *pitch_all = NULL; - unsigned short iMarker, iMarker_Monitoring; - unsigned long iProcessor, owner, *owner_all = NULL; - - string Marker_Tag, Monitoring_Tag; - int nProcessor = size; - - /*--- Only if master node allocate memory ---*/ - - if (rank == MASTER_NODE) { - plunge_all = new su2double[nProcessor]; - pitch_all = new su2double[nProcessor]; - owner_all = new unsigned long[nProcessor]; - } - - /*--- Find marker and give it's plunge and pitch coordinate to the master node ---*/ - - for (iMarker_Monitoring = 0; iMarker_Monitoring < config->GetnMarker_Monitoring(); iMarker_Monitoring++) { - - for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - - Monitoring_Tag = config->GetMarker_Monitoring_TagBound(iMarker_Monitoring); - Marker_Tag = config->GetMarker_All_TagBound(iMarker); - if (Marker_Tag == Monitoring_Tag) { owner = 1; break; - } else { - owner = 0; - } - - } - plunge = config->GetAeroelastic_plunge(iMarker_Monitoring); - pitch = config->GetAeroelastic_pitch(iMarker_Monitoring); - - /*--- Gather the data on the master node. ---*/ - - SU2_MPI::Gather(&plunge, 1, MPI_DOUBLE, plunge_all, 1, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); - SU2_MPI::Gather(&pitch, 1, MPI_DOUBLE, pitch_all, 1, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); - SU2_MPI::Gather(&owner, 1, MPI_UNSIGNED_LONG, owner_all, 1, MPI_UNSIGNED_LONG, MASTER_NODE, SU2_MPI::GetComm()); - - /*--- Set plunge and pitch on the master node ---*/ - - if (rank == MASTER_NODE) { - for (iProcessor = 0; iProcessor < (unsigned long)nProcessor; iProcessor++) { - if (owner_all[iProcessor] == 1) { - config->SetAeroelastic_plunge(iMarker_Monitoring, plunge_all[iProcessor]); - config->SetAeroelastic_pitch(iMarker_Monitoring, pitch_all[iProcessor]); - break; - } - } - } - - } - - if (rank == MASTER_NODE) { - delete [] plunge_all; - delete [] pitch_all; - delete [] owner_all; - } -#endif - } - SU2_OMP_BARRIER - } // end SU2_OMP_PARALLEL - -} - -void CIntegration::SetStructural_Solver(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh) { - - bool fsi = config->GetFSI_Simulation(); - - /*--- Update the solution according to the integration scheme used ---*/ - - switch (config->GetKind_TimeIntScheme_FEA()) { - case (CD_EXPLICIT): - break; - case (NEWMARK_IMPLICIT): - if (fsi) solver_container[FEA_SOL]->ImplicitNewmark_Relaxation(geometry, config); - break; - case (GENERALIZED_ALPHA): - solver_container[FEA_SOL]->GeneralizedAlpha_UpdateSolution(geometry, config); - solver_container[FEA_SOL]->GeneralizedAlpha_UpdateLoads(geometry, config); - break; - } - - /*--- Store the solution at t+1 as solution at t, both for the local points and for the halo points ---*/ - - solver_container[FEA_SOL]->GetNodes()->Set_Solution_time_n(); - solver_container[FEA_SOL]->GetNodes()->SetSolution_Vel_time_n(); - solver_container[FEA_SOL]->GetNodes()->SetSolution_Accel_time_n(); - - /*--- If FSI problem, save the last Aitken relaxation parameter of the previous time step ---*/ - - if (fsi) { - - su2double WAitk=0.0; - - WAitk = solver_container[FEA_SOL]->GetWAitken_Dyn(); - solver_container[FEA_SOL]->SetWAitken_Dyn_tn1(WAitk); - - } } diff --git a/SU2_CFD/src/integration/CStructuralIntegration.cpp b/SU2_CFD/src/integration/CStructuralIntegration.cpp index 3667eba307a4..52fb4177ceb8 100644 --- a/SU2_CFD/src/integration/CStructuralIntegration.cpp +++ b/SU2_CFD/src/integration/CStructuralIntegration.cpp @@ -190,3 +190,39 @@ void CStructuralIntegration::Time_Integration_FEM(CGeometry *geometry, CSolver * } } + +void CStructuralIntegration::SetDualTime_Solver(const CGeometry *geometry, CSolver *solver, const CConfig *config, unsigned short iMesh) { + + bool fsi = config->GetFSI_Simulation(); + + /*--- Update the solution according to the integration scheme used ---*/ + + switch (config->GetKind_TimeIntScheme_FEA()) { + case (CD_EXPLICIT): + break; + case (NEWMARK_IMPLICIT): + if (fsi) solver->ImplicitNewmark_Relaxation(geometry, config); + break; + case (GENERALIZED_ALPHA): + solver->GeneralizedAlpha_UpdateSolution(geometry, config); + solver->GeneralizedAlpha_UpdateLoads(geometry, config); + break; + } + + /*--- Store the solution at t+1 as solution at t, both for the local points and for the halo points ---*/ + + solver->GetNodes()->Set_Solution_time_n(); + solver->GetNodes()->SetSolution_Vel_time_n(); + solver->GetNodes()->SetSolution_Accel_time_n(); + + /*--- If FSI problem, save the last Aitken relaxation parameter of the previous time step ---*/ + + if (fsi) { + + su2double WAitk=0.0; + + WAitk = solver->GetWAitken_Dyn(); + solver->SetWAitken_Dyn_tn1(WAitk); + + } +} diff --git a/SU2_CFD/src/iteration/CAdjFluidIteration.cpp b/SU2_CFD/src/iteration/CAdjFluidIteration.cpp index 315b0d40be6c..870d6b00d2d8 100644 --- a/SU2_CFD/src/iteration/CAdjFluidIteration.cpp +++ b/SU2_CFD/src/iteration/CAdjFluidIteration.cpp @@ -181,6 +181,11 @@ void CAdjFluidIteration::Update(COutput* output, CIntegration**** integration, C integration[val_iZone][val_iInst][ADJFLOW_SOL]->SetDualTime_Solver( geometry[val_iZone][val_iInst][iMesh], solver[val_iZone][val_iInst][iMesh][ADJFLOW_SOL], config[val_iZone], iMesh); + + integration[val_iZone][val_iInst][ADJFLOW_SOL]->SetDualTime_Geometry( + geometry[val_iZone][val_iInst][iMesh], solver[val_iZone][val_iInst][iMesh][MESH_SOL], config[val_iZone], + iMesh); + integration[val_iZone][val_iInst][ADJFLOW_SOL]->SetConvergence(false); } diff --git a/SU2_CFD/src/iteration/CDiscAdjFluidIteration.cpp b/SU2_CFD/src/iteration/CDiscAdjFluidIteration.cpp index 9153084ae11c..94bfab7dc34f 100644 --- a/SU2_CFD/src/iteration/CDiscAdjFluidIteration.cpp +++ b/SU2_CFD/src/iteration/CDiscAdjFluidIteration.cpp @@ -370,7 +370,6 @@ void CDiscAdjFluidIteration::InitializeAdjoint(CSolver***** solver, CGeometry*** unsigned short iZone, unsigned short iInst) { bool frozen_visc = config[iZone]->GetFrozen_Visc_Disc(); bool heat = config[iZone]->GetWeakly_Coupled_Heat(); - bool interface_boundary = (config[iZone]->GetnMarker_Fluid_Load() > 0); /*--- Initialize the adjoints the conservative variables ---*/ @@ -390,7 +389,7 @@ void CDiscAdjFluidIteration::InitializeAdjoint(CSolver***** solver, CGeometry*** solver[iZone][iInst][MESH_0][ADJRAD_SOL]->SetAdjoint_Output(geometry[iZone][iInst][MESH_0], config[iZone]); } - if (interface_boundary) { + if (config[iZone]->GetFluidProblem()) { solver[iZone][iInst][MESH_0][FLOW_SOL]->SetVertexTractionsAdjoint(geometry[iZone][iInst][MESH_0], config[iZone]); } } @@ -510,7 +509,6 @@ void CDiscAdjFluidIteration::RegisterOutput(CSolver***** solver, CGeometry**** g COutput* output, unsigned short iZone, unsigned short iInst) { bool frozen_visc = config[iZone]->GetFrozen_Visc_Disc(); bool heat = config[iZone]->GetWeakly_Coupled_Heat(); - bool interface_boundary = (config[iZone]->GetnMarker_Fluid_Load() > 0); /*--- Register conservative variables as output of the iteration ---*/ @@ -526,7 +524,7 @@ void CDiscAdjFluidIteration::RegisterOutput(CSolver***** solver, CGeometry**** g if (config[iZone]->AddRadiation()) { solver[iZone][iInst][MESH_0][ADJRAD_SOL]->RegisterOutput(geometry[iZone][iInst][MESH_0], config[iZone]); } - if (interface_boundary) { + if (config[iZone]->GetFluidProblem()) { solver[iZone][iInst][MESH_0][FLOW_SOL]->RegisterVertexTractions(geometry[iZone][iInst][MESH_0], config[iZone]); } } diff --git a/SU2_CFD/src/iteration/CFEAIteration.cpp b/SU2_CFD/src/iteration/CFEAIteration.cpp index 11b553134d61..1263c41b36e2 100644 --- a/SU2_CFD/src/iteration/CFEAIteration.cpp +++ b/SU2_CFD/src/iteration/CFEAIteration.cpp @@ -196,8 +196,9 @@ void CFEAIteration::Update(COutput* output, CIntegration**** integration, CGeome /*----------------- Update structural solver ----------------------*/ if (dynamic) { - integration[val_iZone][val_iInst][FEA_SOL]->SetStructural_Solver( - geometry[val_iZone][val_iInst][MESH_0], solver[val_iZone][val_iInst][MESH_0], config[val_iZone], MESH_0); + integration[val_iZone][val_iInst][FEA_SOL]->SetDualTime_Solver( + geometry[val_iZone][val_iInst][MESH_0], solver[val_iZone][val_iInst][MESH_0][FEA_SOL], config[val_iZone], + MESH_0); integration[val_iZone][val_iInst][FEA_SOL]->SetConvergence(false); /*--- Verify convergence criteria (based on total time) ---*/ diff --git a/SU2_CFD/src/iteration/CFluidIteration.cpp b/SU2_CFD/src/iteration/CFluidIteration.cpp index 47a6f2625bb9..539252c76712 100644 --- a/SU2_CFD/src/iteration/CFluidIteration.cpp +++ b/SU2_CFD/src/iteration/CFluidIteration.cpp @@ -172,13 +172,15 @@ void CFluidIteration::Update(COutput* output, CIntegration**** integration, CGeo integration[val_iZone][val_iInst][FLOW_SOL]->SetDualTime_Solver(geometry[val_iZone][val_iInst][iMesh], solver[val_iZone][val_iInst][iMesh][FLOW_SOL], config[val_iZone], iMesh); + + integration[val_iZone][val_iInst][FLOW_SOL]->SetDualTime_Geometry(geometry[val_iZone][val_iInst][iMesh], + solver[val_iZone][val_iInst][iMesh][MESH_SOL], + config[val_iZone], iMesh); + integration[val_iZone][val_iInst][FLOW_SOL]->SetConvergence(false); } - /*--- Update dual time solver for the dynamic mesh solver ---*/ - if (config[val_iZone]->GetDeform_Mesh()) { - solver[val_iZone][val_iInst][MESH_0][MESH_SOL]->SetDualTime_Mesh(); - } + SetDualTime_Aeroelastic(config[val_iZone]); /*--- Update dual time solver for the turbulence model ---*/ @@ -199,6 +201,15 @@ void CFluidIteration::Update(COutput* output, CIntegration**** integration, CGeo config[val_iZone], MESH_0); integration[val_iZone][val_iInst][TRANS_SOL]->SetConvergence(false); } + + /*--- Update dual time solver for the weakly coupled energy equation ---*/ + + if (config[val_iZone]->GetWeakly_Coupled_Heat()) { + integration[val_iZone][val_iInst][HEAT_SOL]->SetDualTime_Solver(geometry[val_iZone][val_iInst][MESH_0], + solver[val_iZone][val_iInst][MESH_0][HEAT_SOL], + config[val_iZone], MESH_0); + integration[val_iZone][val_iInst][HEAT_SOL]->SetConvergence(false); + } } } @@ -557,3 +568,74 @@ bool CFluidIteration::MonitorFixed_CL(COutput *output, CGeometry *geometry, CSol /* --- Set convergence based on fixed CL convergence --- */ return fixed_cl_convergence; } + +void CFluidIteration::SetDualTime_Aeroelastic(CConfig* config) const { + + /*--- Store old aeroelastic solutions ---*/ + + if (config->GetGrid_Movement() && config->GetAeroelastic_Simulation()) { + + config->SetAeroelastic_n1(); + config->SetAeroelastic_n(); + + /*--- Also communicate plunge and pitch to the master node. Needed for output in case of parallel run ---*/ + +#ifdef HAVE_MPI + su2double plunge, pitch, *plunge_all = nullptr, *pitch_all = nullptr; + unsigned short iMarker, iMarker_Monitoring; + unsigned long iProcessor, owner, *owner_all = nullptr; + + string Marker_Tag, Monitoring_Tag; + int nProcessor = size; + + /*--- Only if master node allocate memory ---*/ + + if (rank == MASTER_NODE) { + plunge_all = new su2double[nProcessor]; + pitch_all = new su2double[nProcessor]; + owner_all = new unsigned long[nProcessor]; + } + + /*--- Find marker and give it's plunge and pitch coordinate to the master node ---*/ + + for (iMarker_Monitoring = 0; iMarker_Monitoring < config->GetnMarker_Monitoring(); iMarker_Monitoring++) { + + for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { + + Monitoring_Tag = config->GetMarker_Monitoring_TagBound(iMarker_Monitoring); + Marker_Tag = config->GetMarker_All_TagBound(iMarker); + if (Marker_Tag == Monitoring_Tag) { owner = 1; break; + } else { + owner = 0; + } + + } + plunge = config->GetAeroelastic_plunge(iMarker_Monitoring); + pitch = config->GetAeroelastic_pitch(iMarker_Monitoring); + + /*--- Gather the data on the master node. ---*/ + + SU2_MPI::Gather(&plunge, 1, MPI_DOUBLE, plunge_all, 1, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); + SU2_MPI::Gather(&pitch, 1, MPI_DOUBLE, pitch_all, 1, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); + SU2_MPI::Gather(&owner, 1, MPI_UNSIGNED_LONG, owner_all, 1, MPI_UNSIGNED_LONG, MASTER_NODE, SU2_MPI::GetComm()); + + /*--- Set plunge and pitch on the master node ---*/ + + if (rank == MASTER_NODE) { + for (iProcessor = 0; iProcessor < (unsigned long)nProcessor; iProcessor++) { + if (owner_all[iProcessor] == 1) { + config->SetAeroelastic_plunge(iMarker_Monitoring, plunge_all[iProcessor]); + config->SetAeroelastic_pitch(iMarker_Monitoring, pitch_all[iProcessor]); + break; + } + } + } + } + + delete [] plunge_all; + delete [] pitch_all; + delete [] owner_all; +#endif + } + +} diff --git a/SU2_CFD/src/iteration/CHeatIteration.cpp b/SU2_CFD/src/iteration/CHeatIteration.cpp index dbdd69ce22d3..adf02634aa18 100644 --- a/SU2_CFD/src/iteration/CHeatIteration.cpp +++ b/SU2_CFD/src/iteration/CHeatIteration.cpp @@ -56,6 +56,11 @@ void CHeatIteration::Update(COutput* output, CIntegration**** integration, CGeom integration[val_iZone][val_iInst][HEAT_SOL]->SetDualTime_Solver(geometry[val_iZone][val_iInst][iMesh], solver[val_iZone][val_iInst][iMesh][HEAT_SOL], config[val_iZone], iMesh); + + integration[val_iZone][val_iInst][HEAT_SOL]->SetDualTime_Geometry(geometry[val_iZone][val_iInst][iMesh], + solver[val_iZone][val_iInst][iMesh][MESH_SOL], + config[val_iZone], iMesh); + integration[val_iZone][val_iInst][HEAT_SOL]->SetConvergence(false); } } diff --git a/SU2_CFD/src/iteration/CIteration.cpp b/SU2_CFD/src/iteration/CIteration.cpp index b33b39131f92..d76b49ef187e 100644 --- a/SU2_CFD/src/iteration/CIteration.cpp +++ b/SU2_CFD/src/iteration/CIteration.cpp @@ -34,13 +34,8 @@ void CIteration::SetGrid_Movement(CGeometry** geometry, CSurfaceMovement* surfac CVolumetricMovement* grid_movement, CSolver*** solver, CConfig* config, unsigned long IntIter, unsigned long TimeIter) { unsigned short Kind_Grid_Movement = config->GetKind_GridMovement(); - unsigned long nIterMesh; - bool stat_mesh = true; bool adjoint = config->GetContinuous_Adjoint(); - /*--- Only write to screen if this option is enabled ---*/ - bool Screen_Output = config->GetDeform_Output(); - unsigned short val_iZone = config->GetiZone(); /*--- Perform mesh movement depending on specified type ---*/ @@ -120,32 +115,6 @@ void CIteration::SetGrid_Movement(CGeometry** geometry, CSurfaceMovement* surfac } } - if (config->GetSurface_Movement(FLUID_STRUCTURE)) { - if (rank == MASTER_NODE && Screen_Output) - cout << endl << "Deforming the grid for Fluid-Structure Interaction applications." << endl; - - /*--- Deform the volume grid around the new boundary locations ---*/ - - if (rank == MASTER_NODE && Screen_Output) cout << "Deforming the volume grid." << endl; - grid_movement->SetVolume_Deformation(geometry[MESH_0], config, true, false); - - nIterMesh = grid_movement->Get_nIterMesh(); - stat_mesh = (nIterMesh == 0); - - if (!adjoint && !stat_mesh) { - if (rank == MASTER_NODE && Screen_Output) cout << "Computing grid velocities by finite differencing." << endl; - geometry[MESH_0]->SetGridVelocity(config, TimeIter); - } else if (stat_mesh) { - if (rank == MASTER_NODE && Screen_Output) - cout << "The mesh is up-to-date. Using previously stored grid velocities." << endl; - } - - /*--- Update the multigrid structure after moving the finest grid, - including computing the grid velocities on the coarser levels. ---*/ - - grid_movement->UpdateMultiGrid(geometry, config); - } - if (config->GetSurface_Movement(EXTERNAL) || config->GetSurface_Movement(EXTERNAL_ROTATION)) { /*--- Apply rigid rotation to entire grid first, if necessary ---*/ diff --git a/SU2_CFD/src/iteration/CIterationFactory.cpp b/SU2_CFD/src/iteration/CIterationFactory.cpp index d55188cf2abc..e330c9434e60 100644 --- a/SU2_CFD/src/iteration/CIterationFactory.cpp +++ b/SU2_CFD/src/iteration/CIterationFactory.cpp @@ -112,7 +112,7 @@ CIteration* CIterationFactory::CreateIteration(ENUM_MAIN_SOLVER kindSolver, cons iteration = new CDiscAdjHeatIteration(config); break; - case NO_SOLVER: case FLUID_STRUCTURE_INTERACTION: case TEMPLATE_SOLVER: case MULTIPHYSICS: + case NO_SOLVER: case TEMPLATE_SOLVER: case MULTIPHYSICS: SU2_MPI::Error("No iteration found for specified solver.", CURRENT_FUNCTION); break; } diff --git a/SU2_CFD/src/numerics/turbulent/turb_sources.cpp b/SU2_CFD/src/numerics/turbulent/turb_sources.cpp index 7aa25cfaf276..0f6379ee9263 100644 --- a/SU2_CFD/src/numerics/turbulent/turb_sources.cpp +++ b/SU2_CFD/src/numerics/turbulent/turb_sources.cpp @@ -760,16 +760,19 @@ CSourcePieceWise_TurbSST::CSourcePieceWise_TurbSST(unsigned short val_nDim, incompressible = (config->GetKind_Regime() == INCOMPRESSIBLE); sustaining_terms = (config->GetKind_Turb_Model() == SST_SUST); + axisymmetric = config->GetAxisymmetric(); /*--- Closure constants ---*/ - beta_star = constants[6]; - sigma_omega_1 = constants[2]; - sigma_omega_2 = constants[3]; + sigma_k_1 = constants[0]; + sigma_k_2 = constants[1]; + sigma_w_1 = constants[2]; + sigma_w_2 = constants[3]; beta_1 = constants[4]; beta_2 = constants[5]; + beta_star = constants[6]; + a1 = constants[7]; alfa_1 = constants[8]; alfa_2 = constants[9]; - a1 = constants[7]; /*--- Set the ambient values of k and omega to the free stream values. ---*/ kAmb = val_kine_Inf; @@ -845,7 +848,6 @@ CNumerics::ResidualType<> CSourcePieceWise_TurbSST::ComputeResidual(const CConfi pk = Eddy_Viscosity_i*StrainMag_i*StrainMag_i - 2.0/3.0*Density_i*TurbVar_i[0]*diverg; } - pk = min(pk,20.0*beta_star*Density_i*TurbVar_i[1]*TurbVar_i[0]); pk = max(pk,0.0); @@ -889,6 +891,10 @@ CNumerics::ResidualType<> CSourcePieceWise_TurbSST::ComputeResidual(const CConfi /*--- Cross diffusion ---*/ Residual[1] += (1.0 - F1_i)*CDkw_i*Volume; + + /*--- Contribution due to 2D axisymmetric formulation ---*/ + + if (axisymmetric) ResidualAxisymmetric(alfa_blended,zeta); /*--- Implicit part ---*/ diff --git a/SU2_CFD/src/output/CFlowCompOutput.cpp b/SU2_CFD/src/output/CFlowCompOutput.cpp index 3b6f328b533f..14240f531057 100644 --- a/SU2_CFD/src/output/CFlowCompOutput.cpp +++ b/SU2_CFD/src/output/CFlowCompOutput.cpp @@ -279,9 +279,6 @@ void CFlowCompOutput::SetHistoryOutputFields(CConfig *config){ Add_CpInverseDesignOutput(config); - /*--- Add combo obj value --- */ - - AddHistoryOutput("COMBO", "ComboObj", ScreenOutputFormat::SCIENTIFIC, "COMBO", "Combined obj. function value.", HistoryFieldType::COEFFICIENT); } void CFlowCompOutput::SetVolumeOutputFields(CConfig *config){ @@ -718,10 +715,6 @@ void CFlowCompOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSol Set_CpInverseDesign(flow_solver, geometry, config); - /*--- Set combo obj value --- */ - - SetHistoryOutputValue("COMBO", flow_solver->GetTotal_ComboObj()); - } bool CFlowCompOutput::SetInit_Residuals(CConfig *config){ diff --git a/SU2_CFD/src/output/CFlowOutput.cpp b/SU2_CFD/src/output/CFlowOutput.cpp index e0b28799cf5e..4c33d0354a26 100644 --- a/SU2_CFD/src/output/CFlowOutput.cpp +++ b/SU2_CFD/src/output/CFlowOutput.cpp @@ -638,6 +638,8 @@ void CFlowOutput::AddAerodynamicCoefficients(CConfig *config){ /// DESCRIPTION: Angle of attack AddHistoryOutput("AOA", "AoA", ScreenOutputFormat::FIXED, "AOA", "Angle of attack"); + + AddHistoryOutput("COMBO", "ComboObj", ScreenOutputFormat::SCIENTIFIC, "COMBO", "Combined obj. function value.", HistoryFieldType::COEFFICIENT); } void CFlowOutput::SetAerodynamicCoefficients(CConfig *config, CSolver *flow_solver){ @@ -680,6 +682,8 @@ void CFlowOutput::SetAerodynamicCoefficients(CConfig *config, CSolver *flow_solv } SetHistoryOutputValue("AOA", config->GetAoA()); + + SetHistoryOutputValue("COMBO", flow_solver->GetTotal_ComboObj()); } void CFlowOutput::SetRotatingFrameCoefficients(CConfig *config, CSolver *flow_solver) { diff --git a/SU2_CFD/src/output/CNEMOCompOutput.cpp b/SU2_CFD/src/output/CNEMOCompOutput.cpp index 917823fa4fd4..43686451a968 100644 --- a/SU2_CFD/src/output/CNEMOCompOutput.cpp +++ b/SU2_CFD/src/output/CNEMOCompOutput.cpp @@ -279,9 +279,6 @@ void CNEMOCompOutput::SetHistoryOutputFields(CConfig *config){ Add_CpInverseDesignOutput(config); - /*--- Add combo obj value --- */ - - AddHistoryOutput("COMBO", "ComboObj", ScreenOutputFormat::SCIENTIFIC, "COMBO", "Combined obj. function value.", HistoryFieldType::COEFFICIENT); } void CNEMOCompOutput::SetVolumeOutputFields(CConfig *config){ @@ -686,10 +683,6 @@ void CNEMOCompOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSol Set_CpInverseDesign(NEMO_solver, geometry, config); - /*--- Set combo obj value --- */ - - SetHistoryOutputValue("COMBO", NEMO_solver->GetTotal_ComboObj()); - } bool CNEMOCompOutput::SetInit_Residuals(CConfig *config){ diff --git a/SU2_CFD/src/python_wrapper_structure.cpp b/SU2_CFD/src/python_wrapper_structure.cpp index fde9093bc583..ebf9a926d5d2 100644 --- a/SU2_CFD/src/python_wrapper_structure.cpp +++ b/SU2_CFD/src/python_wrapper_structure.cpp @@ -33,10 +33,7 @@ void CDriver::PythonInterface_Preprocessing(CConfig **config, CGeometry ****geometry, CSolver *****solver){ int rank = MASTER_NODE; - -#ifdef HAVE_MPI - MPI_Comm_rank(SU2_MPI::GetComm(), &rank); -#endif + SU2_MPI::Comm_rank(SU2_MPI::GetComm(), &rank); /* --- Initialize boundary conditions customization, this is achieve through the Python wrapper --- */ for(iZone=0; iZone < nZone; iZone++){ @@ -59,39 +56,21 @@ void CDriver::PythonInterface_Preprocessing(CConfig **config, CGeometry ****geom } } } - /*--- Initialize some variables used for external communications trough the Py wrapper. ---*/ - PyWrapVarCoord[0] = 0.0; - PyWrapVarCoord[1] = 0.0; - PyWrapVarCoord[2] = 0.0; - PyWrapNodalForce[0] = 0.0; - PyWrapNodalForce[1] = 0.0; - PyWrapNodalForce[2] = 0.0; - PyWrapNodalForceDensity[0] = 0.0; - PyWrapNodalForceDensity[1] = 0.0; - PyWrapNodalForceDensity[2] = 0.0; - PyWrapNodalHeatFlux[0] = 0.0; - PyWrapNodalHeatFlux[1] = 0.0; - PyWrapNodalHeatFlux[2] = 0.0; } -passivedouble CDriver::Get_Drag() { +///////////////////////////////////////////////////////////////////////////// +/* Functions related to the global performance indices (Lift, Drag, ecc..) */ +///////////////////////////////////////////////////////////////////////////// + +passivedouble CDriver::Get_Drag() const { unsigned short val_iZone = ZONE_0; unsigned short FinestMesh = config_container[val_iZone]->GetFinestMesh(); - su2double CDrag, RefDensity, RefArea, RefVel2, factor, val_Drag; - - /*--- Export free-stream density and reference area ---*/ - RefDensity = solver_container[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetDensity_Inf(); - RefArea = config_container[val_iZone]->GetRefArea(); - - /*--- Calculate free-stream velocity (squared) ---*/ - RefVel2 = 0.0; - for(unsigned short iDim = 0; iDim < nDim; iDim++) - RefVel2 += pow(solver_container[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetVelocity_Inf(iDim),2); + su2double CDrag, factor, val_Drag; /*--- Calculate drag force based on drag coefficient ---*/ - factor = 0.5*RefDensity*RefArea*RefVel2; + factor = solver_container[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetAeroCoeffsReferenceForce(); CDrag = solver_container[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetTotal_CD(); val_Drag = CDrag*factor; @@ -99,23 +78,14 @@ passivedouble CDriver::Get_Drag() { return SU2_TYPE::GetValue(val_Drag); } -passivedouble CDriver::Get_Lift() { +passivedouble CDriver::Get_Lift() const { unsigned short val_iZone = ZONE_0; unsigned short FinestMesh = config_container[val_iZone]->GetFinestMesh(); - su2double CLift, RefDensity, RefArea, RefVel2, factor, val_Lift; - - /*--- Export free-stream density and reference area ---*/ - RefDensity = solver_container[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetDensity_Inf(); - RefArea = config_container[val_iZone]->GetRefArea(); - - /*--- Calculate free-stream velocity (squared) ---*/ - RefVel2 = 0.0; - for(unsigned short iDim = 0; iDim < nDim; iDim++) - RefVel2 += pow(solver_container[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetVelocity_Inf(iDim),2); + su2double CLift, factor, val_Lift; /*--- Calculate drag force based on drag coefficient ---*/ - factor = 0.5*RefDensity*RefArea*RefVel2; + factor = solver_container[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetAeroCoeffsReferenceForce(); CLift = solver_container[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetTotal_CL(); val_Lift = CLift*factor; @@ -123,137 +93,90 @@ passivedouble CDriver::Get_Lift() { return SU2_TYPE::GetValue(val_Lift); } -passivedouble CDriver::Get_Mx(){ +passivedouble CDriver::Get_Mx() const { unsigned short val_iZone = ZONE_0; unsigned short FinestMesh = config_container[val_iZone]->GetFinestMesh(); - su2double CMx, RefDensity, RefArea, RefLengthCoeff, RefVel2, factor, val_Mx; + su2double CMx, RefLengthCoeff, factor, val_Mx; - /*--- Export free-stream density and reference area ---*/ - RefDensity = solver_container[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetDensity_Inf(); - RefArea = config_container[val_iZone]->GetRefArea(); RefLengthCoeff = config_container[val_iZone]->GetRefLength(); - /*--- Calculate free-stream velocity (squared) ---*/ - RefVel2 = 0.0; - for (unsigned short iDim = 0; iDim < nDim; iDim++) - RefVel2 += pow(solver_container[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetVelocity_Inf(iDim),2); - /*--- Calculate moment around x-axis based on coefficients ---*/ - factor = 0.5*RefDensity*RefArea*RefVel2; + factor = solver_container[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetAeroCoeffsReferenceForce(); CMx = solver_container[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetTotal_CMx(); val_Mx = CMx*factor*RefLengthCoeff; return SU2_TYPE::GetValue(val_Mx); - } -passivedouble CDriver::Get_My(){ +passivedouble CDriver::Get_My() const { unsigned short val_iZone = ZONE_0; unsigned short FinestMesh = config_container[val_iZone]->GetFinestMesh(); - su2double CMy, RefDensity, RefArea, RefLengthCoeff, RefVel2, factor, val_My; + su2double CMy, RefLengthCoeff, factor, val_My; - /*--- Export free-stream density and reference area ---*/ - RefDensity = solver_container[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetDensity_Inf(); - RefArea = config_container[val_iZone]->GetRefArea(); RefLengthCoeff = config_container[val_iZone]->GetRefLength(); - /*--- Calculate free-stream velocity (squared) ---*/ - RefVel2 = 0.0; - for (unsigned short iDim = 0; iDim < nDim; iDim++) - RefVel2 += pow(solver_container[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetVelocity_Inf(iDim),2); - /*--- Calculate moment around x-axis based on coefficients ---*/ - factor = 0.5*RefDensity*RefArea*RefVel2; + factor = solver_container[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetAeroCoeffsReferenceForce(); CMy = solver_container[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetTotal_CMy(); val_My = CMy*factor*RefLengthCoeff; return SU2_TYPE::GetValue(val_My); - } -passivedouble CDriver::Get_Mz() { +passivedouble CDriver::Get_Mz() const { unsigned short val_iZone = ZONE_0; unsigned short FinestMesh = config_container[val_iZone]->GetFinestMesh(); - su2double CMz, RefDensity, RefArea, RefLengthCoeff, RefVel2, factor, val_Mz; + su2double CMz, RefLengthCoeff, factor, val_Mz; - /*--- Export free-stream density and reference area ---*/ - RefDensity = solver_container[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetDensity_Inf(); - RefArea = config_container[val_iZone]->GetRefArea(); RefLengthCoeff = config_container[val_iZone]->GetRefLength(); - /*--- Calculate free-stream velocity (squared) ---*/ - RefVel2 = 0.0; - for(unsigned short iDim = 0; iDim < nDim; iDim++) - RefVel2 += pow(solver_container[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetVelocity_Inf(iDim),2); - /*--- Calculate moment around z-axis based on coefficients ---*/ - factor = 0.5*RefDensity*RefArea*RefVel2; + factor = solver_container[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetAeroCoeffsReferenceForce(); CMz = solver_container[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetTotal_CMz(); val_Mz = CMz*factor*RefLengthCoeff; return SU2_TYPE::GetValue(val_Mz); - } -passivedouble CDriver::Get_DragCoeff() { +passivedouble CDriver::Get_DragCoeff() const { - unsigned short val_iZone = ZONE_0; - unsigned short FinestMesh = config_container[val_iZone]->GetFinestMesh(); - su2double CDrag; + unsigned short val_iZone = ZONE_0; + unsigned short FinestMesh = config_container[val_iZone]->GetFinestMesh(); + su2double CDrag; - CDrag = solver_container[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetTotal_CD(); + CDrag = solver_container[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetTotal_CD(); - return SU2_TYPE::GetValue(CDrag); + return SU2_TYPE::GetValue(CDrag); } -passivedouble CDriver::Get_LiftCoeff() { +passivedouble CDriver::Get_LiftCoeff() const { - unsigned short val_iZone = ZONE_0; - unsigned short FinestMesh = config_container[val_iZone]->GetFinestMesh(); - su2double CLift; + unsigned short val_iZone = ZONE_0; + unsigned short FinestMesh = config_container[val_iZone]->GetFinestMesh(); + su2double CLift; - CLift = solver_container[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetTotal_CL(); + CLift = solver_container[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetTotal_CL(); - return SU2_TYPE::GetValue(CLift); + return SU2_TYPE::GetValue(CLift); } -unsigned short CDriver::GetMovingMarker() { - - unsigned short IDtoSend,iMarker, jMarker, Moving; - string Marker_Tag, Moving_Tag; - - IDtoSend = 0; - for (iMarker = 0; iMarker < config_container[ZONE_0]->GetnMarker_All(); iMarker++) { - Moving = config_container[ZONE_0]->GetMarker_All_Moving(iMarker); - if (Moving == YES) { - for (jMarker = 0; jMarkerGetnMarker_Moving(); jMarker++) { - Moving_Tag = config_container[ZONE_0]->GetMarker_Moving_TagBound(jMarker); - Marker_Tag = config_container[ZONE_0]->GetMarker_All_TagBound(iMarker); - if (Marker_Tag == Moving_Tag) { - IDtoSend = iMarker; - break; - } - } - } - } - - return IDtoSend; - -} +///////////////////////////////////////////////////////////////////////////// +/* Functions to obtain information from the geometry/mesh */ +///////////////////////////////////////////////////////////////////////////// -unsigned long CDriver::GetNumberVertices(unsigned short iMarker){ +unsigned long CDriver::GetNumberVertices(unsigned short iMarker) const { return geometry_container[ZONE_0][INST_0][MESH_0]->nVertex[iMarker]; } -unsigned long CDriver::GetNumberHaloVertices(unsigned short iMarker){ +unsigned long CDriver::GetNumberHaloVertices(unsigned short iMarker) const { unsigned long nHaloVertices, iVertex, iPoint; @@ -267,7 +190,7 @@ unsigned long CDriver::GetNumberHaloVertices(unsigned short iMarker){ } -unsigned long CDriver::GetVertexGlobalIndex(unsigned short iMarker, unsigned long iVertex) { +unsigned long CDriver::GetVertexGlobalIndex(unsigned short iMarker, unsigned long iVertex) const { unsigned long iPoint, GlobalIndex; @@ -278,7 +201,7 @@ unsigned long CDriver::GetVertexGlobalIndex(unsigned short iMarker, unsigned lon } -bool CDriver::IsAHaloNode(unsigned short iMarker, unsigned long iVertex) { +bool CDriver::IsAHaloNode(unsigned short iMarker, unsigned long iVertex) const { unsigned long iPoint; @@ -288,212 +211,69 @@ bool CDriver::IsAHaloNode(unsigned short iMarker, unsigned long iVertex) { } -unsigned long CDriver::GetnTimeIter() { - - return config_container[ZONE_0]->GetnTime_Iter(); -} - -unsigned long CDriver::GetTime_Iter() const{ - - return TimeIter; -} - -passivedouble CDriver::GetUnsteady_TimeStep(){ - - return SU2_TYPE::GetValue(config_container[ZONE_0]->GetTime_Step()); -} - -passivedouble CDriver::GetVertexCoordX(unsigned short iMarker, unsigned long iVertex) { - - su2double* Coord; - unsigned long iPoint; - - iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); - Coord = geometry_container[ZONE_0][INST_0][MESH_0]->nodes->GetCoord(iPoint); - return SU2_TYPE::GetValue(Coord[0]); - -} - -passivedouble CDriver::GetVertexCoordY(unsigned short iMarker, unsigned long iVertex) { - - su2double* Coord; - unsigned long iPoint; - - iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); - Coord = geometry_container[ZONE_0][INST_0][MESH_0]->nodes->GetCoord(iPoint); - return SU2_TYPE::GetValue(Coord[1]); -} +vector CDriver::GetInitialMeshCoord(unsigned short iMarker, unsigned long iVertex) const { -passivedouble CDriver::GetVertexCoordZ(unsigned short iMarker, unsigned long iVertex) { + vector coord(3,0.0); + vector coord_passive(3, 0.0); - su2double* Coord; - unsigned long iPoint; - - if(nDim == 3) { - iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); - Coord = geometry_container[ZONE_0][INST_0][MESH_0]->nodes->GetCoord(iPoint); - return SU2_TYPE::GetValue(Coord[2]); + auto iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); + for (auto iDim = 0 ; iDim < nDim ; iDim++){ + coord[iDim] = solver_container[ZONE_0][INST_0][MESH_0][MESH_SOL]->GetNodes()->GetMesh_Coord(iPoint,iDim); } - else { - return 0.0; - } - -} - -bool CDriver::ComputeVertexForces(unsigned short iMarker, unsigned long iVertex) { - - unsigned long iPoint; - unsigned short iDim, jDim; - su2double *Normal, AreaSquare, Area; - bool halo; - - unsigned short FinestMesh = config_container[ZONE_0]->GetFinestMesh(); - - /*--- Check the kind of fluid problem ---*/ - bool compressible = (config_container[ZONE_0]->GetKind_Regime() == COMPRESSIBLE); - bool incompressible = (config_container[ZONE_0]->GetKind_Regime() == INCOMPRESSIBLE); - bool viscous_flow = ((config_container[ZONE_0]->GetKind_Solver() == NAVIER_STOKES) || - (config_container[ZONE_0]->GetKind_Solver() == RANS) ); - - /*--- Parameters for the calculations ---*/ - // Pn: Pressure - // Pinf: Pressure_infinite - su2double Pn = 0.0; - su2double Viscosity = 0.0; - su2double Tau[3][3] = {{0.0}}; - su2double Pinf = solver_container[ZONE_0][INST_0][MESH_0][FLOW_SOL]->GetPressure_Inf(); - - iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); - - /*--- It is necessary to distinguish the halo nodes from the others, since they introduce non physical forces. ---*/ - if(geometry_container[ZONE_0][INST_0][MESH_0]->nodes->GetDomain(iPoint)) { - /*--- Get the normal at the vertex: this normal goes inside the fluid domain. ---*/ - Normal = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNormal(); - AreaSquare = 0.0; - for(iDim = 0; iDim < nDim; iDim++) { - AreaSquare += Normal[iDim]*Normal[iDim]; - } - Area = sqrt(AreaSquare); - - /*--- Get the values of pressure and viscosity ---*/ - Pn = solver_container[ZONE_0][INST_0][MESH_0][FLOW_SOL]->GetNodes()->GetPressure(iPoint); - if (viscous_flow) { - Viscosity = solver_container[ZONE_0][INST_0][MESH_0][FLOW_SOL]->GetNodes()->GetLaminarViscosity(iPoint); - } - - /*--- Calculate the inviscid (pressure) part of tn in the fluid nodes (force units) ---*/ - for (iDim = 0; iDim < nDim; iDim++) { - PyWrapNodalForce[iDim] = -(Pn-Pinf)*Normal[iDim]; //NB : norm(Normal) = Area - } - - /*--- Calculate the viscous (shear stress) part of tn in the fluid nodes (force units) ---*/ - if ((incompressible || compressible) && viscous_flow) { - CNumerics::ComputeStressTensor(nDim, Tau, - solver_container[ZONE_0][INST_0][FinestMesh][FLOW_SOL]->GetNodes()->GetGradient_Primitive(iPoint)+1, Viscosity); - for (iDim = 0; iDim < nDim; iDim++) { - for (jDim = 0 ; jDim < nDim; jDim++) { - PyWrapNodalForce[iDim] += Tau[iDim][jDim]*Normal[jDim]; - } - } - } - - //Divide by local are in case of force density communication. - for(iDim = 0; iDim < nDim; iDim++) { - PyWrapNodalForceDensity[iDim] = PyWrapNodalForce[iDim]/Area; - } - - halo = false; - } - else { - halo = true; - } - - return halo; + coord_passive[0] = SU2_TYPE::GetValue(coord[0]); + coord_passive[1] = SU2_TYPE::GetValue(coord[1]); + coord_passive[2] = SU2_TYPE::GetValue(coord[2]); + return coord_passive; } -passivedouble CDriver::GetVertexForceX(unsigned short iMarker, unsigned long iVertex) { +vector CDriver::GetVertexUnitNormal(unsigned short iMarker, unsigned long iVertex) const { - return SU2_TYPE::GetValue(PyWrapNodalForce[0]); - -} - -passivedouble CDriver::GetVertexForceY(unsigned short iMarker, unsigned long iVertex) { - - return SU2_TYPE::GetValue(PyWrapNodalForce[1]); - -} - -passivedouble CDriver::GetVertexForceZ(unsigned short iMarker, unsigned long iVertex) { + su2double *Normal; + su2double Area; + vector ret_Normal(3, 0.0); + vector ret_Normal_passive(3, 0.0); - return SU2_TYPE::GetValue(PyWrapNodalForce[2]); + Normal = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNormal(); -} + Area = GeometryToolbox::Norm(nDim, Normal); -passivedouble CDriver::GetVertexForceDensityX(unsigned short iMarker, unsigned long iVertex) { - return SU2_TYPE::GetValue(PyWrapNodalForceDensity[0]); -} + ret_Normal[0] = Normal[0]/Area; + ret_Normal[1] = Normal[1]/Area; + if(nDim>2) ret_Normal[2] = Normal[2]/Area; -passivedouble CDriver::GetVertexForceDensityY(unsigned short iMarker, unsigned long iVertex) { - return SU2_TYPE::GetValue(PyWrapNodalForceDensity[1]); -} + ret_Normal_passive[0] = SU2_TYPE::GetValue(ret_Normal[0]); + ret_Normal_passive[1] = SU2_TYPE::GetValue(ret_Normal[1]); + ret_Normal_passive[2] = SU2_TYPE::GetValue(ret_Normal[2]); -passivedouble CDriver::GetVertexForceDensityZ(unsigned short iMarker, unsigned long iVertex) { - return SU2_TYPE::GetValue(PyWrapNodalForceDensity[2]); + return ret_Normal_passive; } -void CDriver::SetVertexCoordX(unsigned short iMarker, unsigned long iVertex, passivedouble newPosX) { +////////////////////////////////////////////////////////////////////////////////// +/* Functions to obtain global parameters from SU2 (time steps, delta t, ecc...) */ +////////////////////////////////////////////////////////////////////////////////// - unsigned long iPoint; - su2double *Coord; - - iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); - Coord = geometry_container[ZONE_0][INST_0][MESH_0]->nodes->GetCoord(iPoint); - - PyWrapVarCoord[0] = newPosX - Coord[0]; +unsigned long CDriver::GetnTimeIter() const { + return config_container[ZONE_0]->GetnTime_Iter(); } -void CDriver::SetVertexCoordY(unsigned short iMarker, unsigned long iVertex, passivedouble newPosY) { - - unsigned long iPoint; - su2double *Coord; - - iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); - Coord = geometry_container[ZONE_0][INST_0][MESH_0]->nodes->GetCoord(iPoint); +unsigned long CDriver::GetTime_Iter() const{ - PyWrapVarCoord[1] = newPosY - Coord[1]; + return TimeIter; } -void CDriver::SetVertexCoordZ(unsigned short iMarker, unsigned long iVertex, passivedouble newPosZ) { - - unsigned long iPoint; - su2double *Coord; - - iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); - Coord = geometry_container[ZONE_0][INST_0][MESH_0]->nodes->GetCoord(iPoint); +passivedouble CDriver::GetUnsteady_TimeStep() const { - if(nDim > 2) { - PyWrapVarCoord[2] = newPosZ - Coord[2]; - } - else { - PyWrapVarCoord[2] = 0.0; - } + return SU2_TYPE::GetValue(config_container[ZONE_0]->GetTime_Step()); } -passivedouble CDriver::SetVertexVarCoord(unsigned short iMarker, unsigned long iVertex) { - - su2double nodalVarCoordNorm; +/////////////////////////////////////////////////////////////////////////////// +/* Functions related to CHT solver */ +/////////////////////////////////////////////////////////////////////////////// - geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->SetVarCoord(PyWrapVarCoord); - nodalVarCoordNorm = sqrt((PyWrapVarCoord[0])*(PyWrapVarCoord[0]) + (PyWrapVarCoord[1])*(PyWrapVarCoord[1]) + (PyWrapVarCoord[2])*(PyWrapVarCoord[2])); - - return SU2_TYPE::GetValue(nodalVarCoordNorm); - -} - -passivedouble CDriver::GetVertexTemperature(unsigned short iMarker, unsigned long iVertex){ +passivedouble CDriver::GetVertexTemperature(unsigned short iMarker, unsigned long iVertex) const { unsigned long iPoint; su2double vertexWallTemp(0.0); @@ -515,7 +295,7 @@ void CDriver::SetVertexTemperature(unsigned short iMarker, unsigned long iVertex geometry_container[ZONE_0][INST_0][MESH_0]->SetCustomBoundaryTemperature(iMarker, iVertex, val_WallTemp); } -bool CDriver::ComputeVertexHeatFluxes(unsigned short iMarker, unsigned long iVertex){ +vector CDriver::GetVertexHeatFluxes(unsigned short iMarker, unsigned long iVertex) const { unsigned long iPoint; unsigned short iDim; @@ -525,48 +305,31 @@ bool CDriver::ComputeVertexHeatFluxes(unsigned short iMarker, unsigned long iVer su2double Gamma_Minus_One = Gamma - 1.0; su2double Cp = (Gamma / Gamma_Minus_One) * Gas_Constant; su2double laminar_viscosity, thermal_conductivity; - su2double GradT[3] = {0.0,0.0,0.0}; + vector GradT (3,0.0); + vector HeatFlux (3,0.0); + vector HeatFluxPassive (3,0.0); bool compressible = (config_container[ZONE_0]->GetKind_Regime() == COMPRESSIBLE); - bool halo; iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); - if(geometry_container[ZONE_0][INST_0][MESH_0]->nodes->GetDomain(iPoint)){ - halo = false; - } - else{ - halo = true; - } - - if(!halo && compressible){ + if(compressible){ laminar_viscosity = solver_container[ZONE_0][INST_0][MESH_0][FLOW_SOL]->GetNodes()->GetLaminarViscosity(iPoint); thermal_conductivity = Cp * (laminar_viscosity/Prandtl_Lam); for(iDim=0; iDim < nDim; iDim++){ GradT[iDim] = solver_container[ZONE_0][INST_0][MESH_0][FLOW_SOL]->GetNodes()->GetGradient_Primitive(iPoint, 0, iDim); - PyWrapNodalHeatFlux[iDim] = -thermal_conductivity*GradT[iDim]; + HeatFlux[iDim] = -thermal_conductivity*GradT[iDim]; } } - return halo; -} - -passivedouble CDriver::GetVertexHeatFluxX(unsigned short iMarker, unsigned long iVertex){ - - return SU2_TYPE::GetValue(PyWrapNodalHeatFlux[0]); -} - -passivedouble CDriver::GetVertexHeatFluxY(unsigned short iMarker, unsigned long iVertex){ + HeatFluxPassive[0] = SU2_TYPE::GetValue(HeatFlux[0]); + HeatFluxPassive[1] = SU2_TYPE::GetValue(HeatFlux[1]); + HeatFluxPassive[2] = SU2_TYPE::GetValue(HeatFlux[2]); - return SU2_TYPE::GetValue(PyWrapNodalHeatFlux[1]); + return HeatFluxPassive; } -passivedouble CDriver::GetVertexHeatFluxZ(unsigned short iMarker, unsigned long iVertex){ - - return SU2_TYPE::GetValue(PyWrapNodalHeatFlux[2]); -} - -passivedouble CDriver::GetVertexNormalHeatFlux(unsigned short iMarker, unsigned long iVertex){ +passivedouble CDriver::GetVertexNormalHeatFlux(unsigned short iMarker, unsigned long iVertex) const{ unsigned long iPoint; unsigned short iDim; @@ -614,7 +377,7 @@ void CDriver::SetVertexNormalHeatFlux(unsigned short iMarker, unsigned long iVer geometry_container[ZONE_0][INST_0][MESH_0]->SetCustomBoundaryHeatFlux(iMarker, iVertex, val_WallHeatFlux); } -passivedouble CDriver::GetThermalConductivity(unsigned short iMarker, unsigned long iVertex){ +passivedouble CDriver::GetThermalConductivity(unsigned short iMarker, unsigned long iVertex) const { unsigned long iPoint; su2double Prandtl_Lam = config_container[ZONE_0]->GetPrandtl_Lam(); @@ -632,31 +395,11 @@ passivedouble CDriver::GetThermalConductivity(unsigned short iMarker, unsigned l } -vector CDriver::GetVertexUnitNormal(unsigned short iMarker, unsigned long iVertex){ - - su2double *Normal; - su2double Area; - vector ret_Normal(3, 0.0); - vector ret_Normal_passive(3, 0.0); - - Normal = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNormal(); +//////////////////////////////////////////////////////////////////////////////// +/* Functions related to the management of markers */ +//////////////////////////////////////////////////////////////////////////////// - Area = GeometryToolbox::Norm(nDim, Normal); - - ret_Normal[0] = Normal[0]/Area; - ret_Normal[1] = Normal[1]/Area; - if(nDim>2) ret_Normal[2] = Normal[2]/Area; - - ret_Normal_passive[0] = SU2_TYPE::GetValue(ret_Normal[0]); - ret_Normal_passive[1] = SU2_TYPE::GetValue(ret_Normal[1]); - ret_Normal_passive[2] = SU2_TYPE::GetValue(ret_Normal[2]); - - return ret_Normal_passive; - - -} - -vector CDriver::GetAllBoundaryMarkersTag(){ +vector CDriver::GetAllBoundaryMarkersTag() const { vector boundariesTagList; unsigned short iMarker,nBoundariesMarkers; @@ -673,24 +416,7 @@ vector CDriver::GetAllBoundaryMarkersTag(){ return boundariesTagList; } -vector CDriver::GetAllMovingMarkersTag(){ - - vector movingBoundariesTagList; - unsigned short iMarker, nBoundariesMarker; - string Marker_Tag; - - nBoundariesMarker = config_container[ZONE_0]->GetnMarker_Moving(); - movingBoundariesTagList.resize(nBoundariesMarker); - - for(iMarker=0; iMarker < nBoundariesMarker; iMarker++){ - Marker_Tag = config_container[ZONE_0]->GetMarker_Moving_TagBound(iMarker); - movingBoundariesTagList[iMarker] = Marker_Tag; - } - - return movingBoundariesTagList; -} - -vector CDriver::GetAllDeformMeshMarkersTag(){ +vector CDriver::GetAllDeformMeshMarkersTag() const { vector interfaceBoundariesTagList; unsigned short iMarker, nBoundariesMarker; @@ -707,31 +433,13 @@ vector CDriver::GetAllDeformMeshMarkersTag(){ return interfaceBoundariesTagList; } -vector CDriver::GetAllFluidLoadMarkersTag(){ - - vector interfaceBoundariesTagList; - unsigned short iMarker, nBoundariesMarker; - string Marker_Tag; - - nBoundariesMarker = config_container[ZONE_0]->GetnMarker_Fluid_Load(); - interfaceBoundariesTagList.resize(nBoundariesMarker); - - for(iMarker=0; iMarker < nBoundariesMarker; iMarker++){ - Marker_Tag = config_container[ZONE_0]->GetMarker_Fluid_Load_TagBound(iMarker); - interfaceBoundariesTagList[iMarker] = Marker_Tag; - } - - return interfaceBoundariesTagList; -} - -vector CDriver::GetAllCHTMarkersTag(){ +vector CDriver::GetAllCHTMarkersTag() const { vector CHTBoundariesTagList; unsigned short iMarker, nBoundariesMarker; string Marker_Tag; nBoundariesMarker = config_container[ZONE_0]->GetnMarker_All(); - //CHTBoundariesTagList.resize(nBoundariesMarker); //The CHT markers can be identified as the markers that are customizable with a BC type HEAT_FLUX or ISOTHERMAL. for(iMarker=0; iMarker CDriver::GetAllCHTMarkersTag(){ return CHTBoundariesTagList; } -vector CDriver::GetAllInletMarkersTag(){ +vector CDriver::GetAllInletMarkersTag() const { vector BoundariesTagList; unsigned short iMarker, nBoundariesMarker; @@ -764,7 +472,7 @@ vector CDriver::GetAllInletMarkersTag(){ return BoundariesTagList; } -map CDriver::GetAllBoundaryMarkers(){ +map CDriver::GetAllBoundaryMarkers() const { map allBoundariesMap; unsigned short iMarker, nBoundaryMarkers; @@ -780,7 +488,7 @@ map CDriver::GetAllBoundaryMarkers(){ return allBoundariesMap; } -map CDriver::GetAllBoundaryMarkersType(){ +map CDriver::GetAllBoundaryMarkersType() const { map allBoundariesTypeMap; unsigned short iMarker, KindBC; @@ -823,6 +531,34 @@ map CDriver::GetAllBoundaryMarkersType(){ return allBoundariesTypeMap; } +void CDriver::SetHeatSource_Position(passivedouble alpha, passivedouble pos_x, passivedouble pos_y, passivedouble pos_z){ + + CSolver *solver = solver_container[ZONE_0][INST_0][MESH_0][RAD_SOL]; + + config_container[ZONE_0]->SetHeatSource_Rot_Z(alpha); + config_container[ZONE_0]->SetHeatSource_Center(pos_x, pos_y, pos_z); + + solver->SetVolumetricHeatSource(geometry_container[ZONE_0][INST_0][MESH_0], config_container[ZONE_0]); + +} + +void CDriver::SetInlet_Angle(unsigned short iMarker, passivedouble alpha){ + + su2double alpha_rad = alpha * PI_NUMBER/180.0; + + unsigned long iVertex; + + for (iVertex = 0; iVertex < geometry_container[ZONE_0][INST_0][MESH_0]->nVertex[iMarker]; iVertex++){ + solver_container[ZONE_0][INST_0][MESH_0][FLOW_SOL]->SetInlet_FlowDir(iMarker, iVertex, 0, cos(alpha_rad)); + solver_container[ZONE_0][INST_0][MESH_0][FLOW_SOL]->SetInlet_FlowDir(iMarker, iVertex, 1, sin(alpha_rad)); + } + +} + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/* Functions related to simulation control, high level functions (reset convergence, set initial mesh, ecc...) */ +///////////////////////////////////////////////////////////////////////////////////////////////////////////////// + void CDriver::ResetConvergence() { for(iZone = 0; iZone < nZone; iZone++) { @@ -850,44 +586,6 @@ void CDriver::ResetConvergence() { } -void CFluidDriver::StaticMeshUpdate() { - - int rank = MASTER_NODE; - -#ifdef HAVE_MPI - MPI_Comm_rank(SU2_MPI::GetComm(), &rank); -#endif - - for(iZone = 0; iZone < nZone; iZone++) { - if(rank == MASTER_NODE) cout << " Deforming the volume grid." << endl; - grid_movement[iZone][INST_0]->SetVolume_Deformation(geometry_container[iZone][INST_0][MESH_0], config_container[iZone], true); - - if(rank == MASTER_NODE) cout << "No grid velocity to be computde : static grid deformation." << endl; - - if(rank == MASTER_NODE) cout << " Updating multigrid structure." << endl; - grid_movement[iZone][INST_0]->UpdateMultiGrid(geometry_container[iZone][INST_0], config_container[iZone]); - } -} - -void CFluidDriver::SetInitialMesh() { - - StaticMeshUpdate(); - - /*--- Propagate the initial deformation to the past ---*/ - //if (!restart) { - for(iZone = 0; iZone < nZone; iZone++) { - for (iMesh = 0; iMesh <= config_container[iZone]->GetnMGLevels(); iMesh++) { - //solver_container[iZone][iMesh][FLOW_SOL]->nodes->Set_Solution_time_n(iPoint); - //solver_container[iZone][iMesh][FLOW_SOL]->nodes->Set_Solution_time_n1(iPoint); - geometry_container[iZone][INST_0][iMesh]->nodes->SetVolume_n(); - geometry_container[iZone][INST_0][iMesh]->nodes->SetVolume_nM1(); - geometry_container[iZone][INST_0][iMesh]->nodes->SetCoord_n(); - geometry_container[iZone][INST_0][iMesh]->nodes->SetCoord_n1(); - } - } - //} -} - void CSinglezoneDriver::SetInitialMesh() { DynamicMeshUpdate(0); @@ -914,52 +612,12 @@ void CSinglezoneDriver::SetInitialMesh() { } } -void CFluidDriver::SetVertexTtotal(unsigned short iMarker, unsigned long iVertex, passivedouble val_Ttotal_passive){ - - su2double val_Ttotal = val_Ttotal_passive; - - solver_container[ZONE_0][INST_0][MESH_0][FLOW_SOL]->SetInlet_Ttotal(iMarker, iVertex, val_Ttotal); - -} - -void CFluidDriver::SetVertexPtotal(unsigned short iMarker, unsigned long iVertex, passivedouble val_Ptotal_passive){ - - su2double val_Ptotal = val_Ptotal_passive; - - solver_container[ZONE_0][INST_0][MESH_0][FLOW_SOL]->SetInlet_Ptotal(iMarker, iVertex, val_Ptotal); - -} - -void CFluidDriver::SetVertexFlowDir(unsigned short iMarker, unsigned long iVertex, unsigned short iDim, passivedouble val_FlowDir_passive){ - - su2double val_FlowDir = val_FlowDir_passive; - - solver_container[ZONE_0][INST_0][MESH_0][FLOW_SOL]->SetInlet_FlowDir(iMarker, iVertex, iDim, val_FlowDir); - -} - -void CFluidDriver::SetVertexTurbVar(unsigned short iMarker, unsigned long iVertex, unsigned short iDim, passivedouble val_turb_var_passive){ - - su2double val_turb_var = val_turb_var_passive; - - if (solver_container[ZONE_0][INST_0] == nullptr || - solver_container[ZONE_0][INST_0][MESH_0] == nullptr) { - SU2_MPI::Error("Could not find an appropriate solver.", CURRENT_FUNCTION); - } else if (solver_container[ZONE_0][INST_0][MESH_0][TURB_SOL] == nullptr) { - SU2_MPI::Error("Tried to set turbulence variables without a turbulence solver.", CURRENT_FUNCTION); - } - solver_container[ZONE_0][INST_0][MESH_0][TURB_SOL]->SetInlet_TurbVar(iMarker, iVertex, iDim, val_turb_var); - -} - -void CFluidDriver::BoundaryConditionsUpdate(){ +void CDriver::BoundaryConditionsUpdate(){ int rank = MASTER_NODE; unsigned short iZone; -#ifdef HAVE_MPI - MPI_Comm_rank(SU2_MPI::GetComm(), &rank); -#endif + SU2_MPI::Comm_rank(SU2_MPI::GetComm(), &rank); if(rank == MASTER_NODE) cout << "Updating boundary conditions." << endl; for(iZone = 0; iZone < nZone; iZone++){ @@ -967,67 +625,25 @@ void CFluidDriver::BoundaryConditionsUpdate(){ } } -void CDriver::SetMeshDisplacement(unsigned short iMarker, unsigned long iVertex, passivedouble DispX, passivedouble DispY, passivedouble DispZ) { - - unsigned long iPoint; - PyWrapVarCoord[0] = DispX; - PyWrapVarCoord[1] = DispY; - PyWrapVarCoord[2] = DispZ; - - iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); - - solver_container[ZONE_0][INST_0][MESH_0][MESH_SOL]->GetNodes()->SetBound_Disp(iPoint,PyWrapVarCoord); - -} - -void CDriver::CommunicateMeshDisplacement(void) { - - solver_container[ZONE_0][INST_0][MESH_0][MESH_SOL]->InitiateComms(geometry_container[ZONE_0][INST_0][MESH_0], - config_container[ZONE_0], MESH_DISPLACEMENTS); - solver_container[ZONE_0][INST_0][MESH_0][MESH_SOL]->CompleteComms(geometry_container[ZONE_0][INST_0][MESH_0], - config_container[ZONE_0], MESH_DISPLACEMENTS); - -} - -vector CDriver::GetMeshDisp_Sensitivity(unsigned short iMarker, unsigned long iVertex) { - - unsigned long iPoint; - vector Disp_Sens(3, 0.0); - vector Disp_Sens_passive(3, 0.0); - - iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); - CSolver *solver = solver_container[ZONE_0][INST_0][MESH_0][ADJMESH_SOL]; - CGeometry *geometry = geometry_container[ZONE_0][INST_0][MESH_0]; - - Disp_Sens[0] = solver->GetNodes()->GetBoundDisp_Sens(iPoint, 0); - Disp_Sens[1] = solver->GetNodes()->GetBoundDisp_Sens(iPoint, 1); - if (geometry->GetnDim() == 3) - Disp_Sens[2] = solver->GetNodes()->GetBoundDisp_Sens(iPoint, 2); - else - Disp_Sens[2] = 0.0; - - Disp_Sens_passive[0] = SU2_TYPE::GetValue(Disp_Sens[0]); - Disp_Sens_passive[1] = SU2_TYPE::GetValue(Disp_Sens[1]); - Disp_Sens_passive[2] = SU2_TYPE::GetValue(Disp_Sens[2]); - - return Disp_Sens_passive; - -} +//////////////////////////////////////////////////////////////////////////////// +/* Functions related to finite elements */ +//////////////////////////////////////////////////////////////////////////////// void CDriver::SetFEA_Loads(unsigned short iMarker, unsigned long iVertex, passivedouble LoadX, passivedouble LoadY, passivedouble LoadZ) { unsigned long iPoint; - PyWrapNodalForce[0] = LoadX; - PyWrapNodalForce[1] = LoadY; - PyWrapNodalForce[2] = LoadZ; + su2double NodalForce[3] = {0.0,0.0,0.0}; + NodalForce[0] = LoadX; + NodalForce[1] = LoadY; + NodalForce[2] = LoadZ; iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); - solver_container[ZONE_0][INST_0][MESH_0][FEA_SOL]->GetNodes()->Set_FlowTraction(iPoint,PyWrapNodalForce); + solver_container[ZONE_0][INST_0][MESH_0][FEA_SOL]->GetNodes()->Set_FlowTraction(iPoint,NodalForce); } -vector CDriver::GetFEA_Displacements(unsigned short iMarker, unsigned long iVertex) { +vector CDriver::GetFEA_Displacements(unsigned short iMarker, unsigned long iVertex) const { unsigned long iPoint; vector Displacements(3, 0.0); @@ -1052,7 +668,7 @@ vector CDriver::GetFEA_Displacements(unsigned short iMarker, unsi } -vector CDriver::GetFEA_Velocity(unsigned short iMarker, unsigned long iVertex) { +vector CDriver::GetFEA_Velocity(unsigned short iMarker, unsigned long iVertex) const { unsigned long iPoint; vector Velocity(3, 0.0); @@ -1070,11 +686,6 @@ vector CDriver::GetFEA_Velocity(unsigned short iMarker, unsigned else Velocity[2] = 0.0; } - else{ - Velocity[0] = 0.0; - Velocity[1] = 0.0; - Velocity[2] = 0.0; - } Velocity_passive[0] = SU2_TYPE::GetValue(Velocity[0]); Velocity_passive[1] = SU2_TYPE::GetValue(Velocity[1]); @@ -1083,7 +694,7 @@ vector CDriver::GetFEA_Velocity(unsigned short iMarker, unsigned return Velocity_passive; } -vector CDriver::GetFEA_Velocity_n(unsigned short iMarker, unsigned long iVertex) { +vector CDriver::GetFEA_Velocity_n(unsigned short iMarker, unsigned long iVertex) const { unsigned long iPoint; vector Velocity_n(3, 0.0); @@ -1101,11 +712,6 @@ vector CDriver::GetFEA_Velocity_n(unsigned short iMarker, unsigne else Velocity_n[2] = 0.0; } - else{ - Velocity_n[0] = 0.0; - Velocity_n[1] = 0.0; - Velocity_n[2] = 0.0; - } Velocity_n_passive[0] = SU2_TYPE::GetValue(Velocity_n[0]); Velocity_n_passive[1] = SU2_TYPE::GetValue(Velocity_n[1]); @@ -1115,7 +721,36 @@ vector CDriver::GetFEA_Velocity_n(unsigned short iMarker, unsigne } -vector CDriver::GetFlowLoad_Sensitivity(unsigned short iMarker, unsigned long iVertex) { +//////////////////////////////////////////////////////////////////////////////// +/* Functions related to adjoint simulations */ +//////////////////////////////////////////////////////////////////////////////// + +vector CDriver::GetMeshDisp_Sensitivity(unsigned short iMarker, unsigned long iVertex) const { + + unsigned long iPoint; + vector Disp_Sens(3, 0.0); + vector Disp_Sens_passive(3, 0.0); + + iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); + CSolver *solver = solver_container[ZONE_0][INST_0][MESH_0][ADJMESH_SOL]; + CGeometry *geometry = geometry_container[ZONE_0][INST_0][MESH_0]; + + Disp_Sens[0] = solver->GetNodes()->GetBoundDisp_Sens(iPoint, 0); + Disp_Sens[1] = solver->GetNodes()->GetBoundDisp_Sens(iPoint, 1); + if (geometry->GetnDim() == 3) + Disp_Sens[2] = solver->GetNodes()->GetBoundDisp_Sens(iPoint, 2); + else + Disp_Sens[2] = 0.0; + + Disp_Sens_passive[0] = SU2_TYPE::GetValue(Disp_Sens[0]); + Disp_Sens_passive[1] = SU2_TYPE::GetValue(Disp_Sens[1]); + Disp_Sens_passive[2] = SU2_TYPE::GetValue(Disp_Sens[2]); + + return Disp_Sens_passive; + +} + +vector CDriver::GetFlowLoad_Sensitivity(unsigned short iMarker, unsigned long iVertex) const { unsigned long iPoint; vector FlowLoad_Sens(3, 0.0); @@ -1140,36 +775,6 @@ vector CDriver::GetFlowLoad_Sensitivity(unsigned short iMarker, u } -vector CDriver::GetFlowLoad(unsigned short iMarker, unsigned long iVertex) { - - vector FlowLoad(3, 0.0); - vector FlowLoad_passive(3, 0.0); - - CSolver *solver = solver_container[ZONE_0][INST_0][MESH_0][FLOW_SOL]; - CGeometry *geometry = geometry_container[ZONE_0][INST_0][MESH_0]; - - if (config_container[ZONE_0]->GetMarker_All_Fluid_Load(iMarker) == YES) { - FlowLoad[0] = solver->GetVertexTractions(iMarker, iVertex, 0); - FlowLoad[1] = solver->GetVertexTractions(iMarker, iVertex, 1); - if (geometry->GetnDim() == 3) - FlowLoad[2] = solver->GetVertexTractions(iMarker, iVertex, 2); - else - FlowLoad[2] = 0.0; - } - else{ - FlowLoad[0] = 0.0; - FlowLoad[1] = 0.0; - FlowLoad[2] = 0.0; - } - - FlowLoad_passive[0] = SU2_TYPE::GetValue(FlowLoad[0]); - FlowLoad_passive[1] = SU2_TYPE::GetValue(FlowLoad[1]); - FlowLoad_passive[2] = SU2_TYPE::GetValue(FlowLoad[2]); - - return FlowLoad_passive; - -} - void CDriver::SetFlowLoad_Adjoint(unsigned short iMarker, unsigned long iVertex, passivedouble val_AdjointX, passivedouble val_AdjointY, passivedouble val_AdjointZ) { @@ -1199,58 +804,59 @@ void CDriver::SetSourceTerm_DispAdjoint(unsigned short iMarker, unsigned long iV } -vector CDriver::GetVertex_UndeformedCoord(unsigned short iMarker, unsigned long iVertex) { +//////////////////////////////////////////////////////////////////////////////// +/* Functions related to mesh deformation */ +//////////////////////////////////////////////////////////////////////////////// - unsigned long iPoint; - vector MeshCoord(3, 0.0); - vector MeshCoord_passive(3, 0.0); +void CDriver::SetMeshDisplacement(unsigned short iMarker, unsigned long iVertex, passivedouble DispX, passivedouble DispY, passivedouble DispZ) { - CSolver *solver = solver_container[ZONE_0][INST_0][MESH_0][MESH_SOL]; - CGeometry *geometry = geometry_container[ZONE_0][INST_0][MESH_0]; - iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); + unsigned long iPoint; + su2double MeshDispl[3] = {0.0,0.0,0.0}; - if (solver != nullptr) { - MeshCoord[0] = solver->GetNodes()->GetMesh_Coord(iPoint,0); - MeshCoord[1] = solver->GetNodes()->GetMesh_Coord(iPoint,1); - if (geometry->GetnDim() == 3) - MeshCoord[2] = solver->GetNodes()->GetMesh_Coord(iPoint,2); - else - MeshCoord[2] = 0.0; - } - else{ - MeshCoord[0] = 0.0; - MeshCoord[1] = 0.0; - MeshCoord[2] = 0.0; - } + MeshDispl[0] = DispX; + MeshDispl[1] = DispY; + MeshDispl[2] = DispZ; - MeshCoord_passive[0] = SU2_TYPE::GetValue(MeshCoord[0]); - MeshCoord_passive[1] = SU2_TYPE::GetValue(MeshCoord[1]); - MeshCoord_passive[2] = SU2_TYPE::GetValue(MeshCoord[2]); + iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); - return MeshCoord_passive; + solver_container[ZONE_0][INST_0][MESH_0][MESH_SOL]->GetNodes()->SetBound_Disp(iPoint,MeshDispl); } -void CDriver::SetHeatSource_Position(passivedouble alpha, passivedouble pos_x, passivedouble pos_y, passivedouble pos_z){ - - CSolver *solver = solver_container[ZONE_0][INST_0][MESH_0][RAD_SOL]; - - config_container[ZONE_0]->SetHeatSource_Rot_Z(alpha); - config_container[ZONE_0]->SetHeatSource_Center(pos_x, pos_y, pos_z); +void CDriver::CommunicateMeshDisplacement(void) { - solver->SetVolumetricHeatSource(geometry_container[ZONE_0][INST_0][MESH_0], config_container[ZONE_0]); + solver_container[ZONE_0][INST_0][MESH_0][MESH_SOL]->InitiateComms(geometry_container[ZONE_0][INST_0][MESH_0], + config_container[ZONE_0], MESH_DISPLACEMENTS); + solver_container[ZONE_0][INST_0][MESH_0][MESH_SOL]->CompleteComms(geometry_container[ZONE_0][INST_0][MESH_0], + config_container[ZONE_0], MESH_DISPLACEMENTS); } -void CDriver::SetInlet_Angle(unsigned short iMarker, passivedouble alpha){ +//////////////////////////////////////////////////////////////////////////////// +/* Functions related to flow loads */ +//////////////////////////////////////////////////////////////////////////////// - su2double alpha_rad = alpha * PI_NUMBER/180.0; +vector CDriver::GetFlowLoad(unsigned short iMarker, unsigned long iVertex) const { - unsigned long iVertex; + vector FlowLoad(3, 0.0); + vector FlowLoad_passive(3, 0.0); - for (iVertex = 0; iVertex < geometry_container[ZONE_0][INST_0][MESH_0]->nVertex[iMarker]; iVertex++){ - solver_container[ZONE_0][INST_0][MESH_0][FLOW_SOL]->SetInlet_FlowDir(iMarker, iVertex, 0, cos(alpha_rad)); - solver_container[ZONE_0][INST_0][MESH_0][FLOW_SOL]->SetInlet_FlowDir(iMarker, iVertex, 1, sin(alpha_rad)); + CSolver *solver = solver_container[ZONE_0][INST_0][MESH_0][FLOW_SOL]; + CGeometry *geometry = geometry_container[ZONE_0][INST_0][MESH_0]; + + if (config_container[ZONE_0]->GetSolid_Wall(iMarker)) { + FlowLoad[0] = solver->GetVertexTractions(iMarker, iVertex, 0); + FlowLoad[1] = solver->GetVertexTractions(iMarker, iVertex, 1); + if (geometry->GetnDim() == 3) + FlowLoad[2] = solver->GetVertexTractions(iMarker, iVertex, 2); + else + FlowLoad[2] = 0.0; } + FlowLoad_passive[0] = SU2_TYPE::GetValue(FlowLoad[0]); + FlowLoad_passive[1] = SU2_TYPE::GetValue(FlowLoad[1]); + FlowLoad_passive[2] = SU2_TYPE::GetValue(FlowLoad[2]); + + return FlowLoad_passive; + } diff --git a/SU2_CFD/src/solvers/CFEASolver.cpp b/SU2_CFD/src/solvers/CFEASolver.cpp index c54b3bb9706d..66fe4d41ba58 100644 --- a/SU2_CFD/src/solvers/CFEASolver.cpp +++ b/SU2_CFD/src/solvers/CFEASolver.cpp @@ -936,7 +936,7 @@ void CFEASolver::Compute_StiffMatrix_NodalStressRes(CGeometry *geometry, CNumeri } -void CFEASolver::Compute_MassMatrix(CGeometry *geometry, CNumerics **numerics, const CConfig *config) { +void CFEASolver::Compute_MassMatrix(const CGeometry *geometry, CNumerics **numerics, const CConfig *config) { const bool topology_mode = config->GetTopology_Optimization(); const su2double simp_minstiff = config->GetSIMP_MinStiffness(); @@ -1021,7 +1021,7 @@ void CFEASolver::Compute_MassMatrix(CGeometry *geometry, CNumerics **numerics, c } -void CFEASolver::Compute_MassRes(CGeometry *geometry, CNumerics **numerics, const CConfig *config) { +void CFEASolver::Compute_MassRes(const CGeometry *geometry, CNumerics **numerics, const CConfig *config) { const bool topology_mode = config->GetTopology_Optimization(); const su2double simp_minstiff = config->GetSIMP_MinStiffness(); @@ -2183,7 +2183,7 @@ su2double CFEASolver::Compute_LoadCoefficient(su2double CurrentTime, su2double R } -void CFEASolver::ImplicitNewmark_Iteration(CGeometry *geometry, CNumerics **numerics, const CConfig *config) { +void CFEASolver::ImplicitNewmark_Iteration(const CGeometry *geometry, CNumerics **numerics, const CConfig *config) { const bool first_iter = (config->GetInnerIter() == 0); const bool dynamic = (config->GetTime_Domain()); @@ -2267,7 +2267,7 @@ void CFEASolver::ImplicitNewmark_Iteration(CGeometry *geometry, CNumerics **nume } -void CFEASolver::ImplicitNewmark_Update(CGeometry *geometry, CConfig *config) { +void CFEASolver::ImplicitNewmark_Update(const CGeometry *geometry, const CConfig *config) { const bool dynamic = (config->GetTime_Domain()); @@ -2314,7 +2314,7 @@ void CFEASolver::ImplicitNewmark_Update(CGeometry *geometry, CConfig *config) { } // end SU2_OMP_PARALLEL } -void CFEASolver::ImplicitNewmark_Relaxation(CGeometry *geometry, CConfig *config) { +void CFEASolver::ImplicitNewmark_Relaxation(const CGeometry *geometry, const CConfig *config) { const bool dynamic = (config->GetTime_Domain()); @@ -2362,7 +2362,7 @@ void CFEASolver::ImplicitNewmark_Relaxation(CGeometry *geometry, CConfig *config } -void CFEASolver::GeneralizedAlpha_Iteration(CGeometry *geometry, CNumerics **numerics, const CConfig *config) { +void CFEASolver::GeneralizedAlpha_Iteration(const CGeometry *geometry, CNumerics **numerics, const CConfig *config) { const bool first_iter = (config->GetInnerIter() == 0); const bool dynamic = (config->GetTime_Domain()); @@ -2470,7 +2470,7 @@ void CFEASolver::GeneralizedAlpha_Iteration(CGeometry *geometry, CNumerics **num } -void CFEASolver::GeneralizedAlpha_UpdateDisp(CGeometry *geometry, CConfig *config) { +void CFEASolver::GeneralizedAlpha_UpdateDisp(const CGeometry *geometry, const CConfig *config) { /*--- Update displacement components of the solution. ---*/ @@ -2481,7 +2481,7 @@ void CFEASolver::GeneralizedAlpha_UpdateDisp(CGeometry *geometry, CConfig *confi } -void CFEASolver::GeneralizedAlpha_UpdateSolution(CGeometry *geometry, CConfig *config) { +void CFEASolver::GeneralizedAlpha_UpdateSolution(const CGeometry *geometry, const CConfig *config) { const su2double alpha_f = config->Get_Int_Coeffs(2); const su2double alpha_m = config->Get_Int_Coeffs(3); @@ -2535,7 +2535,7 @@ void CFEASolver::GeneralizedAlpha_UpdateSolution(CGeometry *geometry, CConfig *c } -void CFEASolver::GeneralizedAlpha_UpdateLoads(CGeometry *geometry, const CConfig *config) { +void CFEASolver::GeneralizedAlpha_UpdateLoads(const CGeometry *geometry, const CConfig *config) { /*--- Set the load conditions of the time step n+1 as the load conditions for time step n ---*/ nodes->Set_SurfaceLoad_Res_n(); diff --git a/SU2_CFD/src/solvers/CMeshSolver.cpp b/SU2_CFD/src/solvers/CMeshSolver.cpp index b2ceac739d48..07748237afde 100644 --- a/SU2_CFD/src/solvers/CMeshSolver.cpp +++ b/SU2_CFD/src/solvers/CMeshSolver.cpp @@ -298,7 +298,7 @@ void CMeshSolver::SetWallDistance(CGeometry *geometry, CConfig *config) { unsigned long nVertex_SolidWall = 0; for(auto iMarker=0u; iMarkerGetnMarker_All(); ++iMarker) { - if(config->GetSolid_Wall(iMarker)) { + if(config->GetSolid_Wall(iMarker) && !config->GetMarker_All_Deform_Mesh_Sym_Plane(iMarker)) { nVertex_SolidWall += geometry->GetnVertex(iMarker); } } @@ -315,7 +315,7 @@ void CMeshSolver::SetWallDistance(CGeometry *geometry, CConfig *config) { for (unsigned long iMarker=0, ii=0, jj=0; iMarkerGetnMarker_All(); ++iMarker) { - if (!config->GetSolid_Wall(iMarker)) continue; + if (!config->GetSolid_Wall(iMarker) || config->GetMarker_All_Deform_Mesh_Sym_Plane(iMarker)) continue; for (auto iVertex=0u; iVertexGetnVertex(iMarker); ++iVertex) { auto iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); diff --git a/SU2_CFD/src/solvers/CSolver.cpp b/SU2_CFD/src/solvers/CSolver.cpp index f608da291387..a29ab35b1fee 100644 --- a/SU2_CFD/src/solvers/CSolver.cpp +++ b/SU2_CFD/src/solvers/CSolver.cpp @@ -119,10 +119,6 @@ CSolver::CSolver(bool mesh_deform_mode) : System(mesh_deform_mode) { /*--- Flags for the dynamic grid (rigid movement or unsteady deformation). ---*/ dynamic_grid = false; - /*--- Container to store the vertex tractions. ---*/ - VertexTraction = nullptr; - VertexTractionAdjoint = nullptr; - /*--- Auxiliary data needed for CFL adaption. ---*/ Old_Func = 0; @@ -137,7 +133,6 @@ CSolver::CSolver(bool mesh_deform_mode) : System(mesh_deform_mode) { CSolver::~CSolver(void) { unsigned short iVar; - unsigned long iMarker, iVertex; /*--- Public variables, may be accessible outside ---*/ @@ -222,24 +217,6 @@ CSolver::~CSolver(void) { delete [] Jacobian_jj; } - if (VertexTraction != nullptr) { - for (iMarker = 0; iMarker < nMarker; iMarker++) { - for (iVertex = 0; iVertex < nVertex[iMarker]; iVertex++) - delete [] VertexTraction[iMarker][iVertex]; - delete [] VertexTraction[iMarker]; - } - delete [] VertexTraction; - } - - if (VertexTractionAdjoint != nullptr) { - for (iMarker = 0; iMarker < nMarker; iMarker++) { - for (iVertex = 0; iVertex < nVertex[iMarker]; iVertex++) - delete [] VertexTractionAdjoint[iMarker][iVertex]; - delete [] VertexTractionAdjoint[iMarker]; - } - delete [] VertexTractionAdjoint; - } - delete [] nVertex; delete [] Restart_Vars; @@ -4014,24 +3991,17 @@ void CSolver::LoadInletProfile(CGeometry **geometry, } -void CSolver::ComputeVertexTractions(CGeometry *geometry, CConfig *config){ +void CSolver::ComputeVertexTractions(CGeometry *geometry, const CConfig *config){ /*--- Compute the constant factor to dimensionalize pressure and shear stress. ---*/ - su2double *Velocity_ND, *Velocity_Real; + const su2double *Velocity_ND, *Velocity_Real; su2double Density_ND, Density_Real, Velocity2_Real, Velocity2_ND; su2double factor; - unsigned short iDim, jDim; + unsigned short iDim; // Check whether the problem is viscous - bool viscous_flow = ((config->GetKind_Solver() == NAVIER_STOKES) || - (config->GetKind_Solver() == INC_NAVIER_STOKES) || - (config->GetKind_Solver() == RANS) || - (config->GetKind_Solver() == INC_RANS) || - (config->GetKind_Solver() == DISC_ADJ_NAVIER_STOKES) || - (config->GetKind_Solver() == DISC_ADJ_INC_NAVIER_STOKES) || - (config->GetKind_Solver() == DISC_ADJ_INC_RANS) || - (config->GetKind_Solver() == DISC_ADJ_RANS)); + bool viscous_flow = config->GetViscous(); // Parameters for the calculations su2double Pn = 0.0; @@ -4039,7 +4009,7 @@ void CSolver::ComputeVertexTractions(CGeometry *geometry, CConfig *config){ unsigned short iMarker; unsigned long iVertex, iPoint; - su2double const *iNormal; + const su2double* iNormal; su2double Pressure_Inf = config->GetPressure_FreeStreamND(); @@ -4049,59 +4019,52 @@ void CSolver::ComputeVertexTractions(CGeometry *geometry, CConfig *config){ Velocity_ND = config->GetVelocity_FreeStreamND(); Density_ND = config->GetDensity_FreeStreamND(); - Velocity2_Real = 0.0; - Velocity2_ND = 0.0; - for (unsigned short iDim = 0; iDim < nDim; iDim++) { - Velocity2_Real += Velocity_Real[iDim]*Velocity_Real[iDim]; - Velocity2_ND += Velocity_ND[iDim]*Velocity_ND[iDim]; - } + Velocity2_Real = GeometryToolbox::SquaredNorm(nDim, Velocity_Real); + Velocity2_ND = GeometryToolbox::SquaredNorm(nDim, Velocity_ND); factor = Density_Real * Velocity2_Real / ( Density_ND * Velocity2_ND ); for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - /*--- If this is defined as an interface marker ---*/ - if (config->GetMarker_All_Fluid_Load(iMarker) == YES) { + /*--- If this is defined as a wall ---*/ + if (!config->GetSolid_Wall(iMarker)) continue; - // Loop over the vertices - for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { + // Loop over the vertices + for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { - // Recover the point index - iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); - // Get the normal at the vertex: this normal goes inside the fluid domain. - iNormal = geometry->vertex[iMarker][iVertex]->GetNormal(); + // Recover the point index + iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); + // Get the normal at the vertex: this normal goes inside the fluid domain. + iNormal = geometry->vertex[iMarker][iVertex]->GetNormal(); - /*--- Check if the node belongs to the domain (i.e, not a halo node) ---*/ - if (geometry->nodes->GetDomain(iPoint)) { + /*--- Check if the node belongs to the domain (i.e, not a halo node) ---*/ + if (geometry->nodes->GetDomain(iPoint)) { - // Retrieve the values of pressure - Pn = base_nodes->GetPressure(iPoint); + // Retrieve the values of pressure + Pn = base_nodes->GetPressure(iPoint); - // Calculate tn in the fluid nodes for the inviscid term --> Units of force (non-dimensional). - for (iDim = 0; iDim < nDim; iDim++) - auxForce[iDim] = -(Pn-Pressure_Inf)*iNormal[iDim]; + // Calculate tn in the fluid nodes for the inviscid term --> Units of force (non-dimensional). + for (iDim = 0; iDim < nDim; iDim++) + auxForce[iDim] = -(Pn-Pressure_Inf)*iNormal[iDim]; - // Calculate tn in the fluid nodes for the viscous term - if (viscous_flow) { - su2double Viscosity = base_nodes->GetLaminarViscosity(iPoint); - su2double Tau[3][3]; - CNumerics::ComputeStressTensor(nDim, Tau, base_nodes->GetGradient_Primitive(iPoint)+1, Viscosity); - for (iDim = 0; iDim < nDim; iDim++) { - for (jDim = 0 ; jDim < nDim; jDim++) { - auxForce[iDim] += Tau[iDim][jDim]*iNormal[jDim]; - } - } - } - - // Redimensionalize the forces + // Calculate tn in the fluid nodes for the viscous term + if (viscous_flow) { + su2double Viscosity = base_nodes->GetLaminarViscosity(iPoint); + su2double Tau[3][3]; + CNumerics::ComputeStressTensor(nDim, Tau, base_nodes->GetGradient_Primitive(iPoint)+1, Viscosity); for (iDim = 0; iDim < nDim; iDim++) { - VertexTraction[iMarker][iVertex][iDim] = factor * auxForce[iDim]; + auxForce[iDim] += GeometryToolbox::DotProduct(nDim, Tau[iDim], iNormal); } } - else{ - for (iDim = 0; iDim < nDim; iDim++) { - VertexTraction[iMarker][iVertex][iDim] = 0.0; - } + + // Redimensionalize the forces + for (iDim = 0; iDim < nDim; iDim++) { + VertexTraction[iMarker][iVertex][iDim] = factor * auxForce[iDim]; + } + } + else{ + for (iDim = 0; iDim < nDim; iDim++) { + VertexTraction[iMarker][iVertex][iDim] = 0.0; } } } @@ -4109,7 +4072,7 @@ void CSolver::ComputeVertexTractions(CGeometry *geometry, CConfig *config){ } -void CSolver::RegisterVertexTractions(CGeometry *geometry, CConfig *config){ +void CSolver::RegisterVertexTractions(CGeometry *geometry, const CConfig *config){ unsigned short iMarker, iDim; unsigned long iVertex, iPoint; @@ -4117,31 +4080,28 @@ void CSolver::RegisterVertexTractions(CGeometry *geometry, CConfig *config){ /*--- Loop over all the markers ---*/ for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - /*--- If this is defined as an interface marker ---*/ - if (config->GetMarker_All_Fluid_Load(iMarker) == YES) { + /*--- If this is defined as a wall ---*/ + if (!config->GetSolid_Wall(iMarker)) continue; - /*--- Loop over the vertices ---*/ - for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { + /*--- Loop over the vertices ---*/ + for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { - /*--- Recover the point index ---*/ - iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); + /*--- Recover the point index ---*/ + iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); - /*--- Check if the node belongs to the domain (i.e, not a halo node) ---*/ - if (geometry->nodes->GetDomain(iPoint)) { - - /*--- Register the vertex traction as output ---*/ - for (iDim = 0; iDim < nDim; iDim++) { - AD::RegisterOutput(VertexTraction[iMarker][iVertex][iDim]); - } + /*--- Check if the node belongs to the domain (i.e, not a halo node) ---*/ + if (!geometry->nodes->GetDomain(iPoint)) continue; - } + /*--- Register the vertex traction as output ---*/ + for (iDim = 0; iDim < nDim; iDim++) { + AD::RegisterOutput(VertexTraction[iMarker][iVertex][iDim]); } } } } -void CSolver::SetVertexTractionsAdjoint(CGeometry *geometry, CConfig *config){ +void CSolver::SetVertexTractionsAdjoint(CGeometry *geometry, const CConfig *config){ unsigned short iMarker, iDim; unsigned long iVertex, iPoint; @@ -4149,26 +4109,22 @@ void CSolver::SetVertexTractionsAdjoint(CGeometry *geometry, CConfig *config){ /*--- Loop over all the markers ---*/ for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - /*--- If this is defined as an interface marker ---*/ - if (config->GetMarker_All_Fluid_Load(iMarker) == YES) { - - /*--- Loop over the vertices ---*/ - for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { - - /*--- Recover the point index ---*/ - iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); + /*--- If this is defined as a wall ---*/ + if (!config->GetSolid_Wall(iMarker)) continue; - /*--- Check if the node belongs to the domain (i.e, not a halo node) ---*/ - if (geometry->nodes->GetDomain(iPoint)) { + /*--- Loop over the vertices ---*/ + for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { - /*--- Set the adjoint of the vertex traction from the value received ---*/ - for (iDim = 0; iDim < nDim; iDim++) { + /*--- Recover the point index ---*/ + iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); - SU2_TYPE::SetDerivative(VertexTraction[iMarker][iVertex][iDim], - SU2_TYPE::GetValue(VertexTractionAdjoint[iMarker][iVertex][iDim])); - } + /*--- Check if the node belongs to the domain (i.e, not a halo node) ---*/ + if (!geometry->nodes->GetDomain(iPoint)) continue; - } + /*--- Set the adjoint of the vertex traction from the value received ---*/ + for (iDim = 0; iDim < nDim; iDim++) { + SU2_TYPE::SetDerivative(VertexTraction[iMarker][iVertex][iDim], + SU2_TYPE::GetValue(VertexTractionAdjoint[iMarker][iVertex][iDim])); } } } diff --git a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp index 0a560888d9f6..b3884d2c4b1f 100644 --- a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp +++ b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp @@ -322,6 +322,8 @@ void CTurbSSTSolver::Postprocessing(CGeometry *geometry, CSolver **solver_contai void CTurbSSTSolver::Source_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics **numerics_container, CConfig *config, unsigned short iMesh) { + + bool axisymmetric = config->GetAxisymmetric(); CVariable* flowNodes = solver_container[FLOW_SOL]->GetNodes(); @@ -372,6 +374,11 @@ void CTurbSSTSolver::Source_Residual(CGeometry *geometry, CSolver **solver_conta numerics->SetCrossDiff(nodes->GetCrossDiff(iPoint),0.0); + if (axisymmetric){ + /*--- Set y coordinate ---*/ + numerics->SetCoord(geometry->nodes->GetCoord(iPoint), geometry->nodes->GetCoord(iPoint)); + } + /*--- Compute the source term ---*/ auto residual = numerics->ComputeResidual(config); diff --git a/SU2_PY/FSI_tools/FSIInterface.py b/SU2_PY/FSI_tools/FSIInterface.py index aa5423980143..9fe034d1e1fa 100644 --- a/SU2_PY/FSI_tools/FSIInterface.py +++ b/SU2_PY/FSI_tools/FSIInterface.py @@ -565,10 +565,8 @@ def interfaceMapping(self,FluidSolver, SolidSolver, FSI_config): # Note that the fluid solver is separated in more processors outside the python script # thus when, from a core, we request for the vertices on the interface, we only obtain # those in that node - GlobalIndex = FluidSolver.GetVertexGlobalIndex(self.fluidInterfaceIdentifier, iVertex) #TODO obtain here the undeformed mesh - posx = FluidSolver.GetVertexCoordX(self.fluidInterfaceIdentifier, iVertex) - posy = FluidSolver.GetVertexCoordY(self.fluidInterfaceIdentifier, iVertex) - posz = FluidSolver.GetVertexCoordZ(self.fluidInterfaceIdentifier, iVertex) + GlobalIndex = FluidSolver.GetVertexGlobalIndex(self.fluidInterfaceIdentifier, iVertex) + posx, posy, posz = FluidSolver.GetInitialMeshCoord(self.fluidInterfaceIdentifier, iVertex) if GlobalIndex not in self.FluidHaloNodeList[myid].keys(): fluidIndexing_temp[GlobalIndex] = self.__getGlobalIndex('fluid', myid, localIndex) self.localFluidInterface_array_X_init[localIndex] = posx @@ -1394,9 +1392,7 @@ def interpolateFluidLoadsOnSolidMesh(self, FSI_config): del sendBuff_X del sendBuff_Y del sendBuff_Z - del self.solidLoads_array_X_recon - del self.solidLoads_array_Y_recon - del self.solidLoads_array_Z_recon + self.comm.barrier() else: self.localSolidLoads_array_X = self.solidLoads_array_X.getArray().copy() self.localSolidLoads_array_Y = self.solidLoads_array_Y.getArray().copy() @@ -2094,7 +2090,7 @@ def SteadyFSI(self, FSI_config,FluidSolver, SolidSolver): # mesh pushing back the solution to avoid spurious velocities, as the velocity is not computed at all self.MPIPrint('\nPerforming static mesh deformation...\n') FluidSolver.Preprocess(0)# This will attempt to always set the initial condition, but there is a flag on the unsteady computation that will avoid it - FluidSolver.Run() #TODO check how the preprocess work if fsi is false + FluidSolver.Run() FluidSolver.Postprocess() FluidSolver.Monitor(0) #This is actually not needed, it only saves the fact that the fluid solver converged innerly or reached max iterations FluidSolver.Output(0) diff --git a/SU2_PY/SU2_Nastran/pysu2_nastran.py b/SU2_PY/SU2_Nastran/pysu2_nastran.py index cf28f42a5ebb..aa83f44c5dd2 100644 --- a/SU2_PY/SU2_Nastran/pysu2_nastran.py +++ b/SU2_PY/SU2_Nastran/pysu2_nastran.py @@ -41,21 +41,26 @@ # Config class # ---------------------------------------------------------------------- -class ImposedMotionFunction: +class ImposedMotionClass: + + def __init__(self,time0,typeOfMotion,parameters,mode): - def __init__(self,time0,tipo,parameters): self.time0 = time0 - self.tipo = tipo - if self.tipo == "SINUSOIDAL": - self.bias = parameters[0] - self.amplitude = parameters[1] - self.frequency = parameters[2] - - elif self.tipo == "BLENDED_STEP": - self.kmax = parameters[0] - self.vinf = parameters[1] - self.lref = parameters[2] - self.amplitude = parameters[3] + self.typeOfMotion = typeOfMotion + self.mode = mode + + if self.typeOfMotion == "SINUSOIDAL": + self.bias = parameters["BIAS"] + self.amplitude = parameters["AMPLITUDE"] + self.frequency = parameters["FREQUENCY"] + self.timeStart = parameters["TIME_0"] + + elif self.typeOfMotion == "BLENDED_STEP": + self.kmax = parameters["K_MAX"] + self.vinf = parameters["V_INF"] + self.lref = parameters["L_REF"] + self.amplitude = parameters["AMPLITUDE"] + self.timeStart = parameters["TIME_0"] self.tmax = 2*pi/self.kmax*self.lref/self.vinf self.omega0 = 1/2*self.kmax @@ -64,35 +69,41 @@ def __init__(self,time0,tipo,parameters): def GetDispl(self,time): - time = time - self.time0 - if self.tipo == "SINUSOIDAL": + time = time - self.time0 - self.timeStart + if self.typeOfMotion == "SINUSOIDAL": return self.bias+self.amplitude*sin(2*pi*self.frequency*time) - if self.tipo == "BLENDED_STEP": - if time < self.tmax: + if self.typeOfMotion == "BLENDED_STEP": + if time < 0: + return 0.0 + elif time < self.tmax: return self.amplitude/2.0*(1.0-cos(self.omega0*time*self.vinf/self.lref)) return self.amplitude def GetVel(self,time): - time = time - self.time0 + time = time - self.time0 - self.timeStart - if self.tipo == "SINUSOIDAL": + if self.typeOfMotion == "SINUSOIDAL": return self.amplitude*cos(2*pi*self.frequency*time)*2*pi*self.frequency - if self.tipo == "BLENDED_STEP": - if time < self.tmax: + if self.typeOfMotion == "BLENDED_STEP": + if time < 0: + return 0.0 + elif time < self.tmax: return self.amplitude/2.0*sin(self.omega0*time*self.vinf/self.lref)*(self.omega0*self.vinf/self.lref) return 0.0 def GetAcc(self,time): - time = time - self.time0 + time = time - self.time0 - self.timeStart - if self.tipo == "SINUSOIDAL": + if self.typeOfMotion == "SINUSOIDAL": return -self.amplitude*sin(2*pi*self.frequency*time)*(2*pi*self.frequency)**2 - if self.tipo == "BLENDED_STEP": - if time < self.tmax: + if self.typeOfMotion == "BLENDED_STEP": + if time < 0: + return 0.0 + elif time < self.tmax: return self.amplitude/2.0*cos(self.omega0*time*self.vinf/self.lref)*(self.omega0*self.vinf/self.lref)**2 return 0.0 @@ -281,7 +292,7 @@ def __init__(self, config_fileName, ImposedMotion): self.markers = {} self.refsystems = [] self.ImposedMotionToSet = True - self.ImposedMotionFunction = {} + self.ImposedMotionFunction = [] print("\n") print(" Reading the mesh ".center(80,"-")) @@ -725,14 +736,17 @@ def __temporalIteration(self,time): This method integrates in time the solution. """ + self.__reset(self.q) + self.__reset(self.qdot) + self.__reset(self.qddot) + self.__reset(self.a) + if not self.ImposedMotion: eps = 1e-6 self.__SetLoads() # Prediction step - self.__reset(self.qddot) - self.__reset(self.a) self.a += (self.alpha_f)/(1-self.alpha_m)*self.qddot_n self.a -= (self.alpha_m)/(1-self.alpha_m)*self.a_n @@ -760,14 +774,20 @@ def __temporalIteration(self,time): self.a += (1-self.alpha_f)/(1-self.alpha_m)*self.qddot else: if self.ImposedMotionToSet: - for imode in self.Config["IMPOSED_MODES"].keys(): - self.ImposedMotionFunction[imode] = ImposedMotionFunction(time,self.Config["IMPOSED_MODES"][imode],self.Config["IMPOSED_PARAMETERS"][imode]) - self.ImposedMotionToSet = False - for imode in self.Config["IMPOSED_MODES"].keys(): - self.q[imode] = self.ImposedMotionFunction[imode].GetDispl(time) - self.qdot[imode] = self.ImposedMotionFunction[imode].GetVel(time) - self.qddot[imode] = self.ImposedMotionFunction[imode].GetAcc(time) - self.a = np.copy(self.qddot) + iImposedFunc = 0 + for imode in self.Config["IMPOSED_MODES"].keys(): + for isuperposed in range(len(self.Config["IMPOSED_MODES"][imode])): + typeOfMotion = self.Config["IMPOSED_MODES"][imode][isuperposed] + parameters = self.Config["IMPOSED_PARAMETERS"][imode][isuperposed] + self.ImposedMotionFunction.append(ImposedMotionClass(time, typeOfMotion, parameters, imode)) + iImposedFunc += 1 + self.ImposedMotionToSet = False + for iImposedFunc in range(len(self.ImposedMotionFunction)): + imode = self.ImposedMotionFunction[iImposedFunc].mode + self.q[imode] += self.ImposedMotionFunction[iImposedFunc].GetDispl(time) + self.qdot[imode] += self.ImposedMotionFunction[iImposedFunc].GetVel(time) + self.qddot[imode] += self.ImposedMotionFunction[iImposedFunc].GetAcc(time) + self.a = np.copy(self.qddot) def __SetLoads(self): diff --git a/TestCases/axisymmetric_rans/air_nozzle/air_nozzle.cfg b/TestCases/axisymmetric_rans/air_nozzle/air_nozzle.cfg new file mode 100644 index 000000000000..f40f1775b496 --- /dev/null +++ b/TestCases/axisymmetric_rans/air_nozzle/air_nozzle.cfg @@ -0,0 +1,214 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% SU2 configuration file % +% Case description: Axisymmetric supersonic converging-diverging air nozzle % +% Author: Florian Dittmann % +% Date: 2021.12.02 % +% File Version 7.10 "Blackbird" % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% +% +% Physical governing equations (EULER, NAVIER_STOKES, +% FEM_EULER, FEM_NAVIER_STOKES, FEM_RANS, FEM_LES, +% WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, +% POISSON_EQUATION) +SOLVER= RANS +% +% Specify turbulence model (NONE, SA, SA_NEG, SST, SA_E, SA_COMP, SA_E_COMP) +KIND_TURB_MODEL= SST +% +% Mathematical problem (DIRECT, CONTINUOUS_ADJOINT, DISCRETE_ADJOINT) +MATH_PROBLEM= DIRECT +% +% Restart solution (NO, YES) +RESTART_SOL= YES +% +% System of measurements (SI, US) +% International system of units (SI): ( meters, kilograms, Kelvins, +% Newtons = kg m/s^2, Pascals = N/m^2, +% Density = kg/m^3, Speed = m/s, +% Equiv. Area = m^2 ) +% United States customary units (US): ( inches, slug, Rankines, lbf = slug ft/s^2, +% psf = lbf/ft^2, Density = slug/ft^3, +% Speed = ft/s, Equiv. Area = ft^2 ) +SYSTEM_MEASUREMENTS= SI +% +AXISYMMETRIC= YES +% +% -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% +% +% Mach number (non-dimensional, based on the free-stream values) +MACH_NUMBER= 1E-9 +% +% Angle of attack (degrees, only for compressible flows) +AOA= 0.0 +% +% Side-slip angle (degrees, only for compressible flows) +SIDESLIP_ANGLE= 0.0 +% +% Init option to choose between Reynolds (default) or thermodynamics quantities +% for initializing the solution (REYNOLDS, TD_CONDITIONS) +INIT_OPTION= TD_CONDITIONS +% +% Free-stream option to choose between density and temperature (default) for +% initializing the solution (TEMPERATURE_FS, DENSITY_FS) +FREESTREAM_OPTION= TEMPERATURE_FS +% +% Free-stream pressure (101325.0 N/m^2, 2116.216 psf by default) +FREESTREAM_PRESSURE= 1400000 +% +% Free-stream temperature (288.15 K, 518.67 R by default) +FREESTREAM_TEMPERATURE= 373.15 +% +% Compressible flow non-dimensionalization (DIMENSIONAL, FREESTREAM_PRESS_EQ_ONE, +% FREESTREAM_VEL_EQ_MACH, FREESTREAM_VEL_EQ_ONE) +REF_DIMENSIONALIZATION= DIMENSIONAL + +% ---- IDEAL GAS, POLYTROPIC, VAN DER WAALS AND PENG ROBINSON CONSTANTS -------% +% +% Fluid model (STANDARD_AIR, IDEAL_GAS, VW_GAS, PR_GAS, +% CONSTANT_DENSITY, INC_IDEAL_GAS, INC_IDEAL_GAS_POLY) +FLUID_MODEL= STANDARD_AIR + +% --------------------------- VISCOSITY MODEL ---------------------------------% +% +% Viscosity model (SUTHERLAND, CONSTANT_VISCOSITY, POLYNOMIAL_VISCOSITY). +VISCOSITY_MODEL= CONSTANT_VISCOSITY +% +% Molecular Viscosity that would be constant (1.716E-5 by default) +MU_CONSTANT= 1.716E-5 + +% --------------------------- THERMAL CONDUCTIVITY MODEL ----------------------% +% +% Laminar Conductivity model (CONSTANT_CONDUCTIVITY, CONSTANT_PRANDTL, +% POLYNOMIAL_CONDUCTIVITY). +CONDUCTIVITY_MODEL= CONSTANT_PRANDTL +% +% Laminar Prandtl number (0.72 (air), only for CONSTANT_PRANDTL) +PRANDTL_LAM= 0.72 +% +% Turbulent Prandtl number (0.9 (air) by default) +PRANDTL_TURB= 0.90 + +% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% +% +% Navier-Stokes (no-slip), constant heat flux wall marker(s) (NONE = no marker) +% Format: ( marker name, constant heat flux (J/m^2), ... ) +MARKER_HEATFLUX= ( WALL, 0.0 ) +% +% Symmetry boundary marker(s) (NONE = no marker) +MARKER_SYM= ( SYMMETRY ) +% +% Riemann boundary marker(s) (NONE = no marker) +% Format: (marker, data kind flag, list of data) +MARKER_RIEMANN= ( INFLOW, TOTAL_CONDITIONS_PT, 1400000.0, 373.15, 1.0, 0.0, 0.0, OUTFLOW, STATIC_PRESSURE, 100000.0, 0.0, 0.0, 0.0, 0.0 ) + +% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% +% +% Numerical method for spatial gradients (GREEN_GAUSS, WEIGHTED_LEAST_SQUARES) +NUM_METHOD_GRAD= GREEN_GAUSS +% +% CFL number (initial value for the adaptive CFL number) +CFL_NUMBER= 1000.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= ( 0.1, 2.0, 10.0, 1000.0 ) +% +% Maximum Delta Time in local time stepping simulations +MAX_DELTA_TIME= 1E6 + +% ----------- SLOPE LIMITER AND DISSIPATION SENSOR DEFINITION -----------------% +% +% Monotonic Upwind Scheme for Conservation Laws (TVD) in the flow equations. +% Required for 2nd order upwind schemes (NO, YES) +MUSCL_FLOW= YES +% +% Slope limiter (NONE, VENKATAKRISHNAN, VENKATAKRISHNAN_WANG, +% BARTH_JESPERSEN, VAN_ALBADA_EDGE) +SLOPE_LIMITER_FLOW= NONE + +% ------------------------ LINEAR SOLVER DEFINITION ---------------------------% +% +% Linear solver or smoother for implicit formulations (BCGSTAB, FGMRES, SMOOTHER_JACOBI, +% SMOOTHER_ILU, SMOOTHER_LUSGS, +% SMOOTHER_LINELET) +LINEAR_SOLVER= FGMRES +% +% Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) +LINEAR_SOLVER_PREC= ILU +% +% Linear solver ILU preconditioner fill-in level (0 by default) +LINEAR_SOLVER_ILU_FILL_IN= 0 +% +% Minimum error of the linear solver for implicit formulations +LINEAR_SOLVER_ERROR= 0.01 +% +% Max number of iterations of the linear solver for the implicit formulation +LINEAR_SOLVER_ITER= 10 + +% -------------------------- MULTIGRID PARAMETERS -----------------------------% +% +% Multi-grid levels (0 = no multi-grid) +MGLEVEL= 0 + +% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% +% +% Convective numerical method (JST, LAX-FRIEDRICH, CUSP, ROE, AUSM, AUSMPLUSUP, AUSMPLUSUP2, HLLC, +% TURKEL_PREC, MSW, FDS) +CONV_NUM_METHOD_FLOW= ROE +% +% Entropy fix coefficient (0.0 implies no entropy fixing, 1.0 implies scalar +% artificial dissipation) +ENTROPY_FIX_COEFF= 0.1 +% +% Time discretization (RUNGE-KUTTA_EXPLICIT, EULER_IMPLICIT, EULER_EXPLICIT) +TIME_DISCRE_FLOW= EULER_IMPLICIT +% + +% -------------------- TURBULENT NUMERICAL METHOD DEFINITION ------------------% +% +% Convective numerical method (SCALAR_UPWIND) +CONV_NUM_METHOD_TURB= SCALAR_UPWIND +% +% Time discretization (EULER_IMPLICIT) +TIME_DISCRE_TURB= EULER_IMPLICIT +% +% Reduction factor of the CFL coefficient in the turbulence problem +CFL_REDUCTION_TURB= 1.0 + +% --------------------------- CONVERGENCE PARAMETERS --------------------------% +% +% Number of total iterations +ITER= 1000 +% +% Convergence criteria (CAUCHY, RESIDUAL) +CONV_CRITERIA= RESIDUAL +% +% Min value of the residual (log10 of the residual) +CONV_RESIDUAL_MINVAL= -12 +% +% Start convergence criteria at iteration number +CONV_STARTITER= 10 + +% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% +% +% Mesh input file +MESH_FILENAME= nozzle.su2 +% +% Mesh input file format (SU2, CGNS) +MESH_FORMAT= SU2 +% +% Restart flow input file +SOLUTION_FILENAME= solution_flow.dat +% +% Writing solution file frequency +OUTPUT_WRT_FREQ= 1000 +% +% Screen output +SCREEN_OUTPUT= (INNER_ITER, RMS_DENSITY, RMS_ENERGY, RMS_TKE, RMS_DISSIPATION) diff --git a/TestCases/cont_adj_euler/naca0012/inv_NACA0012.cfg b/TestCases/cont_adj_euler/naca0012/inv_NACA0012.cfg index e519891a2a1d..fa9cadd19f22 100644 --- a/TestCases/cont_adj_euler/naca0012/inv_NACA0012.cfg +++ b/TestCases/cont_adj_euler/naca0012/inv_NACA0012.cfg @@ -112,7 +112,7 @@ LINEAR_SOLVER_ERROR= 1E-6 % Max number of iterations of the linear solver for the implicit formulation LINEAR_SOLVER_ITER= 5 % -% Linael solver ILU preconditioner fill-in level (1 by default) +% Linear solver ILU preconditioner fill-in level (1 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % -------------------------- MULTIGRID PARAMETERS -----------------------------% diff --git a/TestCases/cont_adj_euler/naca0012/inv_NACA0012_FD.cfg b/TestCases/cont_adj_euler/naca0012/inv_NACA0012_FD.cfg index d5e37789b0c0..81a4e80be47d 100644 --- a/TestCases/cont_adj_euler/naca0012/inv_NACA0012_FD.cfg +++ b/TestCases/cont_adj_euler/naca0012/inv_NACA0012_FD.cfg @@ -110,7 +110,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (1 by default) +% Linear solver ILU preconditioner fill-in level (1 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % -------------------------- MULTIGRID PARAMETERS -----------------------------% diff --git a/TestCases/cont_adj_euler/wedge/inv_wedge_ROE_multiobj.cfg b/TestCases/cont_adj_euler/wedge/inv_wedge_ROE_multiobj.cfg index 88ba1cf853b9..7b90ced501ce 100644 --- a/TestCases/cont_adj_euler/wedge/inv_wedge_ROE_multiobj.cfg +++ b/TestCases/cont_adj_euler/wedge/inv_wedge_ROE_multiobj.cfg @@ -112,7 +112,7 @@ LINEAR_SOLVER_ITER= 5 % Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (1 by default) +% Linear solver ILU preconditioner fill-in level (1 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 diff --git a/TestCases/cont_adj_rans/oneram6/turb_ONERAM6.cfg b/TestCases/cont_adj_rans/oneram6/turb_ONERAM6.cfg index 5c7f5c8dcdd8..ebfc62d342cd 100644 --- a/TestCases/cont_adj_rans/oneram6/turb_ONERAM6.cfg +++ b/TestCases/cont_adj_rans/oneram6/turb_ONERAM6.cfg @@ -11,12 +11,7 @@ % ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% % -% Physical governing equations (EULER, NAVIER_STOKES, -% PLASMA_EULER, PLASMA_NAVIER_STOKES, -% FREE_SURFACE_EULER, FREE_SURFACE_NAVIER_STOKES, -% FLUID_STRUCTURE_EULER, FLUID_STRUCTURE_NAVIER_STOKES, -% AEROACOUSTIC_EULER, AEROACOUSTIC_NAVIER_STOKES, -% WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY) +% Physical governing equations (EULER, NAVIER_STOKES, etc.) SOLVER= NAVIER_STOKES % % Specify turbulence model (NONE, SA, SA_NEG, SST) diff --git a/TestCases/coupled_cht/comp_2d/flow_cylinder.cfg b/TestCases/coupled_cht/comp_2d/flow_cylinder.cfg index c15f371c0d4d..bbc1ffd9c49a 100644 --- a/TestCases/coupled_cht/comp_2d/flow_cylinder.cfg +++ b/TestCases/coupled_cht/comp_2d/flow_cylinder.cfg @@ -97,7 +97,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Minimum error of the linear solver for implicit formulations diff --git a/TestCases/coupled_cht/comp_2d/solid_cylinder1.cfg b/TestCases/coupled_cht/comp_2d/solid_cylinder1.cfg index 06325af0a5e1..9f8ec43f71ed 100644 --- a/TestCases/coupled_cht/comp_2d/solid_cylinder1.cfg +++ b/TestCases/coupled_cht/comp_2d/solid_cylinder1.cfg @@ -89,7 +89,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Minimum error of the linear solver for implicit formulations diff --git a/TestCases/coupled_cht/comp_2d/solid_cylinder2.cfg b/TestCases/coupled_cht/comp_2d/solid_cylinder2.cfg index 05756d604714..bca1647b7dfd 100644 --- a/TestCases/coupled_cht/comp_2d/solid_cylinder2.cfg +++ b/TestCases/coupled_cht/comp_2d/solid_cylinder2.cfg @@ -98,7 +98,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Minimum error of the linear solver for implicit formulations diff --git a/TestCases/coupled_cht/comp_2d/solid_cylinder3.cfg b/TestCases/coupled_cht/comp_2d/solid_cylinder3.cfg index 22ee243c51b3..e834d1134beb 100644 --- a/TestCases/coupled_cht/comp_2d/solid_cylinder3.cfg +++ b/TestCases/coupled_cht/comp_2d/solid_cylinder3.cfg @@ -98,7 +98,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Minimum error of the linear solver for implicit formulations diff --git a/TestCases/coupled_cht/disc_adj_incomp_2d/flow_cylinder.cfg b/TestCases/coupled_cht/disc_adj_incomp_2d/flow_cylinder.cfg index aba99dce0511..c4c66039fd96 100644 --- a/TestCases/coupled_cht/disc_adj_incomp_2d/flow_cylinder.cfg +++ b/TestCases/coupled_cht/disc_adj_incomp_2d/flow_cylinder.cfg @@ -151,7 +151,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Minimum error of the linear solver for implicit formulations diff --git a/TestCases/coupled_cht/disc_adj_incomp_2d/solid_cylinder1.cfg b/TestCases/coupled_cht/disc_adj_incomp_2d/solid_cylinder1.cfg index 5e45bd1daad6..feccb6c2413c 100644 --- a/TestCases/coupled_cht/disc_adj_incomp_2d/solid_cylinder1.cfg +++ b/TestCases/coupled_cht/disc_adj_incomp_2d/solid_cylinder1.cfg @@ -89,7 +89,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Minimum error of the linear solver for implicit formulations diff --git a/TestCases/coupled_cht/disc_adj_incomp_2d/solid_cylinder2.cfg b/TestCases/coupled_cht/disc_adj_incomp_2d/solid_cylinder2.cfg index 6dcccea26062..b9a20fa95db7 100644 --- a/TestCases/coupled_cht/disc_adj_incomp_2d/solid_cylinder2.cfg +++ b/TestCases/coupled_cht/disc_adj_incomp_2d/solid_cylinder2.cfg @@ -98,7 +98,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Minimum error of the linear solver for implicit formulations diff --git a/TestCases/coupled_cht/disc_adj_incomp_2d/solid_cylinder3.cfg b/TestCases/coupled_cht/disc_adj_incomp_2d/solid_cylinder3.cfg index 47d064accbcf..f7576060b5dc 100644 --- a/TestCases/coupled_cht/disc_adj_incomp_2d/solid_cylinder3.cfg +++ b/TestCases/coupled_cht/disc_adj_incomp_2d/solid_cylinder3.cfg @@ -98,7 +98,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Minimum error of the linear solver for implicit formulations diff --git a/TestCases/coupled_cht/incomp_2d/flow_cylinder.cfg b/TestCases/coupled_cht/incomp_2d/flow_cylinder.cfg index c587d6907b3d..072923c45e3e 100644 --- a/TestCases/coupled_cht/incomp_2d/flow_cylinder.cfg +++ b/TestCases/coupled_cht/incomp_2d/flow_cylinder.cfg @@ -148,7 +148,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Minimum error of the linear solver for implicit formulations diff --git a/TestCases/coupled_cht/incomp_2d/solid_cylinder1.cfg b/TestCases/coupled_cht/incomp_2d/solid_cylinder1.cfg index df303ab245eb..ea93e593514e 100644 --- a/TestCases/coupled_cht/incomp_2d/solid_cylinder1.cfg +++ b/TestCases/coupled_cht/incomp_2d/solid_cylinder1.cfg @@ -89,7 +89,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Minimum error of the linear solver for implicit formulations diff --git a/TestCases/coupled_cht/incomp_2d/solid_cylinder2.cfg b/TestCases/coupled_cht/incomp_2d/solid_cylinder2.cfg index 3f2a7a5d5f65..4b296aedbc5d 100644 --- a/TestCases/coupled_cht/incomp_2d/solid_cylinder2.cfg +++ b/TestCases/coupled_cht/incomp_2d/solid_cylinder2.cfg @@ -98,7 +98,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Minimum error of the linear solver for implicit formulations diff --git a/TestCases/coupled_cht/incomp_2d/solid_cylinder3.cfg b/TestCases/coupled_cht/incomp_2d/solid_cylinder3.cfg index 3e33cbe1a989..201c4f681e79 100644 --- a/TestCases/coupled_cht/incomp_2d/solid_cylinder3.cfg +++ b/TestCases/coupled_cht/incomp_2d/solid_cylinder3.cfg @@ -98,7 +98,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Minimum error of the linear solver for implicit formulations diff --git a/TestCases/coupled_cht/incomp_2d_unsteady/flow_cylinder.cfg b/TestCases/coupled_cht/incomp_2d_unsteady/flow_cylinder.cfg index 75f4590a4814..a12beaa28d9b 100644 --- a/TestCases/coupled_cht/incomp_2d_unsteady/flow_cylinder.cfg +++ b/TestCases/coupled_cht/incomp_2d_unsteady/flow_cylinder.cfg @@ -135,7 +135,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Minimum error of the linear solver for implicit formulations diff --git a/TestCases/coupled_cht/incomp_2d_unsteady/solid_cylinder1.cfg b/TestCases/coupled_cht/incomp_2d_unsteady/solid_cylinder1.cfg index c424aca32456..56f56418c637 100644 --- a/TestCases/coupled_cht/incomp_2d_unsteady/solid_cylinder1.cfg +++ b/TestCases/coupled_cht/incomp_2d_unsteady/solid_cylinder1.cfg @@ -76,7 +76,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Minimum error of the linear solver for implicit formulations diff --git a/TestCases/coupled_cht/incomp_2d_unsteady/solid_cylinder2.cfg b/TestCases/coupled_cht/incomp_2d_unsteady/solid_cylinder2.cfg index 379a6eaf3803..1013307d8f46 100644 --- a/TestCases/coupled_cht/incomp_2d_unsteady/solid_cylinder2.cfg +++ b/TestCases/coupled_cht/incomp_2d_unsteady/solid_cylinder2.cfg @@ -76,7 +76,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Minimum error of the linear solver for implicit formulations diff --git a/TestCases/coupled_cht/incomp_2d_unsteady/solid_cylinder3.cfg b/TestCases/coupled_cht/incomp_2d_unsteady/solid_cylinder3.cfg index 439aa0f77e4b..2f5cdfd50cdd 100644 --- a/TestCases/coupled_cht/incomp_2d_unsteady/solid_cylinder3.cfg +++ b/TestCases/coupled_cht/incomp_2d_unsteady/solid_cylinder3.cfg @@ -76,7 +76,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Minimum error of the linear solver for implicit formulations diff --git a/TestCases/disc_adj_euler/arina2k/Arina2KRS.cfg b/TestCases/disc_adj_euler/arina2k/Arina2KRS.cfg index 501f16e9429b..d201209a6521 100644 --- a/TestCases/disc_adj_euler/arina2k/Arina2KRS.cfg +++ b/TestCases/disc_adj_euler/arina2k/Arina2KRS.cfg @@ -288,7 +288,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= LU_SGS % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Minimum error of the linear solver for implicit formulations diff --git a/TestCases/disc_adj_euler/cylinder3D/inv_cylinder3D.cfg b/TestCases/disc_adj_euler/cylinder3D/inv_cylinder3D.cfg index fe1b637bbba4..0ca25328f85d 100644 --- a/TestCases/disc_adj_euler/cylinder3D/inv_cylinder3D.cfg +++ b/TestCases/disc_adj_euler/cylinder3D/inv_cylinder3D.cfg @@ -206,7 +206,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Minimum error of the linear solver for implicit formulations diff --git a/TestCases/disc_adj_incomp_navierstokes/cylinder/heated_cylinder.cfg b/TestCases/disc_adj_incomp_navierstokes/cylinder/heated_cylinder.cfg index e54a8b047034..69485bc41d99 100644 --- a/TestCases/disc_adj_incomp_navierstokes/cylinder/heated_cylinder.cfg +++ b/TestCases/disc_adj_incomp_navierstokes/cylinder/heated_cylinder.cfg @@ -212,7 +212,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Minimum error of the linear solver for implicit formulations diff --git a/TestCases/disc_adj_incomp_rans/naca0012/turb_naca0012_sa.cfg b/TestCases/disc_adj_incomp_rans/naca0012/turb_naca0012_sa.cfg index 3ebb6e30fbcc..b6591fef723f 100755 --- a/TestCases/disc_adj_incomp_rans/naca0012/turb_naca0012_sa.cfg +++ b/TestCases/disc_adj_incomp_rans/naca0012/turb_naca0012_sa.cfg @@ -131,7 +131,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (JACOBI, LINELET, LU_SGS) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Minimum error of the linear solver for implicit formulations diff --git a/TestCases/disc_adj_incomp_rans/naca0012/turb_naca0012_sst.cfg b/TestCases/disc_adj_incomp_rans/naca0012/turb_naca0012_sst.cfg index 1b7577fe53ed..d615f549ff2e 100755 --- a/TestCases/disc_adj_incomp_rans/naca0012/turb_naca0012_sst.cfg +++ b/TestCases/disc_adj_incomp_rans/naca0012/turb_naca0012_sst.cfg @@ -131,7 +131,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (JACOBI, LINELET, LU_SGS) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Minimum error of the linear solver for implicit formulations diff --git a/TestCases/gust/inv_gust_NACA0012.cfg b/TestCases/gust/inv_gust_NACA0012.cfg index 61950875cf14..c3d44d246925 100644 --- a/TestCases/gust/inv_gust_NACA0012.cfg +++ b/TestCases/gust/inv_gust_NACA0012.cfg @@ -72,7 +72,7 @@ INNER_ITER= 100 % ----------------------- DYNAMIC MESH DEFINITION -----------------------------% % % Type of dynamic mesh (NONE, RIGID_MOTION, DEFORMING, ROTATING_FRAME, -% MOVING_WALL, FLUID_STRUCTURE, AEROELASTIC, ELASTICITY, +% MOVING_WALL, AEROELASTIC, ELASTICITY, % EXTERNAL, AEROELASTIC_RIGID_MOTION) GRID_MOVEMENT= GUST % diff --git a/TestCases/hybrid_regression.py b/TestCases/hybrid_regression.py index f1ea011f4f50..d69473c646ff 100644 --- a/TestCases/hybrid_regression.py +++ b/TestCases/hybrid_regression.py @@ -210,6 +210,18 @@ def main(): propeller.test_vals = [-3.389576, -8.409529, 0.000048, 0.056329] test_list.append(propeller) + ####################################### + ### Axisymmetric Compressible RANS ### + ####################################### + + # Axisymmetric air nozzle (transonic) + axi_rans_air_nozzle = TestCase('axi_rans_air_nozzle') + axi_rans_air_nozzle.cfg_dir = "axisymmetric_rans/air_nozzle" + axi_rans_air_nozzle.cfg_file = "air_nozzle.cfg" + axi_rans_air_nozzle.test_iter = 10 + axi_rans_air_nozzle.test_vals = [-12.094937, -6.622043, -8.814412, -2.393288] + test_list.append(axi_rans_air_nozzle) + ################################# ## Compressible RANS Restart ### ################################# diff --git a/TestCases/incomp_euler/nozzle/inv_nozzle.cfg b/TestCases/incomp_euler/nozzle/inv_nozzle.cfg index fc9eb30d4ed0..c5b6e21df541 100644 --- a/TestCases/incomp_euler/nozzle/inv_nozzle.cfg +++ b/TestCases/incomp_euler/nozzle/inv_nozzle.cfg @@ -119,7 +119,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Minimum error of the linear solver for implicit formulations diff --git a/TestCases/incomp_navierstokes/buoyancy_cavity/lam_buoyancy_cavity.cfg b/TestCases/incomp_navierstokes/buoyancy_cavity/lam_buoyancy_cavity.cfg index 52371510ccc2..8f07b27a0640 100644 --- a/TestCases/incomp_navierstokes/buoyancy_cavity/lam_buoyancy_cavity.cfg +++ b/TestCases/incomp_navierstokes/buoyancy_cavity/lam_buoyancy_cavity.cfg @@ -144,7 +144,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (JACOBI, LINELET, LU_SGS) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Min error of the linear solver for the implicit formulation diff --git a/TestCases/incomp_navierstokes/cylinder/poly_cylinder.cfg b/TestCases/incomp_navierstokes/cylinder/poly_cylinder.cfg index c9b8c73ca425..99f14c72867a 100644 --- a/TestCases/incomp_navierstokes/cylinder/poly_cylinder.cfg +++ b/TestCases/incomp_navierstokes/cylinder/poly_cylinder.cfg @@ -195,7 +195,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Minimum error of the linear solver for implicit formulations diff --git a/TestCases/incomp_rans/rough_flatplate/rough_flatplate_incomp.cfg b/TestCases/incomp_rans/rough_flatplate/rough_flatplate_incomp.cfg index ce00494b14d9..8b50e4df8e2b 100644 --- a/TestCases/incomp_rans/rough_flatplate/rough_flatplate_incomp.cfg +++ b/TestCases/incomp_rans/rough_flatplate/rough_flatplate_incomp.cfg @@ -155,7 +155,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (JACOBI, LINELET, LU_SGS) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Minimum error of the linear solver for implicit formulations diff --git a/TestCases/mms/fvm_incomp_euler/inv_mms_jst.cfg b/TestCases/mms/fvm_incomp_euler/inv_mms_jst.cfg index a7017d93c384..d8331a7080a3 100755 --- a/TestCases/mms/fvm_incomp_euler/inv_mms_jst.cfg +++ b/TestCases/mms/fvm_incomp_euler/inv_mms_jst.cfg @@ -111,7 +111,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (JACOBI, LINELET, LU_SGS) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Minimum error of the linear solver for implicit formulations diff --git a/TestCases/mms/fvm_incomp_navierstokes/lam_mms_fds.cfg b/TestCases/mms/fvm_incomp_navierstokes/lam_mms_fds.cfg index cfabd77e7300..20a25bbd8aad 100755 --- a/TestCases/mms/fvm_incomp_navierstokes/lam_mms_fds.cfg +++ b/TestCases/mms/fvm_incomp_navierstokes/lam_mms_fds.cfg @@ -129,7 +129,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (JACOBI, LINELET, LU_SGS) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Minimum error of the linear solver for implicit formulations diff --git a/TestCases/mms/fvm_navierstokes/lam_mms_roe.cfg b/TestCases/mms/fvm_navierstokes/lam_mms_roe.cfg index 011294a777ba..a55057a7b202 100755 --- a/TestCases/mms/fvm_navierstokes/lam_mms_roe.cfg +++ b/TestCases/mms/fvm_navierstokes/lam_mms_roe.cfg @@ -146,7 +146,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (JACOBI, LINELET, LU_SGS) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Minimum error of the linear solver for implicit formulations diff --git a/TestCases/moving_wall/cavity/lam_cavity.cfg b/TestCases/moving_wall/cavity/lam_cavity.cfg index 545e44b297b5..f6f7378821e0 100644 --- a/TestCases/moving_wall/cavity/lam_cavity.cfg +++ b/TestCases/moving_wall/cavity/lam_cavity.cfg @@ -48,8 +48,7 @@ REYNOLDS_LENGTH= 1.0 % ----------------------- DYNAMIC MESH DEFINITION -----------------------------% % % Type of dynamic mesh (NONE, RIGID_MOTION, DEFORMING, ROTATING_FRAME, -% MOVING_WALL, FLUID_STRUCTURE, AEROELASTIC, ELASTICITY, -% EXTERNAL) +% MOVING_WALL, AEROELASTIC, ELASTICITY, EXTERNAL) SURFACE_MOVEMENT= MOVING_WALL % % Motion mach number (non-dimensional). Used for initializing a viscous flow diff --git a/TestCases/moving_wall/spinning_cylinder/spinning_cylinder.cfg b/TestCases/moving_wall/spinning_cylinder/spinning_cylinder.cfg index 4dc1a80d0a7b..534193074e4e 100644 --- a/TestCases/moving_wall/spinning_cylinder/spinning_cylinder.cfg +++ b/TestCases/moving_wall/spinning_cylinder/spinning_cylinder.cfg @@ -48,7 +48,7 @@ REYNOLDS_LENGTH= 1.0 % ----------------------- DYNAMIC MESH DEFINITION -----------------------------% % % Type of dynamic mesh (NONE, RIGID_MOTION, DEFORMING, ROTATING_FRAME, -% MOVING_WALL, FLUID_STRUCTURE, AEROELASTIC, EXTERNAL) +% MOVING_WALL, AEROELASTIC, EXTERNAL) SURFACE_MOVEMENT= MOVING_WALL % % Motion mach number (non-dimensional). Used for intitializing a viscous flow diff --git a/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_2surf_1obj.cfg b/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_2surf_1obj.cfg index 30f8b9432d1e..41cd1505c4e3 100644 --- a/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_2surf_1obj.cfg +++ b/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_2surf_1obj.cfg @@ -111,7 +111,7 @@ LINEAR_SOLVER_ITER= 5 % Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (1 by default) +% Linear solver ILU preconditioner fill-in level (1 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 diff --git a/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_multiobj.cfg b/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_multiobj.cfg index 24171325ad6d..40d5597280de 100644 --- a/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_multiobj.cfg +++ b/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_multiobj.cfg @@ -112,7 +112,7 @@ LINEAR_SOLVER_ITER= 5 % Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (1 by default) +% Linear solver ILU preconditioner fill-in level (1 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 diff --git a/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_multiobj_1surf.cfg b/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_multiobj_1surf.cfg index 09bc08fd8650..a4165b7d9dc2 100644 --- a/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_multiobj_1surf.cfg +++ b/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_multiobj_1surf.cfg @@ -112,7 +112,7 @@ LINEAR_SOLVER_ITER= 5 % Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (1 by default) +% Linear solver ILU preconditioner fill-in level (1 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 diff --git a/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_multiobj_combo.cfg b/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_multiobj_combo.cfg index 767b543cac4f..8affe19a7dbf 100644 --- a/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_multiobj_combo.cfg +++ b/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_multiobj_combo.cfg @@ -114,7 +114,7 @@ LINEAR_SOLVER_ITER= 5 % Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (1 by default) +% Linear solver ILU preconditioner fill-in level (1 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 diff --git a/TestCases/optimization_euler/pitching_naca64a010/pitching_NACA64A010.cfg b/TestCases/optimization_euler/pitching_naca64a010/pitching_NACA64A010.cfg index 8d22b6507446..f5fa022f1b4e 100644 --- a/TestCases/optimization_euler/pitching_naca64a010/pitching_NACA64A010.cfg +++ b/TestCases/optimization_euler/pitching_naca64a010/pitching_NACA64A010.cfg @@ -51,7 +51,7 @@ UNST_ADJOINT_ITER= 251 % Dynamic mesh simulation (NO, YES) GRID_MOVEMENT= YES % -% Type of mesh motion (NONE, FLUTTER, RIGID_MOTION, FLUID_STRUCTURE) +% Type of mesh motion (NONE, FLUTTER, RIGID_MOTION) GRID_MOVEMENT_KIND= RIGID_MOTION % % Motion mach number (non-dimensional). Used for initializing a viscous flow diff --git a/TestCases/optimization_euler/pitching_oneram6/pitching_ONERAM6.cfg b/TestCases/optimization_euler/pitching_oneram6/pitching_ONERAM6.cfg index 8a1ab1851c2b..d9ca2a72dd7a 100644 --- a/TestCases/optimization_euler/pitching_oneram6/pitching_ONERAM6.cfg +++ b/TestCases/optimization_euler/pitching_oneram6/pitching_ONERAM6.cfg @@ -65,7 +65,7 @@ UNST_ADJOINT_ITER= 251 GRID_MOVEMENT= YES % % Type of dynamic mesh (NONE, RIGID_MOTION, DEFORMING, ROTATING_FRAME, -% MOVING_WALL, FLUID_STRUCTURE, AEROELASTIC, EXTERNAL) +% MOVING_WALL, AEROELASTIC, EXTERNAL) GRID_MOVEMENT_KIND= RIGID_MOTION % % Motion mach number (non-dimensional). Used for intitializing a viscous flow diff --git a/TestCases/optimization_euler/rotating_naca0012/rotating_NACA0012.cfg b/TestCases/optimization_euler/rotating_naca0012/rotating_NACA0012.cfg index ff3a00c420f0..83801d29d8c5 100644 --- a/TestCases/optimization_euler/rotating_naca0012/rotating_NACA0012.cfg +++ b/TestCases/optimization_euler/rotating_naca0012/rotating_NACA0012.cfg @@ -58,7 +58,7 @@ REF_AREA= 1.0 GRID_MOVEMENT= YES % % Type of dynamic mesh (NONE, RIGID_MOTION, DEFORMING, ROTATING_FRAME, -% MOVING_WALL, FLUID_STRUCTURE, AEROELASTIC, EXTERNAL) +% MOVING_WALL, AEROELASTIC, EXTERNAL) GRID_MOVEMENT_KIND= ROTATING_FRAME % % Motion mach number (non-dimensional). Used for intitializing a viscous flow diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index c7ec41d0a580..68dc0e3c29d2 100644 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -59,7 +59,7 @@ def main(): thermalbath_frozen.cfg_dir = "nonequilibrium/thermalbath/frozen" thermalbath_frozen.cfg_file = "thermalbath_frozen.cfg" thermalbath_frozen.test_iter = 10 - thermalbath_frozen.test_vals = [ -32.000000, -32.000000, -11.92359, -11.962329, -32.000000, 10.813864] + thermalbath_frozen.test_vals = [ -32.000000, -32.000000, -11.92359, -11.962329, -32.000000, 10.813864] thermalbath_frozen.su2_exec = "mpirun -n 2 SU2_CFD" thermalbath_frozen.timeout = 1600 thermalbath_frozen.new_output = True @@ -347,6 +347,21 @@ def main(): propeller.tol = 0.00001 test_list.append(propeller) + ####################################### + ### Axisymmetric Compressible RANS ### + ####################################### + + # Axisymmetric air nozzle (transonic) + axi_rans_air_nozzle = TestCase('axi_rans_air_nozzle') + axi_rans_air_nozzle.cfg_dir = "axisymmetric_rans/air_nozzle" + axi_rans_air_nozzle.cfg_file = "air_nozzle.cfg" + axi_rans_air_nozzle.test_iter = 10 + axi_rans_air_nozzle.test_vals = [ -12.096569, -6.625843, -8.807541, -2.393279] + axi_rans_air_nozzle.su2_exec = "mpirun -n 2 SU2_CFD" + axi_rans_air_nozzle.timeout = 1600 + axi_rans_air_nozzle.tol = 0.0001 + test_list.append(axi_rans_air_nozzle) + ################################# ## Compressible RANS Restart ### ################################# @@ -1298,7 +1313,7 @@ def main(): pywrapper_rigidMotion.cfg_dir = "py_wrapper/flatPlate_rigidMotion" pywrapper_rigidMotion.cfg_file = "flatPlate_rigidMotion_Conf.cfg" pywrapper_rigidMotion.test_iter = 5 - pywrapper_rigidMotion.test_vals = [-1.614165, 2.242641, -0.038307, 0.173866] + pywrapper_rigidMotion.test_vals = [-1.551335, 2.295594, 0.350036, 0.093081] pywrapper_rigidMotion.su2_exec = "mpirun -np 2 python launch_flatPlate_rigidMotion.py --parallel -f" pywrapper_rigidMotion.timeout = 1600 pywrapper_rigidMotion.tol = 0.00001 diff --git a/TestCases/py_wrapper/flatPlate_rigidMotion/flatPlate_rigidMotion_Conf.cfg b/TestCases/py_wrapper/flatPlate_rigidMotion/flatPlate_rigidMotion_Conf.cfg index 0ebe07328e12..faece71a8edd 100644 --- a/TestCases/py_wrapper/flatPlate_rigidMotion/flatPlate_rigidMotion_Conf.cfg +++ b/TestCases/py_wrapper/flatPlate_rigidMotion/flatPlate_rigidMotion_Conf.cfg @@ -22,29 +22,9 @@ KIND_TURB_MODEL= SST % Mathematical problem (DIRECT, CONTINUOUS_ADJOINT, DISCRETE_ADJOINT) MATH_PROBLEM= DIRECT % -% -% Axisymmetric simulation, only compressible flows (NO, YES) -AXISYMMETRIC= NO -% % Restart solution (NO, YES) RESTART_SOL= NO % -% Discard the data storaged in the solution and geometry files -% e.g. AOA, dCL/dAoA, dCD/dCL, iter, etc. -% Note that AoA in the solution and geometry files is critical -% to aero design using AoA as a variable. (NO, YES) -DISCARD_INFILES= NO -% -% System of measurements (SI, US) -% International system of units (SI): ( meters, kilograms, Kelvins, -% Newtons = kg m/s^2, Pascals = N/m^2, -% Density = kg/m^3, Speed = m/s, -% Equiv. Area = m^2 ) -% United States customary units (US): ( inches, slug, Rankines, lbf = slug ft/s^2, -% psf = lbf/ft^2, Density = slug/ft^3, -% Speed = ft/s, Equiv. Area = ft^2 ) -SYSTEM_MEASUREMENTS= SI - % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% % % Mach number (non-dimensional, based on the free-stream values) @@ -53,9 +33,6 @@ MACH_NUMBER= 0.03059 % Angle of attack (degrees, only for compressible flows) AOA= 0.0 % -% Side-slip angle (degrees, only for compressible flows) -SIDESLIP_ANGLE= 0.0 -% % Init option to choose between Reynolds (default) or thermodynamics quantities % for initializing the solution (REYNOLDS, TD_CONDITIONS) INIT_OPTION= REYNOLDS @@ -64,9 +41,6 @@ INIT_OPTION= REYNOLDS % initializing the solution (TEMPERATURE_FS, DENSITY_FS) FREESTREAM_OPTION= TEMPERATURE_FS % -% Free-stream pressure (101325.0 N/m^2, 2116.216 psf by default) -FREESTREAM_PRESSURE= 101325.0 -% % Free-stream temperature (288.15 K, 518.67 R by default) FREESTREAM_TEMPERATURE= 293.15 % @@ -75,18 +49,7 @@ REYNOLDS_NUMBER= 24407.25244 % % Reynolds length (1 m, 1 inch by default) REYNOLDS_LENGTH= 0.035 - -% -------------------- INCOMPRESSIBLE FREE-STREAM DEFINITION ------------------% % -% Free-stream density (1.2886 Kg/m^3, 0.0025 slug/ft^3 by default) -FREESTREAM_DENSITY= 1.204 -% -% Free-stream velocity (1.0 m/s, 1.0 ft/s by default) -FREESTREAM_VELOCITY= ( 1.0, 0.00, 0.00 ) -% -% Free-stream viscosity (1.853E-5 N s/m^2, 3.87E-7 lbf s/ft^2 by default) -FREESTREAM_VISCOSITY= 1.82E-5 - % ---------------------- REFERENCE VALUE DEFINITION ---------------------------% % % Reference origin for moment computation (m or in) @@ -101,60 +64,25 @@ REF_LENGTH= 0.035 % calculation) (m^2 or in^2) REF_AREA= 0.035 % -% Aircraft semi-span (0 implies automatic calculation) (m or in) -SEMI_SPAN= 0.0 -% % Flow non-dimensionalization (DIMENSIONAL, FREESTREAM_PRESS_EQ_ONE, % FREESTREAM_VEL_EQ_MACH, FREESTREAM_VEL_EQ_ONE) REF_DIMENSIONALIZATION= DIMENSIONAL - +% % ---- IDEAL GAS, POLYTROPIC, VAN DER WAALS AND PENG ROBINSON CONSTANTS -------% % % Different gas model (STANDARD_AIR, IDEAL_GAS, VW_GAS, PR_GAS) FLUID_MODEL= STANDARD_AIR % -% Ratio of specific heats (1.4 default and the value is hardcoded -% for the model STANDARD_AIR) -GAMMA_VALUE= 1.4 -% -% Specific gas constant (287.058 J/kg*K default and this value is hardcoded -% for the model STANDARD_AIR) -GAS_CONSTANT= 287.058 -% -% Critical Temperature (131.00 K by default) -CRITICAL_TEMPERATURE= 131.00 -% -% Critical Pressure (3588550.0 N/m^2 by default) -CRITICAL_PRESSURE= 3588550.0 -% -% Acentri factor (0.035 (air)) -ACENTRIC_FACTOR= 0.035 - % --------------------------- VISCOSITY MODEL ---------------------------------% % % Viscosity model (SUTHERLAND, CONSTANT_VISCOSITY). VISCOSITY_MODEL= SUTHERLAND % -% Molecular Viscosity that would be constant (1.716E-5 by default) -MU_CONSTANT= 1.716E-5 -% -% Sutherland Viscosity Ref (1.716E-5 default value for AIR SI) -MU_REF= 1.716E-5 -% -% Sutherland Temperature Ref (273.15 K default value for AIR SI) -MU_T_REF= 273.15 -% -% Sutherland constant (110.4 default value for AIR SI) -SUTHERLAND_CONSTANT= 110.4 - % --------------------------- THERMAL CONDUCTIVITY MODEL ----------------------% % % Conductivity model (CONSTANT_CONDUCTIVITY, CONSTANT_PRANDTL). CONDUCTIVITY_MODEL= CONSTANT_PRANDTL % -% Molecular Thermal Conductivity that would be constant (0.0257 by default) -KT_CONSTANT= 0.0257 - % ------------------------- UNSTEADY SIMULATION -------------------------------% % TIME_DOMAIN=YES @@ -167,54 +95,20 @@ TIME_STEP= 0.003 % % Total Physical Time for dual time stepping simulations (s) MAX_TIME= 1.0 -% -% Unsteady Courant-Friedrichs-Lewy number of the finest grid -UNST_CFL_NUMBER= 0.0 +TIME_ITER = 9999 % % Number of internal iterations (dual time method) INNER_ITER= 10 % % Iteration number to begin unsteady restarts RESTART_ITER= 0 - -TIME_ITER=9999 % ----------------------- DYNAMIC MESH DEFINITION -----------------------------% -% Type of dynamic mesh (NONE, RIGID_MOTION, DEFORMING, ROTATING_FRAME, -% MOVING_WALL, STEADY_TRANSLATION, FLUID_STRUCTURE, -% AEROELASTIC, ELASTICITY, EXTERNAL, -% AEROELASTIC_RIGID_MOTION, GUST) -SURFACE_MOVEMENT= FLUID_STRUCTURE -% -% 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.03059 -% -% Moving wall boundary marker(s) (NONE = no marker, ignored for RIGID_MOTION) -MARKER_MOVING= ( plate ) -% -% Coordinates of the motion origin -SURFACE_MOTION_ORIGIN= -0.0028 0.0 0.0 -% -% Move Motion Origin for marker moving (1 or 0) -MOVE_MOTION_ORIGIN = 1 - -% ----------------------- BODY FORCE DEFINITION -------------------------------% % -% Apply a body force as a source term (NO, YES) -BODY_FORCE= NO +DEFORM_MESH = YES +MARKER_DEFORM_MESH = (plate) % -% Vector of body force values (BodyForce_X, BodyForce_Y, BodyForce_Z) -BODY_FORCE_VECTOR= ( 0.0, 0.0, 0.0 ) - % -------------------- BOUNDARY CONDITION DEFINITION --------------------------% % -% Euler wall boundary marker(s) (NONE = no marker) -MARKER_EULER= ( NONE ) -% -% Navier-Stokes (no-slip), constant heat flux wall marker(s) (NONE = no marker) -% Format: ( marker name, constant heat flux (J/m^2), ... ) -%MARKER_HEATFLUX= ( plate, 1000.0 ) -% % Navier-Stokes (no-slip), isothermal wall marker(s) (NONE = no marker) % Format: ( marker name, constant wall temperature (K), ... ) MARKER_ISOTHERMAL= ( plate, 293 ) @@ -230,22 +124,6 @@ MARKER_PLOTTING = ( plate ) % Marker(s) of the surface where the non-dimensional coefficients are evaluated. MARKER_MONITORING = ( plate ) % -% Viscous wall markers for which wall functions must be applied. (NONE = no marker) -% Format: ( marker name, wall function type, ... ) -MARKER_WALL_FUNCTIONS= ( plate, NO_WALL_FUNCTION ) -% -% Marker(s) of the surface where custom thermal BC's are defined. -MARKER_PYTHON_CUSTOM = (NONE) -% -% Marker(s) of the surface where obj. func. (design problem) will be evaluated -MARKER_DESIGNING = ( NONE ) -% -% Marker(s) of the surface that is going to be analyzed in detail (massflow, average pressure, distortion, etc) -MARKER_ANALYZE = ( NONE ) -% -% Method to compute the average value in MARKER_ANALYZE (AREA, MASSFLUX). -MARKER_ANALYZE_AVERAGE = MASSFLUX - % ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% % % Numerical method for spatial gradients (GREEN_GAUSS, WEIGHTED_LEAST_SQUARES) @@ -254,99 +132,16 @@ NUM_METHOD_GRAD= WEIGHTED_LEAST_SQUARES % CFL number (initial value for the adaptive CFL number) CFL_NUMBER= 7.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.25, 50.0 ) -% -% Maximum Delta Time in local time stepping simulations -MAX_DELTA_TIME= 1E6 -% -% Runge-Kutta alpha coefficients -RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) -% -% Objective function in gradient evaluation (DRAG, LIFT, SIDEFORCE, MOMENT_X, -% MOMENT_Y, MOMENT_Z, EFFICIENCY, -% EQUIVALENT_AREA, NEARFIELD_PRESSURE, -% FORCE_X, FORCE_Y, FORCE_Z, THRUST, -% TORQUE, TOTAL_HEATFLUX, -% MAXIMUM_HEATFLUX, INVERSE_DESIGN_PRESSURE, -% INVERSE_DESIGN_HEATFLUX, SURFACE_TOTAL_PRESSURE, -% SURFACE_MASSFLOW, SURFACE_STATIC_PRESSURE, SURFACE_MACH) -% For a weighted sum of objectives: separate by commas, add OBJECTIVE_WEIGHT and MARKER_MONITORING in matching order. -OBJECTIVE_FUNCTION= DRAG -% -% List of weighting values when using more than one OBJECTIVE_FUNCTION. Separate by commas and match with MARKER_MONITORING. -OBJECTIVE_WEIGHT = 1.0 -% -% Reference coefficient (sensitivity) for detecting sharp edges. -REF_SHARP_EDGES= 3.0 -% -% Remove sharp edges from the sensitivity evaluation (NO, YES) -SENS_REMOVE_SHARP= NO - % ----------- SLOPE LIMITER AND DISSIPATION SENSOR DEFINITION -----------------% % % Monotonic Upwind Scheme for Conservation Laws (TVD) in the flow equations. % Required for 2nd order upwind schemes (NO, YES) -MUSCL_FLOW= YES -% -% Slope limiter (NONE, VENKATAKRISHNAN, VENKATAKRISHNAN_WANG, -% BARTH_JESPERSEN, VAN_ALBADA_EDGE) -SLOPE_LIMITER_FLOW= VENKATAKRISHNAN +MUSCL_FLOW= NO % % Monotonic Upwind Scheme for Conservation Laws (TVD) in the turbulence equations. % Required for 2nd order upwind schemes (NO, YES) MUSCL_TURB= NO % -% Slope limiter (NONE, VENKATAKRISHNAN, VENKATAKRISHNAN_WANG, -% BARTH_JESPERSEN, VAN_ALBADA_EDGE) -SLOPE_LIMITER_TURB= VENKATAKRISHNAN -% -% Monotonic Upwind Scheme for Conservation Laws (TVD) in the adjoint flow equations. -% Required for 2nd order upwind schemes (NO, YES) -MUSCL_ADJFLOW= YES -% -% Slope limiter (NONE, VENKATAKRISHNAN, BARTH_JESPERSEN, VAN_ALBADA_EDGE, -% SHARP_EDGES, WALL_DISTANCE) -SLOPE_LIMITER_ADJFLOW= VENKATAKRISHNAN -% -% Monotonic Upwind Scheme for Conservation Laws (TVD) in the turbulence adjoint equations. -% Required for 2nd order upwind schemes (NO, YES) -MUSCL_ADJTURB= NO -% -% Slope limiter (NONE, VENKATAKRISHNAN, BARTH_JESPERSEN, VAN_ALBADA_EDGE) -SLOPE_LIMITER_ADJTURB= VENKATAKRISHNAN -% -% Coefficient for the Venkat's limiter (upwind scheme). A larger values decrease -% the extent of limiting, values approaching zero cause -% lower-order approximation to the solution (0.05 by default) -VENKAT_LIMITER_COEFF= 0.05 -% -% Coefficient for the adjoint sharp edges limiter (3.0 by default). -ADJ_SHARP_LIMITER_COEFF= 3.0 -% -% Freeze the value of the limiter after a number of iterations -LIMITER_ITER= 999999 -% -% 1st order artificial dissipation coefficients for -% the Lax–Friedrichs method ( 0.15 by default ) -LAX_SENSOR_COEFF= 0.15 -% -% 2nd and 4th order artificial dissipation coefficients for -% the JST method ( 0.5, 0.02 by default ) -JST_SENSOR_COEFF= ( 0.5, 0.02 ) -% -% 1st order artificial dissipation coefficients for -% the adjoint Lax–Friedrichs method ( 0.15 by default ) -ADJ_LAX_SENSOR_COEFF= 0.15 -% -% 2nd, and 4th order artificial dissipation coefficients for -% the adjoint JST method ( 0.5, 0.02 by default ) -ADJ_JST_SENSOR_COEFF= ( 0.5, 0.02 ) - % ------------------------ LINEAR SOLVER DEFINITION ---------------------------% % % Linear solver or smoother for implicit formulations (BCGSTAB, FGMRES, SMOOTHER) @@ -355,7 +150,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Minimum error of the linear solver for implicit formulations @@ -367,26 +162,8 @@ LINEAR_SOLVER_ITER= 10 % -------------------------- MULTIGRID PARAMETERS -----------------------------% % % Multi-grid levels (0 = no multi-grid) -MGLEVEL= 3 -% -% Multi-grid cycle (V_CYCLE, W_CYCLE, FULLMG_CYCLE) -MGCYCLE= W_CYCLE -% -% Multi-grid pre-smoothing level -MG_PRE_SMOOTH= ( 1, 2, 3, 3 ) -% -% Multi-grid post-smoothing level -MG_POST_SMOOTH= ( 0, 0, 0, 0 ) -% -% Jacobi implicit smoothing of the correction -MG_CORRECTION_SMOOTH= ( 0, 0, 0, 0 ) +MGLEVEL= 0 % -% Damping factor for the residual restriction -MG_DAMP_RESTRICTION= 0.75 -% -% Damping factor for the correction prolongation -MG_DAMP_PROLONGATION= 0.75 - % -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% % % Convective numerical method (JST, LAX-FRIEDRICH, CUSP, ROE, AUSM, HLLC, @@ -397,8 +174,7 @@ CONV_NUM_METHOD_FLOW= JST % Time discretization (RUNGE-KUTTA_EXPLICIT, EULER_IMPLICIT, EULER_EXPLICIT) TIME_DISCRE_FLOW= EULER_IMPLICIT % -% Relaxation coefficient - +% % -------------------- TURBULENT NUMERICAL METHOD DEFINITION ------------------% % % Convective numerical method (SCALAR_UPWIND) @@ -407,11 +183,6 @@ CONV_NUM_METHOD_TURB= SCALAR_UPWIND % Time discretization (EULER_IMPLICIT) TIME_DISCRE_TURB= EULER_IMPLICIT % -% Reduction factor of the CFL coefficient in the turbulence problem -CFL_REDUCTION_TURB= 1.0 -% -% Relaxation coefficient - % ------------------------ GRID DEFORMATION PARAMETERS ------------------------% % % Linear solver or smoother for implicit formulations (FGMRES, RESTARTED_FGMRES, BCGSTAB) @@ -432,38 +203,11 @@ DEFORM_CONSOLE_OUTPUT= YES % Minimum residual criteria for the linear solver convergence of grid deformation DEFORM_LINEAR_SOLVER_ERROR= 1E-14 % -% Deformation coefficient (linear elasticity limits from -1.0 to 0.5, a larger -% value is also possible) -DEFORM_COEFF = 1E6 % % Type of element stiffness imposed for FEA mesh deformation (INVERSE_VOLUME, % WALL_DISTANCE, CONSTANT_STIFFNESS) -DEFORM_STIFFNESS_TYPE= INVERSE_VOLUME -% -% Deform the grid only close to the surface. It is possible to specify how much -% of the volumetric grid is going to be deformed in meters or inches (1E6 by default) -DEFORM_LIMIT = 1E6 - -% --------------------------- CONVERGENCE PARAMETERS --------------------------% -% Convergence criteria (CAUCHY, RESIDUAL) -% -CONV_CRITERIA= CAUCHY -% -% -% Min value of the residual (log10 of the residual) -CONV_RESIDUAL_MINVAL= -10 +DEFORM_STIFFNESS_TYPE= WALL_DISTANCE % -% Start convergence criteria at iteration number -CONV_STARTITER= 4 -% -% Number of elements to apply the criteria -CONV_CAUCHY_ELEMS= 10 -% -% Epsilon to control the series convergence -CONV_CAUCHY_EPS= 1E-6 -% -% - % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % % Mesh input file @@ -472,55 +216,23 @@ MESH_FILENAME= 2D_FlatPlate_Rounded.su2 % Mesh input file format (SU2, CGNS) MESH_FORMAT= SU2 % -% Mesh output file -MESH_OUT_FILENAME= mesh_out.su2 -% -% Restart flow input file -SOLUTION_FILENAME= restart_flow.dat -% -% Restart adjoint input file -SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (TECPLOT, TECPLOT_BINARY, PARAVIEW, % FIELDVIEW, FIELDVIEW_BINARY) -TABULAR_FORMAT= CSV +TABULAR_FORMAT= TECPLOT % % Output file convergence history (w/o extension) CONV_FILENAME= history % -% Output file with the forces breakdown -BREAKDOWN_FILENAME= forces_breakdown.dat -% -% Output file restart flow -RESTART_FILENAME= restart_flow.dat -% -% Output file restart adjoint -RESTART_ADJ_FILENAME= restart_adj.dat -% % Output file flow (w/o extension) variables VOLUME_FILENAME= flow % -% Output file adjoint (w/o extension) variables -VOLUME_ADJ_FILENAME= adjoint -% -% Output Objective function -VALUE_OBJFUNC_FILENAME= of_eval.dat -% -% Output objective function gradient (using continuous adjoint) -GRAD_OBJFUNC_FILENAME= of_grad.dat -% % Output file surface flow coefficient (w/o extension) SURFACE_FILENAME= surface_flow % -% Output file surface adjoint coefficient (w/o extension) -SURFACE_ADJ_FILENAME= surface_adjoint -% % Writing solution file frequency for physical time steps (dual time) OUTPUT_WRT_FREQ= 3 % -% -% Read binary restart files (YES, NO) -READ_BINARY_RESTART= YES -% % Screen output SCREEN_OUTPUT= (TIME_ITER, INNER_ITER, RMS_DENSITY, RMS_TKE, RMS_DISSIPATION, LIFT, DRAG) +HISTORY_OUTPUT=(ITER,RMS_RES,AERO_COEFF) diff --git a/TestCases/py_wrapper/flatPlate_rigidMotion/launch_flatPlate_rigidMotion.py b/TestCases/py_wrapper/flatPlate_rigidMotion/launch_flatPlate_rigidMotion.py index 6c6a97a8f1f9..a611e6554d79 100755 --- a/TestCases/py_wrapper/flatPlate_rigidMotion/launch_flatPlate_rigidMotion.py +++ b/TestCases/py_wrapper/flatPlate_rigidMotion/launch_flatPlate_rigidMotion.py @@ -46,7 +46,7 @@ import numpy as np # ------------------------------------------------------------------- -# Main +# Main # ------------------------------------------------------------------- def main(): @@ -54,38 +54,12 @@ def main(): # Command line options parser=OptionParser() parser.add_option("-f", "--file", dest="filename", help="Read config from FILE", metavar="FILE") - parser.add_option("--nDim", dest="nDim", default=2, help="Define the number of DIMENSIONS", - metavar="DIMENSIONS") - parser.add_option("--nZone", dest="nZone", default=1, help="Define the number of ZONES", - metavar="ZONES") parser.add_option("--parallel", action="store_true", help="Specify if we need to initialize MPI", dest="with_MPI", default=False) - parser.add_option("--fsi", dest="fsi", default="False", help="Launch the FSI driver", metavar="FSI") - - parser.add_option("--fem", dest="fem", default="False", help="Launch the FEM driver (General driver)", metavar="FEM") - - parser.add_option("--harmonic_balance", dest="harmonic_balance", default="False", - help="Launch the Harmonic Balance (HB) driver", metavar="HB") - - parser.add_option("--poisson_equation", dest="poisson_equation", default="False", - help="Launch the poisson equation driver (General driver)", metavar="POIS_EQ") - - parser.add_option("--wave_equation", dest="wave_equation", default="False", - help="Launch the wave equation driver (General driver)", metavar="WAVE_EQ") - - parser.add_option("--heat_equation", dest="heat_equation", default="False", - help="Launch the heat equation driver (General driver)", metavar="HEAT_EQ") - (options, args) = parser.parse_args() - options.nDim = int( options.nDim ) - options.nZone = int( options.nZone ) - options.fsi = options.fsi.upper() == 'TRUE' - options.fem = options.fem.upper() == 'TRUE' - options.harmonic_balance = options.harmonic_balance.upper() == 'TRUE' - options.poisson_equation = options.poisson_equation.upper() == 'TRUE' - options.wave_equation = options.wave_equation.upper() == 'TRUE' - options.heat_equation = options.heat_equation.upper() == 'TRUE' + options.nDim = int(2) + options.nZone = int(1) # Import mpi4py for parallel run if options.with_MPI == True: @@ -98,13 +72,6 @@ def main(): # Initialize the corresponding driver of SU2, this includes solver preprocessing try: - if (options.nZone == 1) and ( options.fem or options.poisson_equation or options.wave_equation or options.heat_equation ): - SU2Driver = pysu2.CSinglezoneDriver(options.filename, options.nZone, comm); - elif options.harmonic_balance: - SU2Driver = pysu2.CHBDriver(options.filename, options.nZone, comm); - elif (options.nZone == 2) and (options.fsi): - SU2Driver = pysu2.CFSIDriver(options.filename, options.nZone, comm); - else: SU2Driver = pysu2.CSinglezoneDriver(options.filename, options.nZone, comm); except TypeError as exception: print('A TypeError occured in pysu2.CDriver : ',exception) @@ -119,7 +86,7 @@ def main(): MovingMarker = 'plate' #specified by the user # Get all the tags with the moving option - MovingMarkerList = SU2Driver.GetAllMovingMarkersTag() + MovingMarkerList = SU2Driver.GetAllDeformMeshMarkersTag() # Get all the markers defined on this rank and their associated indices. allMarkerIDs = SU2Driver.GetAllBoundaryMarkers() @@ -147,9 +114,9 @@ def main(): # Extract the initial position of each node on the moving marker CoordX = np.zeros(nVertex_MovingMarker) CoordY = np.zeros(nVertex_MovingMarker) + CoordZ = np.zeros(nVertex_MovingMarker) for iVertex in range(nVertex_MovingMarker): - CoordX[iVertex] = SU2Driver.GetVertexCoordX(MovingMarkerID, iVertex) - CoordY[iVertex] = SU2Driver.GetVertexCoordY(MovingMarkerID, iVertex) + CoordX[iVertex], CoordY[iVertex], CoordZ[iVertex] = SU2Driver.GetInitialMeshCoord(MovingMarkerID, iVertex) # Time loop is defined in Python so that we have acces to SU2 functionalities at each time step if rank == 0: @@ -162,16 +129,13 @@ def main(): # Define the rigid body displacement and set the new coords of each node on the marker d_y = 0.0175*sin(2*pi*time) for iVertex in range(nVertex_MovingMarker): - newCoordX = CoordX[iVertex] - newCoordY = CoordY[iVertex] + d_y - SU2Driver.SetVertexCoordX(MovingMarkerID, iVertex, newCoordX) - SU2Driver.SetVertexCoordY(MovingMarkerID, iVertex, newCoordY) - SU2Driver.SetVertexCoordZ(MovingMarkerID, iVertex, 0.0) - SU2Driver.SetVertexVarCoord(MovingMarkerID, iVertex) + SU2Driver.SetMeshDisplacement(MovingMarkerID, int(iVertex), 0.0, d_y, 0.0) # Time iteration preprocessing SU2Driver.Preprocess(TimeIter) # Run one time iteration (e.g. dual-time) SU2Driver.Run() + # Postprocess the solver + SU2Driver.Postprocess() # Update the solver for the next time iteration SU2Driver.Update() # Monitor the solver and output solution to file if required @@ -195,4 +159,4 @@ def main(): # this is only accessed if running from command prompt if __name__ == '__main__': - main() + main() diff --git a/TestCases/py_wrapper/flatPlate_unsteady_CHT/launch_unsteady_CHT_FlatPlate.py b/TestCases/py_wrapper/flatPlate_unsteady_CHT/launch_unsteady_CHT_FlatPlate.py index 1ed717dd6974..06a3edd2b7eb 100755 --- a/TestCases/py_wrapper/flatPlate_unsteady_CHT/launch_unsteady_CHT_FlatPlate.py +++ b/TestCases/py_wrapper/flatPlate_unsteady_CHT/launch_unsteady_CHT_FlatPlate.py @@ -45,7 +45,7 @@ from math import * # ------------------------------------------------------------------- -# Main +# Main # ------------------------------------------------------------------- def main(): @@ -53,38 +53,12 @@ def main(): # Command line options parser=OptionParser() parser.add_option("-f", "--file", dest="filename", help="Read config from FILE", metavar="FILE") - parser.add_option("--nDim", dest="nDim", default=2, help="Define the number of DIMENSIONS", - metavar="DIMENSIONS") - parser.add_option("--nZone", dest="nZone", default=1, help="Define the number of ZONES", - metavar="ZONES") parser.add_option("--parallel", action="store_true", help="Specify if we need to initialize MPI", dest="with_MPI", default=False) - parser.add_option("--fsi", dest="fsi", default="False", help="Launch the FSI driver", metavar="FSI") - - parser.add_option("--fem", dest="fem", default="False", help="Launch the FEM driver (General driver)", metavar="FEM") - - parser.add_option("--harmonic_balance", dest="harmonic_balance", default="False", - help="Launch the Harmonic Balance (HB) driver", metavar="HB") - - parser.add_option("--poisson_equation", dest="poisson_equation", default="False", - help="Launch the poisson equation driver (General driver)", metavar="POIS_EQ") - - parser.add_option("--wave_equation", dest="wave_equation", default="False", - help="Launch the wave equation driver (General driver)", metavar="WAVE_EQ") - - parser.add_option("--heat_equation", dest="heat_equation", default="False", - help="Launch the heat equation driver (General driver)", metavar="HEAT_EQ") - (options, args) = parser.parse_args() - options.nDim = int( options.nDim ) - options.nZone = int( options.nZone ) - options.fsi = options.fsi.upper() == 'TRUE' - options.fem = options.fem.upper() == 'TRUE' - options.harmonic_balance = options.harmonic_balance.upper() == 'TRUE' - options.poisson_equation = options.poisson_equation.upper() == 'TRUE' - options.wave_equation = options.wave_equation.upper() == 'TRUE' - options.heat_equation = options.heat_equation.upper() == 'TRUE' + options.nDim = int(2) + options.nZone = int(1) # Import mpi4py for parallel run if options.with_MPI == True: @@ -92,18 +66,11 @@ def main(): comm = MPI.COMM_WORLD rank = comm.Get_rank() else: - comm = 0 + comm = 0 rank = 0 # Initialize the corresponding driver of SU2, this includes solver preprocessing try: - if (options.nZone == 1) and ( options.fem or options.poisson_equation or options.wave_equation or options.heat_equation ): - SU2Driver = pysu2.CGeneralDriver(options.filename, options.nZone, comm); - elif options.harmonic_balance: - SU2Driver = pysu2.CHBDriver(options.filename, options.nZone, comm); - elif (options.nZone == 2) and (options.fsi): - SU2Driver = pysu2.CFSIDriver(options.filename, options.nZone, comm); - else: SU2Driver = pysu2.CSinglezoneDriver(options.filename, options.nZone, comm); except TypeError as exception: print('A TypeError occured in pysu2.CDriver : ',exception) @@ -162,6 +129,8 @@ def main(): SU2Driver.BoundaryConditionsUpdate() # Run one time iteration (e.g. dual-time) SU2Driver.Run() + # Postprocess the solver and exit cleanly + SU2Driver.Postprocess() # Update the solver for the next time iteration SU2Driver.Update() # Monitor the solver and output solution to file if required @@ -173,9 +142,6 @@ def main(): TimeIter += 1 time += deltaT - # Postprocess the solver and exit cleanly - SU2Driver.Postprocessing() - if SU2Driver != None: del SU2Driver @@ -185,4 +151,4 @@ def main(): # this is only accessed if running from command prompt if __name__ == '__main__': - main() + main() diff --git a/TestCases/py_wrapper/flatPlate_unsteady_CHT/unsteady_CHT_FlatPlate_Conf.cfg b/TestCases/py_wrapper/flatPlate_unsteady_CHT/unsteady_CHT_FlatPlate_Conf.cfg index 9454f923fbb8..e6f06d2b8056 100644 --- a/TestCases/py_wrapper/flatPlate_unsteady_CHT/unsteady_CHT_FlatPlate_Conf.cfg +++ b/TestCases/py_wrapper/flatPlate_unsteady_CHT/unsteady_CHT_FlatPlate_Conf.cfg @@ -335,7 +335,7 @@ LINEAR_SOLVER= FGMRES % Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Minimum error of the linear solver for implicit formulations diff --git a/TestCases/serial_regression.py b/TestCases/serial_regression.py index 55ffcd722dca..6c33afd0bea4 100644 --- a/TestCases/serial_regression.py +++ b/TestCases/serial_regression.py @@ -86,8 +86,8 @@ def main(): viscwedge.timeout = 1600 viscwedge.new_output = True viscwedge.tol = 0.00001 - test_list.append(viscwedge) - + test_list.append(viscwedge) + ######################### ## Compressible Euler ### ######################### @@ -375,6 +375,21 @@ def main(): propeller.tol = 0.00001 test_list.append(propeller) + ####################################### + ### Axisymmetric Compressible RANS ### + ####################################### + + # Axisymmetric air nozzle (transonic) + axi_rans_air_nozzle = TestCase('axi_rans_air_nozzle') + axi_rans_air_nozzle.cfg_dir = "axisymmetric_rans/air_nozzle" + axi_rans_air_nozzle.cfg_file = "air_nozzle.cfg" + axi_rans_air_nozzle.test_iter = 10 + axi_rans_air_nozzle.test_vals = [ -12.093130, -6.619801, -8.806060, -2.393278] + axi_rans_air_nozzle.su2_exec = "SU2_CFD" + axi_rans_air_nozzle.timeout = 1600 + axi_rans_air_nozzle.tol = 0.0001 + test_list.append(axi_rans_air_nozzle) + ################################# ## Compressible RANS Restart ### ################################# @@ -1877,7 +1892,7 @@ def main(): pywrapper_rigidMotion.cfg_dir = "py_wrapper/flatPlate_rigidMotion" pywrapper_rigidMotion.cfg_file = "flatPlate_rigidMotion_Conf.cfg" pywrapper_rigidMotion.test_iter = 5 - pywrapper_rigidMotion.test_vals = [-1.614167, 2.242632, -0.037871, 0.173912] + pywrapper_rigidMotion.test_vals = [-1.551335, 2.295594, 0.350050, 0.093081] pywrapper_rigidMotion.su2_exec = "python launch_flatPlate_rigidMotion.py -f" pywrapper_rigidMotion.new_output = True pywrapper_rigidMotion.timeout = 1600 diff --git a/config_template.cfg b/config_template.cfg index 937c13a8cb1f..9d5d4299623a 100644 --- a/config_template.cfg +++ b/config_template.cfg @@ -1019,7 +1019,7 @@ LINEAR_SOLVER_PREC= ILU % Same for discrete adjoint (JACOBI or ILU), replaces LINEAR_SOLVER_PREC in SU2_*_AD codes. DISCADJ_LIN_PREC= ILU % -% Linael solver ILU preconditioner fill-in level (0 by default) +% Linear solver ILU preconditioner fill-in level (0 by default) LINEAR_SOLVER_ILU_FILL_IN= 0 % % Minimum error of the linear solver for implicit formulations From 06cfde0e4a23f5a33e8feb1316f5d41f5d4c7dfb Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi Date: Wed, 10 Mar 2021 17:01:33 +0100 Subject: [PATCH 02/10] More output for debug --- SU2_CFD/src/solvers/CMeshSolver.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SU2_CFD/src/solvers/CMeshSolver.cpp b/SU2_CFD/src/solvers/CMeshSolver.cpp index 6985488f3e53..3750cf2703ec 100644 --- a/SU2_CFD/src/solvers/CMeshSolver.cpp +++ b/SU2_CFD/src/solvers/CMeshSolver.cpp @@ -277,6 +277,8 @@ void CMeshSolver::SetMinMaxVolume(CGeometry *geometry, CConfig *config, bool upd } SU2_OMP_BARRIER AD::EndPassive(wasActive); + + geometry->ComputeMeshQualityStatistics(config); // Only used for debug purpose } void CMeshSolver::SetWallDistance(CGeometry *geometry, CConfig *config) { From 97c45dafa11d4112e338f7a663e7dd2783c13ace Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi Date: Mon, 22 Mar 2021 14:55:09 +0100 Subject: [PATCH 03/10] Allow to extract the normal with info on the area and the unit normal --- SU2_CFD/include/drivers/CDriver.hpp | 2 +- SU2_CFD/src/python_wrapper_structure.cpp | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/SU2_CFD/include/drivers/CDriver.hpp b/SU2_CFD/include/drivers/CDriver.hpp index 8a0b597365bd..cf0993f83938 100644 --- a/SU2_CFD/include/drivers/CDriver.hpp +++ b/SU2_CFD/include/drivers/CDriver.hpp @@ -526,7 +526,7 @@ class CDriver { * \param[in] iVertex - Vertex identifier. * \return Unit normal (vector) at the vertex. */ - vector GetVertexUnitNormal(unsigned short iMarker, unsigned long iVertex) const; + vector GetVertexNormal(unsigned short iMarker, unsigned long iVertex, bool unitNormal) const; /*! * \brief Get all the boundary markers tags. diff --git a/SU2_CFD/src/python_wrapper_structure.cpp b/SU2_CFD/src/python_wrapper_structure.cpp index 6125d80966ea..0d427c3938fd 100644 --- a/SU2_CFD/src/python_wrapper_structure.cpp +++ b/SU2_CFD/src/python_wrapper_structure.cpp @@ -228,7 +228,7 @@ vector CDriver::GetInitialMeshCoord(unsigned short iMarker, unsig return coord_passive; } -vector CDriver::GetVertexUnitNormal(unsigned short iMarker, unsigned long iVertex) const { +vector CDriver::GetVertexNormal(unsigned short iMarker, unsigned long iVertex, bool unitNormal) const { su2double *Normal; su2double Area; @@ -237,6 +237,15 @@ vector CDriver::GetVertexUnitNormal(unsigned short iMarker, unsig Normal = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNormal(); + if (!unitNormal) { + + ret_Normal_passive[0] = SU2_TYPE::GetValue(Normal[0]); + ret_Normal_passive[1] = SU2_TYPE::GetValue(Normal[1]); + if(nDim>2) ret_Normal_passive[2] = SU2_TYPE::GetValue(Normal[2]); + + return ret_Normal_passive: + } + Area = GeometryToolbox::Norm(nDim, Normal); ret_Normal[0] = Normal[0]/Area; From 34884c49a6ed931e9dfd9eae585ad397b1538209 Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi Date: Sat, 27 Mar 2021 11:31:07 +0100 Subject: [PATCH 04/10] small typo --- SU2_CFD/src/python_wrapper_structure.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SU2_CFD/src/python_wrapper_structure.cpp b/SU2_CFD/src/python_wrapper_structure.cpp index 0d427c3938fd..2e94c8fa0fdb 100644 --- a/SU2_CFD/src/python_wrapper_structure.cpp +++ b/SU2_CFD/src/python_wrapper_structure.cpp @@ -243,7 +243,7 @@ vector CDriver::GetVertexNormal(unsigned short iMarker, unsigned ret_Normal_passive[1] = SU2_TYPE::GetValue(Normal[1]); if(nDim>2) ret_Normal_passive[2] = SU2_TYPE::GetValue(Normal[2]); - return ret_Normal_passive: + return ret_Normal_passive; } Area = GeometryToolbox::Norm(nDim, Normal); From 425c87e905c20cd31b9bbba301c0b2998f86fff5 Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi Date: Thu, 15 Apr 2021 10:27:37 +0200 Subject: [PATCH 05/10] Update nodal solution for all points --- SU2_PY/SU2_Nastran/pysu2_nastran.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/SU2_PY/SU2_Nastran/pysu2_nastran.py b/SU2_PY/SU2_Nastran/pysu2_nastran.py index 6c9aebe1d2ca..d8f37de6f6dd 100644 --- a/SU2_PY/SU2_Nastran/pysu2_nastran.py +++ b/SU2_PY/SU2_Nastran/pysu2_nastran.py @@ -722,7 +722,7 @@ def __computeInterfacePosVel(self, initialize): Y_disp = self.Uy.dot(self.q) Z_disp = self.Uz.dot(self.q) - for iPoint in range(len(self.node)): + for iPoint in range(self.nPoint): coord0 = self.node[iPoint].GetCoord0() self.node[iPoint].SetCoord((X_disp[iPoint]+coord0[0],Y_disp[iPoint]+coord0[1],Z_disp[iPoint]+coord0[2])) self.node[iPoint].SetVel((X_vel[iPoint],Y_vel[iPoint],Z_vel[iPoint])) @@ -935,11 +935,7 @@ def updateSolution(self): self.__reset(self.qddot) self.__reset(self.a) - makerID = list(self.markers.keys()) - makerID = makerID[0] - nodeList = self.markers[makerID] - - for iPoint in nodeList: + for iPoint in range(self.nPoint): self.node[iPoint].updateCoordVel() From 5e516936a930ad4aedd3cac316488b061b2496b2 Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi Date: Sun, 30 May 2021 16:32:15 +0200 Subject: [PATCH 06/10] Fix indices for restart --- SU2_PY/FSI_tools/FSIInterface.py | 4 ++-- SU2_PY/SU2_Nastran/pysu2_nastran.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/SU2_PY/FSI_tools/FSIInterface.py b/SU2_PY/FSI_tools/FSIInterface.py index 2b1e167d79b1..8d6a542027ca 100644 --- a/SU2_PY/FSI_tools/FSIInterface.py +++ b/SU2_PY/FSI_tools/FSIInterface.py @@ -1900,8 +1900,8 @@ def UnsteadyFSI(self,FSI_config, FluidSolver, SolidSolver): if FSI_config['RESTART_SOL'] == 'YES': NbTimeIter = ((totTime)/deltaT)-1 - time = (FSI_config['RESTART_ITER']+1)*deltaT - TimeIter = FSI_config['RESTART_ITER']+1 + time = (FSI_config['RESTART_ITER'])*deltaT + TimeIter = FSI_config['RESTART_ITER'] else: NbTimeIter = (totTime/deltaT)-1 # number of time iterations time = 0.0 # initial time diff --git a/SU2_PY/SU2_Nastran/pysu2_nastran.py b/SU2_PY/SU2_Nastran/pysu2_nastran.py index d8f37de6f6dd..1994ec7b512c 100644 --- a/SU2_PY/SU2_Nastran/pysu2_nastran.py +++ b/SU2_PY/SU2_Nastran/pysu2_nastran.py @@ -870,7 +870,7 @@ def __setRestart(self, timeIter): print("The restart iteration was not found in the structural history") break line = line.strip('\r\n').split() - if int(line[1])==(self.Config["RESTART_ITER"]-1): + if int(line[1])==(self.Config["RESTART_ITER"]-2): break index = 0 for index_mode in range(self.nDof): @@ -896,7 +896,7 @@ def __setRestart(self, timeIter): print("The restart iteration was not found in the structural history") break line = line.strip('\r\n').split() - if int(line[1])==self.Config["RESTART_ITER"]: + if int(line[1])==(self.Config["RESTART_ITER"]-1): break index = 0 for index_mode in range(self.nDof): From 18a7a27dc64d7e419d0f05a83cfba6684c783390 Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi Date: Mon, 31 May 2021 15:09:26 +0200 Subject: [PATCH 07/10] Fix of restart in interface --- SU2_PY/FSI_tools/FSIInterface.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/SU2_PY/FSI_tools/FSIInterface.py b/SU2_PY/FSI_tools/FSIInterface.py index 8d6a542027ca..70f0f164b15e 100644 --- a/SU2_PY/FSI_tools/FSIInterface.py +++ b/SU2_PY/FSI_tools/FSIInterface.py @@ -1922,13 +1922,6 @@ def UnsteadyFSI(self,FSI_config, FluidSolver, SolidSolver): TimeIterTreshold = -1 self.getSolidInterfaceDisplacement(SolidSolver) self.displacementPredictor(FSI_config, SolidSolver, deltaT) - # We need now to update the solution because both restarter functions (solid and fluid) - # load the files in the solution containers, pushing back the previous solutions. We need - # then to push it back once more to compute the solution at the next time level - # Also this is required because in the fluid iteration preprocessor, if we do not update - # and step to the next time level, there is a flag "fsi" that will initialise the flow - if myid in self.fluidSolverProcessors: - FluidSolver.Update() if myid in self.solidSolverProcessors: SolidSolver.updateSolution() #If no restart From b38b99009cd40aa1c41349e1b7749bd938e0dd46 Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi Date: Wed, 2 Jun 2021 12:48:00 +0200 Subject: [PATCH 08/10] Removed debug --- SU2_CFD/src/solvers/CMeshSolver.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/SU2_CFD/src/solvers/CMeshSolver.cpp b/SU2_CFD/src/solvers/CMeshSolver.cpp index b5dc1da6722a..c9db520150ed 100644 --- a/SU2_CFD/src/solvers/CMeshSolver.cpp +++ b/SU2_CFD/src/solvers/CMeshSolver.cpp @@ -285,7 +285,6 @@ void CMeshSolver::SetMinMaxVolume(CGeometry *geometry, CConfig *config, bool upd AD::EndPassive(wasActive); - geometry->ComputeMeshQualityStatistics(config); // Only used for debug purpose } void CMeshSolver::SetWallDistance(CGeometry *geometry, CConfig *config) { From 2ee6fed32ccc7f0033d1d9b210e786e1e64cd128 Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi Date: Wed, 2 Jun 2021 18:17:00 +0200 Subject: [PATCH 09/10] Be sure that coupling starts immediately when restarting --- SU2_PY/FSI_tools/FSI_config.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/SU2_PY/FSI_tools/FSI_config.py b/SU2_PY/FSI_tools/FSI_config.py index aad28ff0ee19..6a1dc3f88d00 100644 --- a/SU2_PY/FSI_tools/FSI_config.py +++ b/SU2_PY/FSI_tools/FSI_config.py @@ -122,3 +122,6 @@ def applyDefaults(self): if self._ConfigContent["CSD_SOLVER"] == "IMPOSED": self._ConfigContent["AITKEN_RELAX"] = "STATIC" self._ConfigContent["AITKEN_PARAM"] = 1.0 + + if self._ConfigContent["RESTART_SOL"] == "YES": + self._ConfigContent["TIME_TRESHOLD"] = -1 From 747b2b7ccd3ef889a4d3a0837590fcb3022b27f4 Mon Sep 17 00:00:00 2001 From: Nicola-Fonzi <60700515+Nicola-Fonzi@users.noreply.github.com> Date: Thu, 10 Jun 2021 16:51:19 +0200 Subject: [PATCH 10/10] Addressing comment from reviewer Co-authored-by: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com> --- SU2_CFD/include/drivers/CDriver.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/SU2_CFD/include/drivers/CDriver.hpp b/SU2_CFD/include/drivers/CDriver.hpp index edc5e1b6d6a9..f6890b53a095 100644 --- a/SU2_CFD/include/drivers/CDriver.hpp +++ b/SU2_CFD/include/drivers/CDriver.hpp @@ -525,7 +525,11 @@ class CDriver { * \param[in] iVertex - Vertex identifier. * \return Unit normal (vector) at the vertex. */ - vector GetVertexNormal(unsigned short iMarker, unsigned long iVertex, bool unitNormal) const; + vector GetVertexNormal(unsigned short iMarker, unsigned long iVertex, bool unitNormal = false) const; + + inline vector GetVertexUnitNormal(unsigned short iMarker, unsigned long iVertex) const { + return GetVertexNormal(iMarker, iVertex, true); + } /*! * \brief Get all the boundary markers tags.