diff --git a/Common/include/config_structure.hpp b/Common/include/config_structure.hpp index c469db21cd5..e8418fd25f9 100644 --- a/Common/include/config_structure.hpp +++ b/Common/include/config_structure.hpp @@ -521,8 +521,7 @@ class CConfig { Kind_Matrix_Coloring, /*!< \brief Type of matrix coloring for sparse Jacobian computation. */ Kind_Solver_Fluid_FSI, /*!< \brief Kind of solver for the fluid in FSI applications. */ Kind_Solver_Struc_FSI, /*!< \brief Kind of solver for the structure in FSI applications. */ - Kind_BGS_RelaxMethod, /*!< \brief Kind of relaxation method for Block Gauss Seidel method in FSI problems. */ - Kind_TransferMethod; /*!< \brief Iterative scheme for nonlinear structural analysis. */ + Kind_BGS_RelaxMethod; /*!< \brief Kind of relaxation method for Block Gauss Seidel method in FSI problems. */ bool Energy_Equation; /*!< \brief Solve the energy equation for incompressible flows. */ bool MUSCL, /*!< \brief MUSCL scheme .*/ MUSCL_Flow, /*!< \brief MUSCL scheme for the flow equations.*/ @@ -960,7 +959,6 @@ class CConfig { long ExtraHeatOutputZone; /*!< \brief Heat solver zone with extra screen output */ bool DeadLoad; /*!< Application of dead loads to the FE analysis */ bool PseudoStatic; /*!< Application of dead loads to the FE analysis */ - bool MatchingMesh; /*!< Matching mesh (while implementing interpolation procedures). */ bool SteadyRestart; /*!< Restart from a steady state for FSI problems. */ su2double Newmark_beta, /*!< \brief Parameter alpha for Newmark method. */ Newmark_gamma; /*!< \brief Parameter delta for Newmark method. */ @@ -4394,14 +4392,6 @@ class CConfig { */ unsigned short GetKind_SpaceIteScheme_FEA(void); - /*! - * \brief Get the kind of transfer method we want to use for multiphysics problems - * \note This value is obtained from the config file, and it is constant - * during the computation. - * \return Kind of transfer method for multiphysics problems - */ - unsigned short GetKind_TransferMethod(void); - /*! * \brief Get the kind of convective numerical scheme for the flow * equations (centered or upwind). @@ -8584,13 +8574,6 @@ class CConfig { bool GetPseudoStatic(void); - /*! - * \brief Identifies if the mesh is matching or not (temporary, while implementing interpolation procedures). - * \return TRUE if the mesh is matching, FALSE otherwise. - */ - - bool GetMatchingMesh(void); - /*! * \brief Identifies if we want to restart from a steady or an unsteady solution. * \return TRUE if we restart from steady state solution, FALSE otherwise. diff --git a/Common/include/config_structure.inl b/Common/include/config_structure.inl index 61af8a7976b..f6b88a8c54f 100644 --- a/Common/include/config_structure.inl +++ b/Common/include/config_structure.inl @@ -1123,8 +1123,6 @@ inline unsigned short CConfig::GetKind_TimeIntScheme_FEA(void) { return Kind_Tim inline unsigned short CConfig::GetKind_SpaceIteScheme_FEA(void) { return Kind_SpaceIteScheme_FEA; } -inline unsigned short CConfig::GetKind_TransferMethod(void) { return Kind_TransferMethod; } - inline unsigned short CConfig::GetKind_ConvNumScheme_Flow(void) { return Kind_ConvNumScheme_Flow; } inline unsigned short CConfig::GetKind_ConvNumScheme_FEM_Flow(void) { return Kind_ConvNumScheme_FEM_Flow; } @@ -1852,8 +1850,6 @@ inline bool CConfig::GetDeadLoad(void) { return DeadLoad; } inline bool CConfig::GetPseudoStatic(void) { return PseudoStatic; } -inline bool CConfig::GetMatchingMesh(void) { return MatchingMesh; } - inline bool CConfig::GetSteadyRestart(void) { return SteadyRestart; } inline unsigned short CConfig::GetDynamic_Analysis(void) { return Dynamic_Analysis; } diff --git a/Common/include/geometry_structure.hpp b/Common/include/geometry_structure.hpp index 6376fc53cac..5871a468c69 100644 --- a/Common/include/geometry_structure.hpp +++ b/Common/include/geometry_structure.hpp @@ -715,15 +715,6 @@ class CGeometry { */ virtual void MatchInterface(CConfig *config); - /*! - * \brief A virtual member. - * \param[in] config - Definition of the particular problem. - * \param[in] geometry_donor - Geometry of the donor zone. - * \param[in] config_donor - Definition of the donor problem. - */ - virtual void MatchZone(CConfig *config, CGeometry *geometry_donor, CConfig *config_donor, - unsigned short val_iZone, unsigned short val_nZone); - /*! * \brief A virtual member. * \param[in] config - Definition of the particular problem. @@ -1996,15 +1987,6 @@ void UpdateTurboVertex(CConfig *config,unsigned short val_iZone, unsigned short */ void MatchInterface(CConfig *config); - /*! - * \brief Mach the interface boundary condition. - * \param[in] config - Definition of the particular problem. - * \param[in] geometry_donor - Geometry of the donor zone. - * \param[in] config_donor - Definition of the donor problem. - */ - void MatchZone(CConfig *config, CGeometry *geometry_donor, CConfig *config_donor, - unsigned short val_iZone, unsigned short val_nZone); - /*! * \brief Set boundary vertex structure of the control volume. * \param[in] config - Definition of the particular problem. diff --git a/Common/include/geometry_structure.inl b/Common/include/geometry_structure.inl index 768a2537cb9..5f8d1ef663b 100644 --- a/Common/include/geometry_structure.inl +++ b/Common/include/geometry_structure.inl @@ -305,8 +305,6 @@ inline void CGeometry::MatchActuator_Disk(CConfig *config) { } inline void CGeometry::MatchInterface(CConfig *config) { } -inline void CGeometry::MatchZone(CConfig *config, CGeometry *geometry_donor, CConfig *config_donor, unsigned short val_iZone, unsigned short val_nZone) { } - inline void CGeometry::SetBoundControlVolume(CConfig *config, unsigned short action) { } inline void CGeometry::SetBoundControlVolume(CConfig *config, CGeometry *geometry, unsigned short action) { } diff --git a/Common/include/option_structure.hpp b/Common/include/option_structure.hpp index bd9f8f89d71..09d13eb5900 100644 --- a/Common/include/option_structure.hpp +++ b/Common/include/option_structure.hpp @@ -997,19 +997,6 @@ static const map Space_Ite_Map_FEA = CCreateMap Transfer_Method_Map = CCreateMap -("BROADCAST_DATA", BROADCAST_DATA) -("SCATTER_DATA", SCATTER_DATA) -("ALLGATHER_DATA", ALLGATHER_DATA); - /*! * \brief types of schemes to compute the flow gradient */ diff --git a/Common/src/config_structure.cpp b/Common/src/config_structure.cpp index 8359a7abb88..62fa3e836ef 100644 --- a/Common/src/config_structure.cpp +++ b/Common/src/config_structure.cpp @@ -2057,9 +2057,6 @@ void CConfig::SetConfig_Options(unsigned short val_iZone, unsigned short val_nZo /* DESCRIPTION: Order of the predictor */ addUnsignedShortOption("PREDICTOR_ORDER", Pred_Order, 0); - /* DESCRIPTION: Transfer method used for multiphysics problems */ - addEnumOption("MULTIPHYSICS_TRANSFER_METHOD", Kind_TransferMethod, Transfer_Method_Map, BROADCAST_DATA); - /* DESCRIPTION: Topology optimization options */ addBoolOption("TOPOLOGY_OPTIMIZATION", topology_optimization, false); addStringOption("TOPOL_OPTIM_OUTFILE", top_optim_output_file, string("element_derivatives.dat")); @@ -2101,10 +2098,6 @@ void CConfig::SetConfig_Options(unsigned short val_iZone, unsigned short val_nZo /* DESCRIPTION: Restart from a steady state (sets grid velocities to 0 when loading the restart). */ addBoolOption("RESTART_STEADY_STATE", SteadyRestart, false); - /* DESCRIPTION: Apply dead loads - * Options: NO, YES \ingroup Config */ - addBoolOption("MATCHING_MESH", MatchingMesh, false); - /*!\par CONFIG_CATEGORY: Multizone definition \ingroup Config*/ /*--- Options related to multizone problems ---*/ diff --git a/Common/src/geometry_structure.cpp b/Common/src/geometry_structure.cpp index d86f69b5ed5..28f4a591ad5 100644 --- a/Common/src/geometry_structure.cpp +++ b/Common/src/geometry_structure.cpp @@ -16062,160 +16062,6 @@ void CPhysicalGeometry::MatchActuator_Disk(CConfig *config) { } -void CPhysicalGeometry::MatchZone(CConfig *config, CGeometry *geometry_donor, CConfig *config_donor, - unsigned short val_iZone, unsigned short val_nZone) { - -#ifndef HAVE_MPI - - unsigned short iMarker, jMarker; - unsigned long iVertex, iPoint, jVertex, jPoint = 0, pPoint = 0, pGlobalPoint = 0; - su2double *Coord_i, *Coord_j, dist = 0.0, mindist, maxdist; - -// if (val_iZone == ZONE_0) cout << "Set zone boundary conditions (if any)." << endl; - - maxdist = 0.0; - for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - for (iVertex = 0; iVertex < nVertex[iMarker]; iVertex++) { - iPoint = vertex[iMarker][iVertex]->GetNode(); - Coord_i = node[iPoint]->GetCoord(); - - mindist = 1E6; - for (jMarker = 0; jMarker < config_donor->GetnMarker_All(); jMarker++) - for (jVertex = 0; jVertex < geometry_donor->GetnVertex(jMarker); jVertex++) { - jPoint = geometry_donor->vertex[jMarker][jVertex]->GetNode(); - Coord_j = geometry_donor->node[jPoint]->GetCoord(); - if (nDim == 2) dist = sqrt(pow(Coord_j[0]-Coord_i[0],2.0) + pow(Coord_j[1]-Coord_i[1],2.0)); - if (nDim == 3) dist = sqrt(pow(Coord_j[0]-Coord_i[0],2.0) + pow(Coord_j[1]-Coord_i[1],2.0) + pow(Coord_j[2]-Coord_i[2],2.0)); -// if (dist < mindist) { mindist = dist; pPoint = jPoint; pGlobalPoint = node[jPoint]->GetGlobalIndex();} - if (dist < mindist) { mindist = dist; pPoint = jPoint; pGlobalPoint = geometry_donor->node[jPoint]->GetGlobalIndex();} - } - - maxdist = max(maxdist, mindist); - vertex[iMarker][iVertex]->SetDonorPoint(pPoint, MASTER_NODE, pGlobalPoint); - - } - } - -#else - - unsigned short iMarker, iDim; - unsigned long iVertex, iPoint, pPoint = 0, jVertex, jPoint, jGlobalPoint = 0, pGlobalPoint = 0; - su2double *Coord_i, Coord_j[3], dist = 0.0, mindist, maxdist; - int iProcessor, pProcessor = 0; - unsigned long nLocalVertex_Zone = 0, nGlobalVertex_Zone = 0, MaxLocalVertex_Zone = 0; - int nProcessor = size; - - unsigned long *Buffer_Send_nVertex = new unsigned long [1]; - unsigned long *Buffer_Receive_nVertex = new unsigned long [nProcessor]; - -// if (val_iZone == ZONE_0 && rank == MASTER_NODE) cout << "Set zone boundary conditions (if any)." << endl; - - nLocalVertex_Zone = 0; - for (iMarker = 0; iMarker < config_donor->GetnMarker_All(); iMarker++) - for (iVertex = 0; iVertex < geometry_donor->GetnVertex(iMarker); iVertex++) { - iPoint = geometry_donor->vertex[iMarker][iVertex]->GetNode(); - if (geometry_donor->node[iPoint]->GetDomain()) nLocalVertex_Zone ++; - } - - Buffer_Send_nVertex[0] = nLocalVertex_Zone; - - /*--- Send Interface vertex information --*/ - - SU2_MPI::Allreduce(&nLocalVertex_Zone, &nGlobalVertex_Zone, 1, MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&nLocalVertex_Zone, &MaxLocalVertex_Zone, 1, MPI_UNSIGNED_LONG, MPI_MAX, MPI_COMM_WORLD); - SU2_MPI::Allgather(Buffer_Send_nVertex, 1, MPI_UNSIGNED_LONG, Buffer_Receive_nVertex, 1, MPI_UNSIGNED_LONG, MPI_COMM_WORLD); - - su2double *Buffer_Send_Coord = new su2double [MaxLocalVertex_Zone*nDim]; - unsigned long *Buffer_Send_Point = new unsigned long [MaxLocalVertex_Zone]; - unsigned long *Buffer_Send_GlobalPoint = new unsigned long [MaxLocalVertex_Zone]; - - su2double *Buffer_Receive_Coord = new su2double [nProcessor*MaxLocalVertex_Zone*nDim]; - unsigned long *Buffer_Receive_Point = new unsigned long [nProcessor*MaxLocalVertex_Zone]; - unsigned long *Buffer_Receive_GlobalPoint = new unsigned long [nProcessor*MaxLocalVertex_Zone]; - - unsigned long nBuffer_Coord = MaxLocalVertex_Zone*nDim; - unsigned long nBuffer_Point = MaxLocalVertex_Zone; - - - for (iVertex = 0; iVertex < MaxLocalVertex_Zone; iVertex++) { - Buffer_Send_Point[iVertex] = 0; - Buffer_Send_GlobalPoint[iVertex] = 0; - for (iDim = 0; iDim < nDim; iDim++) - Buffer_Send_Coord[iVertex*nDim+iDim] = 0.0; - } - - /*--- Copy coordinates and point to the auxiliar vector --*/ - nLocalVertex_Zone = 0; - for (iMarker = 0; iMarker < config_donor->GetnMarker_All(); iMarker++) - for (iVertex = 0; iVertex < geometry_donor->GetnVertex(iMarker); iVertex++) { - iPoint = geometry_donor->vertex[iMarker][iVertex]->GetNode(); - if (geometry_donor->node[iPoint]->GetDomain()) { - Buffer_Send_Point[nLocalVertex_Zone] = iPoint; - Buffer_Send_GlobalPoint[nLocalVertex_Zone] = geometry_donor->node[iPoint]->GetGlobalIndex(); - for (iDim = 0; iDim < nDim; iDim++) - Buffer_Send_Coord[nLocalVertex_Zone*nDim+iDim] = geometry_donor->node[iPoint]->GetCoord(iDim); - nLocalVertex_Zone++; - } - } - - SU2_MPI::Allgather(Buffer_Send_Coord, nBuffer_Coord, MPI_DOUBLE, Buffer_Receive_Coord, nBuffer_Coord, MPI_DOUBLE, MPI_COMM_WORLD); - SU2_MPI::Allgather(Buffer_Send_Point, nBuffer_Point, MPI_UNSIGNED_LONG, Buffer_Receive_Point, nBuffer_Point, MPI_UNSIGNED_LONG, MPI_COMM_WORLD); - SU2_MPI::Allgather(Buffer_Send_GlobalPoint, nBuffer_Point, MPI_UNSIGNED_LONG, Buffer_Receive_GlobalPoint, nBuffer_Point, MPI_UNSIGNED_LONG, MPI_COMM_WORLD); - - /*--- Compute the closest point to a Near-Field boundary point ---*/ - maxdist = 0.0; - for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - for (iVertex = 0; iVertex < nVertex[iMarker]; iVertex++) { - iPoint = vertex[iMarker][iVertex]->GetNode(); - - if (node[iPoint]->GetDomain()) { - - /*--- Coordinates of the boundary point ---*/ - Coord_i = node[iPoint]->GetCoord(); mindist = 1E6; pProcessor = 0; pPoint = 0; - - /*--- Loop over all the boundaries to find the pair ---*/ - for (iProcessor = 0; iProcessor < nProcessor; iProcessor++) - for (jVertex = 0; jVertex < Buffer_Receive_nVertex[iProcessor]; jVertex++) { - jPoint = Buffer_Receive_Point[iProcessor*MaxLocalVertex_Zone+jVertex]; - jGlobalPoint = Buffer_Receive_GlobalPoint[iProcessor*MaxLocalVertex_Zone+jVertex]; - - /*--- Compute the distance ---*/ - dist = 0.0; for (iDim = 0; iDim < nDim; iDim++) { - Coord_j[iDim] = Buffer_Receive_Coord[(iProcessor*MaxLocalVertex_Zone+jVertex)*nDim+iDim]; - dist += pow(Coord_j[iDim]-Coord_i[iDim],2.0); - } dist = sqrt(dist); - - if (((dist < mindist) && (iProcessor != rank)) || - ((dist < mindist) && (iProcessor == rank) && (jPoint != iPoint))) { - mindist = dist; pProcessor = iProcessor; pPoint = jPoint; - pGlobalPoint = jGlobalPoint; - } - } - - /*--- Store the value of the pair ---*/ - maxdist = max(maxdist, mindist); - vertex[iMarker][iVertex]->SetDonorPoint(pPoint, pProcessor, pGlobalPoint); - - - } - } - } - - delete[] Buffer_Send_Coord; - delete[] Buffer_Send_Point; - delete[] Buffer_Send_GlobalPoint; - - delete[] Buffer_Receive_Coord; - delete[] Buffer_Receive_Point; - delete[] Buffer_Receive_GlobalPoint; - - delete[] Buffer_Send_nVertex; - delete[] Buffer_Receive_nVertex; - -#endif - -} - void CPhysicalGeometry::SetControlVolume(CConfig *config, unsigned short action) { unsigned long face_iPoint = 0, face_jPoint = 0, iPoint, iElem; diff --git a/SU2_CFD/include/solver_structure.hpp b/SU2_CFD/include/solver_structure.hpp index d93085fe66c..f4cc634e2f2 100644 --- a/SU2_CFD/include/solver_structure.hpp +++ b/SU2_CFD/include/solver_structure.hpp @@ -7122,6 +7122,11 @@ class CIncEulerSolver : public CSolver { CFluidModel *FluidModel; /*!< \brief fluid model used in the solver */ su2double **Preconditioner; /*!< \brief Auxiliary matrix for storing the low speed preconditioner. */ + /* Sliding meshes variables */ + + su2double ****SlidingState; + int **SlidingStateNodes; + public: /*! @@ -7478,6 +7483,16 @@ class CIncEulerSolver : public CSolver { void BC_Outlet(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker); + /*! + * \brief Impose the interface state across sliding meshes. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] solver_container - Container vector with all the solutions. + * \param[in] conv_numerics - Description of the numerical method. + * \param[in] visc_numerics - Description of the numerical method. + * \param[in] config - Definition of the particular problem. + */ + void BC_Fluid_Interface(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config); + /*! * \brief compare to values. * \param[in] a - value 1. @@ -8312,6 +8327,47 @@ class CIncEulerSolver : public CSolver { * \brief A virtual member. */ void GetOutlet_Properties(CGeometry *geometry, CConfig *config, unsigned short iMesh, bool Output); + + /*! + * \brief Allocates the final pointer of SlidingState depending on how many donor vertex donate to it. That number is stored in SlidingStateNodes[val_marker][val_vertex]. + * \param[in] val_marker - marker index + * \param[in] val_vertex - vertex index + */ + void SetSlidingStateStructure(unsigned short val_marker, unsigned long val_vertex); + + /*! + * \brief Set the outer state for fluid interface nodes. + * \param[in] val_marker - marker index + * \param[in] val_vertex - vertex index + * \param[in] val_state - requested state component + * \param[in] donor_index - index of the donor node to set + * \param[in] component - set value + */ + void SetSlidingState(unsigned short val_marker, unsigned long val_vertex, unsigned short val_state, unsigned long donor_index, su2double component); + + /*! + * \brief Set the number of outer state for fluid interface nodes. + * \param[in] val_marker - marker index + * \param[in] val_vertex - vertex index + * \param[in] value - number of outer states + */ + void SetnSlidingStates(unsigned short val_marker, unsigned long val_vertex, int value); + + /*! + * \brief Get the number of outer state for fluid interface nodes. + * \param[in] val_marker - marker index + * \param[in] val_vertex - vertex index + */ + int GetnSlidingStates(unsigned short val_marker, unsigned long val_vertex); + + /*! + * \brief Get the outer state for fluid interface nodes. + * \param[in] val_marker - marker index + * \param[in] val_vertex - vertex index + * \param[in] val_state - requested state component + */ + su2double GetSlidingState(unsigned short val_marker, unsigned long val_vertex, unsigned short val_state, unsigned long donor_index); + }; diff --git a/SU2_CFD/include/solver_structure.inl b/SU2_CFD/include/solver_structure.inl index 5db22f5a1cc..9894f8922f7 100644 --- a/SU2_CFD/include/solver_structure.inl +++ b/SU2_CFD/include/solver_structure.inl @@ -2378,18 +2378,28 @@ inline void CEulerSolver::SetSlidingState(unsigned short val_marker, unsigned lo SlidingState[val_marker][val_vertex][val_state][donor_index] = component; } +inline void CIncEulerSolver::SetSlidingState(unsigned short val_marker, unsigned long val_vertex, unsigned short val_state, unsigned long donor_index, su2double component){ + SlidingState[val_marker][val_vertex][val_state][donor_index] = component; +} + inline void CSolver::SetSlidingState(unsigned short val_marker, unsigned long val_vertex, unsigned short val_state, unsigned long donor_index, su2double component){ } inline su2double CEulerSolver::GetSlidingState(unsigned short val_marker, unsigned long val_vertex, unsigned short val_state, unsigned long donor_index) { return SlidingState[val_marker][val_vertex][val_state][donor_index]; } +inline su2double CIncEulerSolver::GetSlidingState(unsigned short val_marker, unsigned long val_vertex, unsigned short val_state, unsigned long donor_index) { return SlidingState[val_marker][val_vertex][val_state][donor_index]; } + inline su2double CSolver::GetSlidingState(unsigned short val_marker, unsigned long val_vertex, unsigned short val_state, unsigned long donor_index) { return 0; } inline int CEulerSolver::GetnSlidingStates(unsigned short val_marker, unsigned long val_vertex){ return SlidingStateNodes[val_marker][val_vertex]; } +inline int CIncEulerSolver::GetnSlidingStates(unsigned short val_marker, unsigned long val_vertex){ return SlidingStateNodes[val_marker][val_vertex]; } + inline int CSolver::GetnSlidingStates(unsigned short val_marker, unsigned long val_vertex){ return 0; } inline void CEulerSolver::SetnSlidingStates(unsigned short val_marker, unsigned long val_vertex, int value){ SlidingStateNodes[val_marker][val_vertex] = value; } +inline void CIncEulerSolver::SetnSlidingStates(unsigned short val_marker, unsigned long val_vertex, int value){ SlidingStateNodes[val_marker][val_vertex] = value; } + inline void CSolver::SetnSlidingStates(unsigned short val_marker, unsigned long val_vertex, int value){} inline void CSolver::SetSlidingStateStructure(unsigned short val_marker, unsigned long val_vertex){} @@ -2407,6 +2417,19 @@ inline void CEulerSolver::SetSlidingStateStructure(unsigned short val_marker, un } +inline void CIncEulerSolver::SetSlidingStateStructure(unsigned short val_marker, unsigned long val_vertex){ + int iVar; + + for( iVar = 0; iVar < nPrimVar+1; iVar++){ + if( SlidingState[val_marker][val_vertex][iVar] != NULL ) + delete [] SlidingState[val_marker][val_vertex][iVar]; + } + + for( iVar = 0; iVar < nPrimVar+1; iVar++) + SlidingState[val_marker][val_vertex][iVar] = new su2double[ GetnSlidingStates(val_marker, val_vertex) ]; +} + + inline void CTurbSolver::SetSlidingState(unsigned short val_marker, unsigned long val_vertex, unsigned short val_state, unsigned long donor_index, su2double component){ SlidingState[val_marker][val_vertex][val_state][donor_index] = component; diff --git a/SU2_CFD/include/transfer_structure.hpp b/SU2_CFD/include/transfer_structure.hpp index 86dbfd71c50..12faba36980 100644 --- a/SU2_CFD/include/transfer_structure.hpp +++ b/SU2_CFD/include/transfer_structure.hpp @@ -72,6 +72,7 @@ class CTransfer { su2double *Physical_Constants; su2double *Donor_Variable; su2double *Target_Variable; + bool valAggregated; /*--- Mixing Plane interface variable ---*/ su2double *SpanValueCoeffTarget; @@ -102,32 +103,6 @@ class CTransfer { */ virtual ~CTransfer(void); - /*! - * \brief Interpolate data and scatter it into different processors, for matching meshes. - * \param[in] donor_solution - Solution from the donor mesh. - * \param[in] target_solution - Solution from the target mesh. - * \param[in] donor_geometry - Geometry of the donor mesh. - * \param[in] target_geometry - Geometry of the target mesh. - * \param[in] donor_config - Definition of the problem at the donor mesh. - * \param[in] target_config - Definition of the problem at the target mesh. - */ - void Scatter_InterfaceData(CSolver *donor_solution, CSolver *target_solution, - CGeometry *donor_geometry, CGeometry *target_geometry, - CConfig *donor_config, CConfig *target_config); - - /*! - * \brief Interpolate data and broadcast it into all processors, for matching meshes. - * \param[in] donor_solution - Solution from the donor mesh. - * \param[in] target_solution - Solution from the target mesh. - * \param[in] donor_geometry - Geometry of the donor mesh. - * \param[in] target_geometry - Geometry of the target mesh. - * \param[in] donor_config - Definition of the problem at the donor mesh. - * \param[in] target_config - Definition of the problem at the target mesh. - */ - void Broadcast_InterfaceData_Matching(CSolver *donor_solution, CSolver *target_solution, - CGeometry *donor_geometry, CGeometry *target_geometry, - CConfig *donor_config, CConfig *target_config); - /*! * \brief Interpolate data and broadcast it into all processors, for nonmatching meshes. * \param[in] donor_solution - Solution from the donor mesh. @@ -137,23 +112,9 @@ class CTransfer { * \param[in] donor_config - Definition of the problem at the donor mesh. * \param[in] target_config - Definition of the problem at the target mesh. */ - void Broadcast_InterfaceData_Interpolate(CSolver *donor_solution, CSolver *target_solution, - CGeometry *donor_geometry, CGeometry *target_geometry, - CConfig *donor_config, CConfig *target_config); - - /*! - * \brief Interpolate data, operate over it and broadcast it into all processors, for nonmatching meshes. - * \param[in] donor_solution - Solution from the donor mesh. - * \param[in] target_solution - Solution from the target mesh. - * \param[in] donor_geometry - Geometry of the donor mesh. - * \param[in] target_geometry - Geometry of the target mesh. - * \param[in] donor_config - Definition of the problem at the donor mesh. - * \param[in] target_config - Definition of the problem at the target mesh. - */ - void Allgather_InterfaceData(CSolver *donor_solution, CSolver *target_solution, - CGeometry *donor_geometry, CGeometry *target_geometry, - CConfig *donor_config, CConfig *target_config); - + void Broadcast_InterfaceData(CSolver *donor_solution, CSolver *target_solution, + CGeometry *donor_geometry, CGeometry *target_geometry, + CConfig *donor_config, CConfig *target_config); /*! * \brief A virtual member. */ @@ -173,6 +134,25 @@ class CTransfer { CConfig *donor_config, unsigned long Marker_Donor, unsigned long Vertex_Donor, unsigned long Point_Donor); + /*! + * \brief Initializes the target variable. + * \param[in] target_solution - Solution from the target mesh. + * \param[in] Marker_Target - Index of the target marker. + * \param[in] Vertex_Target - Index of the target vertex. + * \param[in] nDonorPoints - Number of donor points. + */ + virtual void InitializeTarget_Variable(CSolver *target_solution, unsigned long Marker_Target, + unsigned long Vertex_Target, unsigned short nDonorPoints); + + /*! + * \brief Recovers the target variable from the buffer of su2doubles that was broadcasted. + * \param[in] indexPoint_iVertex - index of the vertex in the buffer array. + * \param[in] Buffer_Bcast_Variables - full broadcasted buffer array of doubles. + * \param[in] donorCoeff - value of the donor coefficient. + */ + virtual void RecoverTarget_Variable(long indexPoint_iVertex, su2double *Buffer_Bcast_Variables, + su2double donorCoeff); + /*! * \brief A virtual member. * \param[in] target_solution - Solution from the target mesh. @@ -724,6 +704,25 @@ class CTransfer_SlidingInterface : public CTransfer { void GetDonor_Variable(CSolver *donor_solution, CGeometry *donor_geometry, CConfig *donor_config, unsigned long Marker_Donor, unsigned long Vertex_Donor, unsigned long Point_Donor); + /*! + * \brief A virtual member, initializes the target variable for sliding mesh. + * \param[in] target_solution - Solution from the target mesh. + * \param[in] Marker_Target - Index of the target marker. + * \param[in] Vertex_Target - Index of the target vertex. + * \param[in] nDonorPoints - Number of donor points. + */ + void InitializeTarget_Variable(CSolver *target_solution, unsigned long Marker_Target, + unsigned long Vertex_Target, unsigned short nDonorPoints); + + /*! + * \brief Recovers the target variable from the buffer of su2doubles that was broadcasted. + * \param[in] indexPoint_iVertex - index of the vertex in the buffer array. + * \param[in] Buffer_Bcast_Variables - full broadcasted buffer array of doubles. + * \param[in] donorCoeff - value of the donor coefficient. + */ + void RecoverTarget_Variable(long indexPoint_iVertex, su2double *Buffer_Bcast_Variables, + su2double donorCoeff); + /*! * \brief Set the variable that has been received from the target mesh into the target mesh. * \param[in] target_solution - Solution from the target mesh. diff --git a/SU2_CFD/include/transfer_structure.inl b/SU2_CFD/include/transfer_structure.inl index 2d608963432..6afb39843db 100644 --- a/SU2_CFD/include/transfer_structure.inl +++ b/SU2_CFD/include/transfer_structure.inl @@ -45,6 +45,17 @@ inline void CTransfer::GetDonor_Variable(CSolver *donor_solution, CGeometry *don CConfig *donor_config, unsigned long Marker_Donor, unsigned long Vertex_Donor, unsigned long Point_Donor) { } +inline void CTransfer::InitializeTarget_Variable(CSolver *target_solution, unsigned long Marker_Target, + unsigned long Vertex_Target, unsigned short nDonorPoints){ + for (unsigned short iVar = 0; iVar < nVar; iVar++) Target_Variable[iVar] = 0.0; +} + +inline void CTransfer::RecoverTarget_Variable(long indexPoint_iVertex, su2double *Buffer_Bcast_Variables, + su2double donorCoeff){ + for (unsigned short iVar = 0; iVar < nVar; iVar++) Target_Variable[iVar] += donorCoeff * Buffer_Bcast_Variables[indexPoint_iVertex*nVar+iVar]; + +} + inline void CTransfer::SetTarget_Variable(CSolver *target_solution, CGeometry *target_geometry, CConfig *target_config, unsigned long Marker_Target, unsigned long Vertex_Target, unsigned long Point_Target) { } diff --git a/SU2_CFD/src/driver_direct_multizone.cpp b/SU2_CFD/src/driver_direct_multizone.cpp index 1ba5d7015a6..cab8c063914 100644 --- a/SU2_CFD/src/driver_direct_multizone.cpp +++ b/SU2_CFD/src/driver_direct_multizone.cpp @@ -638,44 +638,44 @@ bool CMultizoneDriver::Transfer_Data(unsigned short donorZone, unsigned short ta /*--- Select the transfer method according to the magnitudes being transferred ---*/ if (transfer_types[donorZone][targetZone] == SLIDING_INTERFACE) { - transfer_container[donorZone][targetZone]->Broadcast_InterfaceData_Interpolate(solver_container[donorZone][INST_0][MESH_0][FLOW_SOL],solver_container[targetZone][INST_0][MESH_0][FLOW_SOL], - geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], - config_container[donorZone], config_container[targetZone]); + transfer_container[donorZone][targetZone]->Broadcast_InterfaceData(solver_container[donorZone][INST_0][MESH_0][FLOW_SOL],solver_container[targetZone][INST_0][MESH_0][FLOW_SOL], + geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], + config_container[donorZone], config_container[targetZone]); if (config_container[targetZone]->GetKind_Solver() == RANS) - transfer_container[donorZone][targetZone]->Broadcast_InterfaceData_Interpolate(solver_container[donorZone][INST_0][MESH_0][TURB_SOL],solver_container[targetZone][INST_0][MESH_0][TURB_SOL], - geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], - config_container[donorZone], config_container[targetZone]); + transfer_container[donorZone][targetZone]->Broadcast_InterfaceData(solver_container[donorZone][INST_0][MESH_0][TURB_SOL],solver_container[targetZone][INST_0][MESH_0][TURB_SOL], + geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], + config_container[donorZone], config_container[targetZone]); } else if (transfer_types[donorZone][targetZone] == CONJUGATE_HEAT_FS) { - transfer_container[donorZone][targetZone]->Broadcast_InterfaceData_Interpolate(solver_container[donorZone][INST_0][MESH_0][FLOW_SOL],solver_container[targetZone][INST_0][MESH_0][HEAT_SOL], - geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], - config_container[donorZone], config_container[targetZone]); + transfer_container[donorZone][targetZone]->Broadcast_InterfaceData(solver_container[donorZone][INST_0][MESH_0][FLOW_SOL],solver_container[targetZone][INST_0][MESH_0][HEAT_SOL], + geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], + config_container[donorZone], config_container[targetZone]); } else if (transfer_types[donorZone][targetZone] == CONJUGATE_HEAT_WEAKLY_FS) { - transfer_container[donorZone][targetZone]->Broadcast_InterfaceData_Interpolate(solver_container[donorZone][INST_0][MESH_0][HEAT_SOL],solver_container[targetZone][INST_0][MESH_0][HEAT_SOL], - geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], - config_container[donorZone], config_container[targetZone]); + transfer_container[donorZone][targetZone]->Broadcast_InterfaceData(solver_container[donorZone][INST_0][MESH_0][HEAT_SOL],solver_container[targetZone][INST_0][MESH_0][HEAT_SOL], + geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], + config_container[donorZone], config_container[targetZone]); } else if (transfer_types[donorZone][targetZone] == CONJUGATE_HEAT_SF) { - transfer_container[donorZone][targetZone]->Broadcast_InterfaceData_Interpolate(solver_container[donorZone][INST_0][MESH_0][HEAT_SOL],solver_container[targetZone][INST_0][MESH_0][FLOW_SOL], - geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], - config_container[donorZone], config_container[targetZone]); + transfer_container[donorZone][targetZone]->Broadcast_InterfaceData(solver_container[donorZone][INST_0][MESH_0][HEAT_SOL],solver_container[targetZone][INST_0][MESH_0][FLOW_SOL], + geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], + config_container[donorZone], config_container[targetZone]); } else if (transfer_types[donorZone][targetZone] == CONJUGATE_HEAT_WEAKLY_SF) { - transfer_container[donorZone][targetZone]->Broadcast_InterfaceData_Interpolate(solver_container[donorZone][INST_0][MESH_0][HEAT_SOL],solver_container[targetZone][INST_0][MESH_0][HEAT_SOL], - geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], - config_container[donorZone], config_container[targetZone]); + transfer_container[donorZone][targetZone]->Broadcast_InterfaceData(solver_container[donorZone][INST_0][MESH_0][HEAT_SOL],solver_container[targetZone][INST_0][MESH_0][HEAT_SOL], + geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], + config_container[donorZone], config_container[targetZone]); } else if (transfer_types[donorZone][targetZone] == STRUCTURAL_DISPLACEMENTS) { - transfer_container[donorZone][targetZone]->Broadcast_InterfaceData_Interpolate(solver_container[donorZone][INST_0][MESH_0][FEA_SOL],solver_container[targetZone][INST_0][MESH_0][FLOW_SOL], - geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], - config_container[donorZone], config_container[targetZone]); + transfer_container[donorZone][targetZone]->Broadcast_InterfaceData(solver_container[donorZone][INST_0][MESH_0][FEA_SOL],solver_container[targetZone][INST_0][MESH_0][FLOW_SOL], + geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], + config_container[donorZone], config_container[targetZone]); UpdateMesh = true; } else if (transfer_types[donorZone][targetZone] == FLOW_TRACTION) { - transfer_container[donorZone][targetZone]->Broadcast_InterfaceData_Interpolate(solver_container[donorZone][INST_0][MESH_0][FLOW_SOL],solver_container[targetZone][INST_0][MESH_0][FEA_SOL], - geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], - config_container[donorZone], config_container[targetZone]); + transfer_container[donorZone][targetZone]->Broadcast_InterfaceData(solver_container[donorZone][INST_0][MESH_0][FLOW_SOL],solver_container[targetZone][INST_0][MESH_0][FEA_SOL], + geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], + config_container[donorZone], config_container[targetZone]); } else if ((transfer_types[donorZone][targetZone] == NO_TRANSFER) || (transfer_types[donorZone][targetZone] == ZONES_ARE_EQUAL) diff --git a/SU2_CFD/src/driver_structure.cpp b/SU2_CFD/src/driver_structure.cpp index 5eaebfcadc7..5b2842cf01f 100644 --- a/SU2_CFD/src/driver_structure.cpp +++ b/SU2_CFD/src/driver_structure.cpp @@ -3413,14 +3413,6 @@ void CDriver::Interface_Preprocessing() { /*--- Match Zones ---*/ if (rank == MASTER_NODE) cout << "Setting coupling "; - /*--- If the mesh is matching: match points ---*/ - if ( config_container[donorZone]->GetMatchingMesh() ) { - if (rank == MASTER_NODE) - cout << "between matching meshes. " << endl; - geometry_container[donorZone][INST_0][MESH_0]->MatchZone(config_container[donorZone], geometry_container[targetZone][INST_0][MESH_0], config_container[targetZone], donorZone, nZone); - } - /*--- Else: interpolate ---*/ - else { bool conservative_interp = config_container[donorZone]->GetConservativeInterpolation(); /*--- Conditions for conservative interpolation are not met, we cannot fallback on the consistent approach @@ -3428,7 +3420,7 @@ void CDriver::Interface_Preprocessing() { if ( conservative_interp && targetZone == 0 && structural_target ) SU2_MPI::Error("Conservative interpolation assumes the structural model mesh is evaluated second, somehow this has not happened.",CURRENT_FUNCTION); - switch (config_container[donorZone]->GetKindInterpolation()) { + switch (config_container[donorZone]->GetKindInterpolation()) { case NEAREST_NEIGHBOR: if ( conservative_interp && targetZone > 0 && structural_target ) { @@ -3436,8 +3428,8 @@ void CDriver::Interface_Preprocessing() { if (rank == MASTER_NODE) cout << "using a mirror approach: matching coefficients from opposite mesh." << endl; } else { - interpolator_container[donorZone][targetZone] = new CNearestNeighbor(geometry_container, config_container, donorZone, targetZone); - if (rank == MASTER_NODE) cout << "using a nearest-neighbor approach." << endl; + interpolator_container[donorZone][targetZone] = new CNearestNeighbor(geometry_container, config_container, donorZone, targetZone); + if (rank == MASTER_NODE) cout << "using a nearest-neighbor approach." << endl; } break; @@ -3447,29 +3439,28 @@ void CDriver::Interface_Preprocessing() { if (rank == MASTER_NODE) cout << "using a mirror approach: matching coefficients from opposite mesh." << endl; } else { - interpolator_container[donorZone][targetZone] = new CIsoparametric(geometry_container, config_container, donorZone, targetZone); - if (rank == MASTER_NODE) cout << "using an isoparametric approach." << endl; + interpolator_container[donorZone][targetZone] = new CIsoparametric(geometry_container, config_container, donorZone, targetZone); + if (rank == MASTER_NODE) cout << "using an isoparametric approach." << endl; } break; - case WEIGHTED_AVERAGE: - interpolator_container[donorZone][targetZone] = new CSlidingMesh(geometry_container, config_container, donorZone, targetZone); - if (rank == MASTER_NODE) cout << "using an sliding mesh approach." << endl; + case WEIGHTED_AVERAGE: + interpolator_container[donorZone][targetZone] = new CSlidingMesh(geometry_container, config_container, donorZone, targetZone); + if (rank == MASTER_NODE) cout << "using an sliding mesh approach." << endl; - break; + break; case RADIAL_BASIS_FUNCTION: if ( conservative_interp && targetZone > 0 && structural_target ) { - interpolator_container[donorZone][targetZone] = new CMirror(geometry_container, config_container, donorZone, targetZone); - if (rank == MASTER_NODE) cout << "using a mirror approach: matching coefficients from opposite mesh." << endl; - } - else { - interpolator_container[donorZone][targetZone] = new CRadialBasisFunction(geometry_container, config_container, donorZone, targetZone); - if (rank == MASTER_NODE) cout << "using a radial basis function approach." << endl; - } + interpolator_container[donorZone][targetZone] = new CMirror(geometry_container, config_container, donorZone, targetZone); + if (rank == MASTER_NODE) cout << "using a mirror approach: matching coefficients from opposite mesh." << endl; + } + else { + interpolator_container[donorZone][targetZone] = new CRadialBasisFunction(geometry_container, config_container, donorZone, targetZone); + if (rank == MASTER_NODE) cout << "using a radial basis function approach." << endl; + } break; - } - } + } /*--- Initialize the appropriate transfer strategy ---*/ if (rank == MASTER_NODE) cout << "Transferring "; @@ -4162,63 +4153,13 @@ void CFluidDriver::Run() { void CFluidDriver::Transfer_Data(unsigned short donorZone, unsigned short targetZone) { - bool MatchingMesh = config_container[targetZone]->GetMatchingMesh(); - - /*--- Select the transfer method and the appropriate mesh properties (matching or nonmatching mesh) ---*/ - - switch (config_container[targetZone]->GetKind_TransferMethod()) { - - case BROADCAST_DATA: - if (MatchingMesh) { - transfer_container[donorZone][targetZone]->Broadcast_InterfaceData_Matching(solver_container[donorZone][INST_0][MESH_0][FLOW_SOL],solver_container[targetZone][INST_0][MESH_0][FLOW_SOL], - geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], - config_container[donorZone], config_container[targetZone]); - if (config_container[targetZone]->GetKind_Solver() == RANS) - transfer_container[donorZone][targetZone]->Broadcast_InterfaceData_Matching(solver_container[donorZone][INST_0][MESH_0][TURB_SOL],solver_container[targetZone][INST_0][MESH_0][TURB_SOL], - geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], - config_container[donorZone], config_container[targetZone]); - } - else { - transfer_container[donorZone][targetZone]->Broadcast_InterfaceData_Interpolate(solver_container[donorZone][INST_0][MESH_0][FLOW_SOL],solver_container[targetZone][INST_0][MESH_0][FLOW_SOL], - geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], - config_container[donorZone], config_container[targetZone]); - if (config_container[targetZone]->GetKind_Solver() == RANS) - transfer_container[donorZone][targetZone]->Broadcast_InterfaceData_Interpolate(solver_container[donorZone][INST_0][MESH_0][TURB_SOL],solver_container[targetZone][INST_0][MESH_0][TURB_SOL], - geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], - config_container[donorZone], config_container[targetZone]); - } - break; - - case SCATTER_DATA: - if (MatchingMesh) { - transfer_container[donorZone][targetZone]->Scatter_InterfaceData(solver_container[donorZone][INST_0][MESH_0][FLOW_SOL],solver_container[targetZone][INST_0][MESH_0][FLOW_SOL], - geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], - config_container[donorZone], config_container[targetZone]); - if (config_container[targetZone]->GetKind_Solver() == RANS) - transfer_container[donorZone][targetZone]->Scatter_InterfaceData(solver_container[donorZone][INST_0][MESH_0][TURB_SOL],solver_container[targetZone][INST_0][MESH_0][TURB_SOL], - geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], - config_container[donorZone], config_container[targetZone]); - } - else { - SU2_MPI::Error("Scatter method not implemented for non-matching meshes. ", CURRENT_FUNCTION); - } - break; - - case ALLGATHER_DATA: - if (MatchingMesh) { - SU2_MPI::Error("Allgather method not implemented for matching meshes. ", CURRENT_FUNCTION); - } - else { - transfer_container[donorZone][targetZone]->Allgather_InterfaceData(solver_container[donorZone][INST_0][MESH_0][FLOW_SOL],solver_container[targetZone][INST_0][MESH_0][FLOW_SOL], - geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], - config_container[donorZone], config_container[targetZone]); - if (config_container[targetZone]->GetKind_Solver() == RANS) - transfer_container[donorZone][targetZone]->Allgather_InterfaceData(solver_container[donorZone][INST_0][MESH_0][TURB_SOL],solver_container[targetZone][INST_0][MESH_0][TURB_SOL], - geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], - config_container[donorZone], config_container[targetZone]); - } - break; - } + transfer_container[donorZone][targetZone]->Broadcast_InterfaceData(solver_container[donorZone][INST_0][MESH_0][FLOW_SOL],solver_container[targetZone][INST_0][MESH_0][FLOW_SOL], + geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], + config_container[donorZone], config_container[targetZone]); + if (config_container[targetZone]->GetKind_Solver() == RANS) + transfer_container[donorZone][targetZone]->Broadcast_InterfaceData(solver_container[donorZone][INST_0][MESH_0][TURB_SOL],solver_container[targetZone][INST_0][MESH_0][TURB_SOL], + geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], + config_container[donorZone], config_container[targetZone]); } @@ -5753,100 +5694,18 @@ void CFSIDriver::Predict_Tractions(unsigned short donorZone, unsigned short targ void CFSIDriver::Transfer_Displacements(unsigned short donorZone, unsigned short targetZone) { - bool MatchingMesh = config_container[targetZone]->GetMatchingMesh(); - - /*--- Select the transfer method and the appropriate mesh properties (matching or nonmatching mesh) ---*/ - - switch (config_container[targetZone]->GetKind_TransferMethod()) { - case BROADCAST_DATA: - if (MatchingMesh) { - transfer_container[donorZone][targetZone]->Broadcast_InterfaceData_Matching(solver_container[donorZone][INST_0][MESH_0][FEA_SOL],solver_container[targetZone][INST_0][MESH_0][FLOW_SOL], - geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], - config_container[donorZone], config_container[targetZone]); - /*--- Set the volume deformation for the fluid zone ---*/ - // grid_movement[targetZone]->SetVolume_Deformation(geometry_container[targetZone][INST_0][MESH_0], config_container[targetZone], true); - - } - else { - transfer_container[donorZone][targetZone]->Broadcast_InterfaceData_Interpolate(solver_container[donorZone][INST_0][MESH_0][FEA_SOL],solver_container[targetZone][INST_0][MESH_0][FLOW_SOL], - geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], - config_container[donorZone], config_container[targetZone]); - /*--- Set the volume deformation for the fluid zone ---*/ - // grid_movement[targetZone]->SetVolume_Deformation(geometry_container[targetZone][INST_0][MESH_0], config_container[targetZone], true); - } - break; - case SCATTER_DATA: - if (MatchingMesh) { - transfer_container[donorZone][targetZone]->Scatter_InterfaceData(solver_container[donorZone][INST_0][MESH_0][FEA_SOL],solver_container[targetZone][INST_0][MESH_0][FLOW_SOL], - geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], - config_container[donorZone], config_container[targetZone]); - /*--- Set the volume deformation for the fluid zone ---*/ - // grid_movement[targetZone]->SetVolume_Deformation(geometry_container[targetZone][INST_0][MESH_0], config_container[targetZone], true); - } - else { - SU2_MPI::Error("Scatter method not implemented for non-matching meshes.", CURRENT_FUNCTION); - } - break; - case ALLGATHER_DATA: - if (MatchingMesh) { - SU2_MPI::Error("Allgather method not yet implemented for matching meshes.", CURRENT_FUNCTION); - } - else { - transfer_container[donorZone][targetZone]->Allgather_InterfaceData(solver_container[donorZone][INST_0][MESH_0][FEA_SOL],solver_container[targetZone][INST_0][MESH_0][FLOW_SOL], - geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], - config_container[donorZone], config_container[targetZone]); - /*--- Set the volume deformation for the fluid zone ---*/ - // grid_movement[targetZone]->SetVolume_Deformation(geometry_container[targetZone][INST_0][MESH_0], config_container[targetZone], true); - } - break; - } + transfer_container[donorZone][targetZone]->Broadcast_InterfaceData(solver_container[donorZone][INST_0][MESH_0][FEA_SOL],solver_container[targetZone][INST_0][MESH_0][FLOW_SOL], + geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], + config_container[donorZone], config_container[targetZone]); } void CFSIDriver::Transfer_Tractions(unsigned short donorZone, unsigned short targetZone) { - bool MatchingMesh = config_container[donorZone]->GetMatchingMesh(); - - /*--- FEA equations -- Necessary as the SetFEA_Load routine is as of now contained in the structural solver ---*/ - unsigned long ExtIter = config_container[targetZone]->GetExtIter(); - config_container[targetZone]->SetGlobalParam(FEM_ELASTICITY, RUNTIME_FEA_SYS, ExtIter); - /*--- Select the transfer method and the appropriate mesh properties (matching or nonmatching mesh) ---*/ - - switch (config_container[donorZone]->GetKind_TransferMethod()) { - case BROADCAST_DATA: - if (MatchingMesh) { - transfer_container[donorZone][targetZone]->Broadcast_InterfaceData_Matching(solver_container[donorZone][INST_0][MESH_0][FLOW_SOL],solver_container[targetZone][INST_0][MESH_0][FEA_SOL], - geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], - config_container[donorZone], config_container[targetZone]); - } - else { - transfer_container[donorZone][targetZone]->Broadcast_InterfaceData_Interpolate(solver_container[donorZone][INST_0][MESH_0][FLOW_SOL],solver_container[targetZone][INST_0][MESH_0][FEA_SOL], - geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], - config_container[donorZone], config_container[targetZone]); - } - break; - case SCATTER_DATA: - if (MatchingMesh) { - transfer_container[donorZone][targetZone]->Scatter_InterfaceData(solver_container[donorZone][INST_0][MESH_0][FLOW_SOL],solver_container[targetZone][INST_0][MESH_0][FEA_SOL], - geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], - config_container[donorZone], config_container[targetZone]); - } - else { - SU2_MPI::Error("Scatter method not implemented for non-matching meshes.", CURRENT_FUNCTION); - } - break; - case ALLGATHER_DATA: - if (MatchingMesh) { - SU2_MPI::Error("Allgather method not yet implemented for matching meshes.", CURRENT_FUNCTION); - } - else { - transfer_container[donorZone][targetZone]->Allgather_InterfaceData(solver_container[donorZone][INST_0][MESH_0][FLOW_SOL],solver_container[targetZone][INST_0][MESH_0][FEA_SOL], - geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], - config_container[donorZone], config_container[targetZone]); - } - break; - } + transfer_container[donorZone][targetZone]->Broadcast_InterfaceData(solver_container[donorZone][INST_0][MESH_0][FLOW_SOL],solver_container[targetZone][INST_0][MESH_0][FEA_SOL], + geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], + config_container[donorZone], config_container[targetZone]); } @@ -7755,101 +7614,18 @@ void CDiscAdjFSIDriver::Postprocess(unsigned short ZONE_FLOW, void CDiscAdjFSIDriver::Transfer_Displacements(unsigned short donorZone, unsigned short targetZone) { - bool MatchingMesh = config_container[targetZone]->GetMatchingMesh(); - - /*--- Select the transfer method and the appropriate mesh properties (matching or nonmatching mesh) ---*/ - switch (config_container[targetZone]->GetKind_TransferMethod()) { - case BROADCAST_DATA: - if (MatchingMesh) { - transfer_container[donorZone][targetZone]->Broadcast_InterfaceData_Matching(solver_container[donorZone][INST_0][MESH_0][FEA_SOL],solver_container[targetZone][INST_0][MESH_0][FLOW_SOL], - geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], - config_container[donorZone], config_container[targetZone]); - /*--- Set the volume deformation for the fluid zone ---*/ - // grid_movement[targetZone]->SetVolume_Deformation(geometry_container[targetZone][INST_0][MESH_0], config_container[targetZone], true); - - } - else { - transfer_container[donorZone][targetZone]->Broadcast_InterfaceData_Interpolate(solver_container[donorZone][INST_0][MESH_0][FEA_SOL],solver_container[targetZone][INST_0][MESH_0][FLOW_SOL], - geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], - config_container[donorZone], config_container[targetZone]); - /*--- Set the volume deformation for the fluid zone ---*/ - // grid_movement[targetZone]->SetVolume_Deformation(geometry_container[targetZone][INST_0][MESH_0], config_container[targetZone], true); - } - break; - case SCATTER_DATA: - if (MatchingMesh) { - transfer_container[donorZone][targetZone]->Scatter_InterfaceData(solver_container[donorZone][INST_0][MESH_0][FEA_SOL],solver_container[targetZone][INST_0][MESH_0][FLOW_SOL], - geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], - config_container[donorZone], config_container[targetZone]); - /*--- Set the volume deformation for the fluid zone ---*/ - // grid_movement[targetZone]->SetVolume_Deformation(geometry_container[targetZone][INST_0][MESH_0], config_container[targetZone], true); - } - else { - SU2_MPI::Error("Scatter method not implemented for non-matching meshes.", CURRENT_FUNCTION); - } - break; - case ALLGATHER_DATA: - if (MatchingMesh) { - SU2_MPI::Error("Allgather method not yet implemented for matching meshes.", CURRENT_FUNCTION); - } - else { - transfer_container[donorZone][targetZone]->Allgather_InterfaceData(solver_container[donorZone][INST_0][MESH_0][FEA_SOL],solver_container[targetZone][INST_0][MESH_0][FLOW_SOL], - geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], - config_container[donorZone], config_container[targetZone]); - /*--- Set the volume deformation for the fluid zone ---*/ - // grid_movement[targetZone]->SetVolume_Deformation(geometry_container[targetZone][INST_0][MESH_0], config_container[targetZone], true); - } - break; - } + transfer_container[donorZone][targetZone]->Broadcast_InterfaceData(solver_container[donorZone][INST_0][MESH_0][FEA_SOL],solver_container[targetZone][INST_0][MESH_0][FLOW_SOL], + geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], + config_container[donorZone], config_container[targetZone]); } void CDiscAdjFSIDriver::Transfer_Tractions(unsigned short donorZone, unsigned short targetZone) { - bool MatchingMesh = config_container[donorZone]->GetMatchingMesh(); - - /*--- FEA equations -- Necessary as the SetFEA_Load routine is as of now contained in the structural solver ---*/ - unsigned long ExtIter = config_container[targetZone]->GetExtIter(); - config_container[targetZone]->SetGlobalParam(FEM_ELASTICITY, RUNTIME_FEA_SYS, ExtIter); - - /*--- Select the transfer method and the appropriate mesh properties (matching or nonmatching mesh) ---*/ - - switch (config_container[donorZone]->GetKind_TransferMethod()) { - case BROADCAST_DATA: - if (MatchingMesh) { - transfer_container[donorZone][targetZone]->Broadcast_InterfaceData_Matching(solver_container[donorZone][INST_0][MESH_0][FLOW_SOL],solver_container[targetZone][INST_0][MESH_0][FEA_SOL], - geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], - config_container[donorZone], config_container[targetZone]); - } - else { - transfer_container[donorZone][targetZone]->Broadcast_InterfaceData_Interpolate(solver_container[donorZone][INST_0][MESH_0][FLOW_SOL],solver_container[targetZone][INST_0][MESH_0][FEA_SOL], - geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], - config_container[donorZone], config_container[targetZone]); - } - break; - case SCATTER_DATA: - if (MatchingMesh) { - transfer_container[donorZone][targetZone]->Scatter_InterfaceData(solver_container[donorZone][INST_0][MESH_0][FLOW_SOL],solver_container[targetZone][INST_0][MESH_0][FEA_SOL], - geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], - config_container[donorZone], config_container[targetZone]); - } - else { - SU2_MPI::Error("Scatter method not implemented for non-matching meshes.", CURRENT_FUNCTION); - } - break; - case ALLGATHER_DATA: - if (MatchingMesh) { - SU2_MPI::Error("Allgather method not yet implemented for matching meshes.", CURRENT_FUNCTION); - } - else { - transfer_container[donorZone][targetZone]->Allgather_InterfaceData(solver_container[donorZone][INST_0][MESH_0][FLOW_SOL],solver_container[targetZone][INST_0][MESH_0][FEA_SOL], - geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], - config_container[donorZone], config_container[targetZone]); - } - break; - } - + transfer_container[donorZone][targetZone]->Broadcast_InterfaceData(solver_container[donorZone][INST_0][MESH_0][FEA_SOL],solver_container[targetZone][INST_0][MESH_0][FLOW_SOL], + geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], + config_container[donorZone], config_container[targetZone]); } @@ -7996,173 +7772,40 @@ void CMultiphysicsZonalDriver::DynamicMeshUpdate(unsigned long ExtIter) { void CMultiphysicsZonalDriver::Transfer_Data(unsigned short donorZone, unsigned short targetZone) { - bool MatchingMesh = config_container[targetZone]->GetMatchingMesh(); - - /*--- Select the transfer method and the appropriate mesh properties (matching or nonmatching mesh) ---*/ - - switch (config_container[targetZone]->GetKind_TransferMethod()) { - - case BROADCAST_DATA: - if (MatchingMesh) { - if (transfer_types[donorZone][targetZone] == SLIDING_INTERFACE) { - transfer_container[donorZone][targetZone]->Broadcast_InterfaceData_Matching(solver_container[donorZone][INST_0][MESH_0][FLOW_SOL],solver_container[targetZone][INST_0][MESH_0][FLOW_SOL], - geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], - config_container[donorZone], config_container[targetZone]); - if (config_container[targetZone]->GetKind_Solver() == RANS) - transfer_container[donorZone][targetZone]->Broadcast_InterfaceData_Matching(solver_container[donorZone][INST_0][MESH_0][TURB_SOL],solver_container[targetZone][INST_0][MESH_0][TURB_SOL], - geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], - config_container[donorZone], config_container[targetZone]); - } - else if (transfer_types[donorZone][targetZone] == CONJUGATE_HEAT_FS) { - transfer_container[donorZone][targetZone]->Broadcast_InterfaceData_Matching(solver_container[donorZone][INST_0][MESH_0][FLOW_SOL],solver_container[targetZone][INST_0][MESH_0][HEAT_SOL], - geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], - config_container[donorZone], config_container[targetZone]); - } - else if (transfer_types[donorZone][targetZone] == CONJUGATE_HEAT_WEAKLY_FS) { - transfer_container[donorZone][targetZone]->Broadcast_InterfaceData_Matching(solver_container[donorZone][INST_0][MESH_0][HEAT_SOL],solver_container[targetZone][INST_0][MESH_0][HEAT_SOL], - geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], - config_container[donorZone], config_container[targetZone]); - } - else if (transfer_types[donorZone][targetZone] == CONJUGATE_HEAT_SF) { - transfer_container[donorZone][targetZone]->Broadcast_InterfaceData_Matching(solver_container[donorZone][INST_0][MESH_0][HEAT_SOL],solver_container[targetZone][INST_0][MESH_0][FLOW_SOL], - geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], - config_container[donorZone], config_container[targetZone]); - } - else if (transfer_types[donorZone][targetZone] == CONJUGATE_HEAT_WEAKLY_SF) { - transfer_container[donorZone][targetZone]->Broadcast_InterfaceData_Matching(solver_container[donorZone][INST_0][MESH_0][HEAT_SOL],solver_container[targetZone][INST_0][MESH_0][HEAT_SOL], - geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], - config_container[donorZone], config_container[targetZone]); - } - else if ((transfer_types[donorZone][targetZone] == NO_TRANSFER) - || (transfer_types[donorZone][targetZone] == ZONES_ARE_EQUAL) - || (transfer_types[donorZone][targetZone] == NO_COMMON_INTERFACE)) { } - else { - cout << "WARNING: One of the specified interface transfer routines is not known to the chosen driver and has not been executed." << endl; - } - } - else { - if (transfer_types[donorZone][targetZone] == SLIDING_INTERFACE) { - transfer_container[donorZone][targetZone]->Broadcast_InterfaceData_Interpolate(solver_container[donorZone][INST_0][MESH_0][FLOW_SOL],solver_container[targetZone][INST_0][MESH_0][FLOW_SOL], - geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], - config_container[donorZone], config_container[targetZone]); - if (config_container[targetZone]->GetKind_Solver() == RANS) - transfer_container[donorZone][targetZone]->Broadcast_InterfaceData_Interpolate(solver_container[donorZone][INST_0][MESH_0][TURB_SOL],solver_container[targetZone][INST_0][MESH_0][TURB_SOL], - geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], - config_container[donorZone], config_container[targetZone]); - } - else if (transfer_types[donorZone][targetZone] == CONJUGATE_HEAT_FS) { - transfer_container[donorZone][targetZone]->Broadcast_InterfaceData_Interpolate(solver_container[donorZone][INST_0][MESH_0][FLOW_SOL],solver_container[targetZone][INST_0][MESH_0][HEAT_SOL], - geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], - config_container[donorZone], config_container[targetZone]); - } - else if (transfer_types[donorZone][targetZone] == CONJUGATE_HEAT_WEAKLY_FS) { - transfer_container[donorZone][targetZone]->Broadcast_InterfaceData_Interpolate(solver_container[donorZone][INST_0][MESH_0][HEAT_SOL],solver_container[targetZone][INST_0][MESH_0][HEAT_SOL], - geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], - config_container[donorZone], config_container[targetZone]); - } - else if (transfer_types[donorZone][targetZone] == CONJUGATE_HEAT_SF) { - transfer_container[donorZone][targetZone]->Broadcast_InterfaceData_Interpolate(solver_container[donorZone][INST_0][MESH_0][HEAT_SOL],solver_container[targetZone][INST_0][MESH_0][FLOW_SOL], - geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], - config_container[donorZone], config_container[targetZone]); - } - else if (transfer_types[donorZone][targetZone] == CONJUGATE_HEAT_WEAKLY_SF) { - transfer_container[donorZone][targetZone]->Broadcast_InterfaceData_Interpolate(solver_container[donorZone][INST_0][MESH_0][HEAT_SOL],solver_container[targetZone][INST_0][MESH_0][HEAT_SOL], - geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], - config_container[donorZone], config_container[targetZone]); - } - else if ((transfer_types[donorZone][targetZone] == NO_TRANSFER) - || (transfer_types[donorZone][targetZone] == ZONES_ARE_EQUAL) - || (transfer_types[donorZone][targetZone] == NO_COMMON_INTERFACE)) { } - else { - cout << "WARNING: One of the intended interface transfer routines is not known to the chosen driver and has not been executed." << endl; - } - } - break; - - case SCATTER_DATA: - if (MatchingMesh) { - if (transfer_types[donorZone][targetZone] == SLIDING_INTERFACE) { - transfer_container[donorZone][targetZone]->Scatter_InterfaceData(solver_container[donorZone][INST_0][MESH_0][FLOW_SOL],solver_container[targetZone][INST_0][MESH_0][FLOW_SOL], - geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], - config_container[donorZone], config_container[targetZone]); - if (config_container[targetZone]->GetKind_Solver() == RANS) - transfer_container[donorZone][targetZone]->Scatter_InterfaceData(solver_container[donorZone][INST_0][MESH_0][TURB_SOL],solver_container[targetZone][INST_0][MESH_0][TURB_SOL], - geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], - config_container[donorZone], config_container[targetZone]); - } - else if (transfer_types[donorZone][targetZone] == CONJUGATE_HEAT_FS) { - transfer_container[donorZone][targetZone]->Scatter_InterfaceData(solver_container[donorZone][INST_0][MESH_0][FLOW_SOL],solver_container[targetZone][INST_0][MESH_0][HEAT_SOL], - geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], - config_container[donorZone], config_container[targetZone]); - } - else if (transfer_types[donorZone][targetZone] == CONJUGATE_HEAT_WEAKLY_FS) { - transfer_container[donorZone][targetZone]->Scatter_InterfaceData(solver_container[donorZone][INST_0][MESH_0][HEAT_SOL],solver_container[targetZone][INST_0][MESH_0][HEAT_SOL], - geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], - config_container[donorZone], config_container[targetZone]); - } - else if (transfer_types[donorZone][targetZone] == CONJUGATE_HEAT_SF) { - transfer_container[donorZone][targetZone]->Scatter_InterfaceData(solver_container[donorZone][INST_0][MESH_0][HEAT_SOL],solver_container[targetZone][INST_0][MESH_0][FLOW_SOL], - geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], - config_container[donorZone], config_container[targetZone]); - } - else if (transfer_types[donorZone][targetZone] == CONJUGATE_HEAT_WEAKLY_SF) { - transfer_container[donorZone][targetZone]->Scatter_InterfaceData(solver_container[donorZone][INST_0][MESH_0][HEAT_SOL],solver_container[targetZone][INST_0][MESH_0][HEAT_SOL], - geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], - config_container[donorZone], config_container[targetZone]); - } - else if ((transfer_types[donorZone][targetZone] == NO_TRANSFER) - || (transfer_types[donorZone][targetZone] == ZONES_ARE_EQUAL) - || (transfer_types[donorZone][targetZone] == NO_COMMON_INTERFACE)) { } - else { - cout << "WARNING: One of the specified interface transfer routines is not known to the chosen driver and has not been executed." << endl; - } - } - else { - SU2_MPI::Error("Scatter method not implemented for non-matching meshes. ", CURRENT_FUNCTION); - } - break; - - case ALLGATHER_DATA: - if (MatchingMesh) { - SU2_MPI::Error("Allgather method not implemented for matching meshes. ", CURRENT_FUNCTION); - } - else { - if (transfer_types[donorZone][targetZone] == SLIDING_INTERFACE) { - transfer_container[donorZone][targetZone]->Allgather_InterfaceData(solver_container[donorZone][INST_0][MESH_0][FLOW_SOL],solver_container[targetZone][INST_0][MESH_0][FLOW_SOL], - geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], - config_container[donorZone], config_container[targetZone]); - if (config_container[targetZone]->GetKind_Solver() == RANS) - transfer_container[donorZone][targetZone]->Allgather_InterfaceData(solver_container[donorZone][INST_0][MESH_0][TURB_SOL],solver_container[targetZone][INST_0][MESH_0][TURB_SOL], - geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], - config_container[donorZone], config_container[targetZone]); - } - else if (transfer_types[donorZone][targetZone] == CONJUGATE_HEAT_FS) { - transfer_container[donorZone][targetZone]->Allgather_InterfaceData(solver_container[donorZone][INST_0][MESH_0][FLOW_SOL],solver_container[targetZone][INST_0][MESH_0][HEAT_SOL], - geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], - config_container[donorZone], config_container[targetZone]); - } - else if (transfer_types[donorZone][targetZone] == CONJUGATE_HEAT_WEAKLY_FS) { - transfer_container[donorZone][targetZone]->Allgather_InterfaceData(solver_container[donorZone][INST_0][MESH_0][HEAT_SOL],solver_container[targetZone][INST_0][MESH_0][HEAT_SOL], - geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], - config_container[donorZone], config_container[targetZone]); - } - else if (transfer_types[donorZone][targetZone] == CONJUGATE_HEAT_SF) { - transfer_container[donorZone][targetZone]->Allgather_InterfaceData(solver_container[donorZone][INST_0][MESH_0][HEAT_SOL],solver_container[targetZone][INST_0][MESH_0][FLOW_SOL], - geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], - config_container[donorZone], config_container[targetZone]); - } - else if (transfer_types[donorZone][targetZone] == CONJUGATE_HEAT_WEAKLY_SF) { - transfer_container[donorZone][targetZone]->Allgather_InterfaceData(solver_container[donorZone][INST_0][MESH_0][HEAT_SOL],solver_container[targetZone][INST_0][MESH_0][HEAT_SOL], - geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], - config_container[donorZone], config_container[targetZone]); - } - else if ((transfer_types[donorZone][targetZone] == NO_TRANSFER) - || (transfer_types[donorZone][targetZone] == ZONES_ARE_EQUAL) - || (transfer_types[donorZone][targetZone] == NO_COMMON_INTERFACE)) { } - else { - cout << "WARNING: One of the specified interface transfer routines is not known to the chosen driver and can't be executed." << endl; - } - } - break; + if (transfer_types[donorZone][targetZone] == SLIDING_INTERFACE) { + transfer_container[donorZone][targetZone]->Broadcast_InterfaceData(solver_container[donorZone][INST_0][MESH_0][FLOW_SOL],solver_container[targetZone][INST_0][MESH_0][FLOW_SOL], + geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], + config_container[donorZone], config_container[targetZone]); + if (config_container[targetZone]->GetKind_Solver() == RANS) + transfer_container[donorZone][targetZone]->Broadcast_InterfaceData(solver_container[donorZone][INST_0][MESH_0][TURB_SOL],solver_container[targetZone][INST_0][MESH_0][TURB_SOL], + geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], + config_container[donorZone], config_container[targetZone]); } + else if (transfer_types[donorZone][targetZone] == CONJUGATE_HEAT_FS) { + transfer_container[donorZone][targetZone]->Broadcast_InterfaceData(solver_container[donorZone][INST_0][MESH_0][FLOW_SOL],solver_container[targetZone][INST_0][MESH_0][HEAT_SOL], + geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], + config_container[donorZone], config_container[targetZone]); + } + else if (transfer_types[donorZone][targetZone] == CONJUGATE_HEAT_WEAKLY_FS) { + transfer_container[donorZone][targetZone]->Broadcast_InterfaceData(solver_container[donorZone][INST_0][MESH_0][HEAT_SOL],solver_container[targetZone][INST_0][MESH_0][HEAT_SOL], + geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], + config_container[donorZone], config_container[targetZone]); + } + else if (transfer_types[donorZone][targetZone] == CONJUGATE_HEAT_SF) { + transfer_container[donorZone][targetZone]->Broadcast_InterfaceData(solver_container[donorZone][INST_0][MESH_0][HEAT_SOL],solver_container[targetZone][INST_0][MESH_0][FLOW_SOL], + geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], + config_container[donorZone], config_container[targetZone]); + } + else if (transfer_types[donorZone][targetZone] == CONJUGATE_HEAT_WEAKLY_SF) { + transfer_container[donorZone][targetZone]->Broadcast_InterfaceData(solver_container[donorZone][INST_0][MESH_0][HEAT_SOL],solver_container[targetZone][INST_0][MESH_0][HEAT_SOL], + geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], + config_container[donorZone], config_container[targetZone]); + } + else if ((transfer_types[donorZone][targetZone] == NO_TRANSFER) + || (transfer_types[donorZone][targetZone] == ZONES_ARE_EQUAL) + || (transfer_types[donorZone][targetZone] == NO_COMMON_INTERFACE)) { } + else { + cout << "WARNING: One of the intended interface transfer routines is not known to the chosen driver and has not been executed." << endl; + } + } diff --git a/SU2_CFD/src/iteration_structure.cpp b/SU2_CFD/src/iteration_structure.cpp index 1ae0b2ad812..8755a90e706 100644 --- a/SU2_CFD/src/iteration_structure.cpp +++ b/SU2_CFD/src/iteration_structure.cpp @@ -3441,16 +3441,6 @@ void CDiscAdjHeatIteration::Iterate(COutput *output, unsigned short val_iZone, unsigned short val_iInst) { - /* The commented part below can be removed entirely. - unsigned long ExtIter = config_container[val_iZone]->GetExtIter(); - unsigned long IntIter = 0; - bool unsteady = config_container[val_iZone]->GetUnsteady_Simulation() != STEADY; - - if (!unsteady) - IntIter = ExtIter; - else { - IntIter = config_container[val_iZone]->GetIntIter(); - } */ solver_container[val_iZone][val_iInst][MESH_0][ADJHEAT_SOL]->ExtractAdjoint_Solution(geometry_container[val_iZone][val_iInst][MESH_0], config_container[val_iZone]); diff --git a/SU2_CFD/src/solver_direct_elasticity.cpp b/SU2_CFD/src/solver_direct_elasticity.cpp index 35950b511e1..c52b4e9d524 100644 --- a/SU2_CFD/src/solver_direct_elasticity.cpp +++ b/SU2_CFD/src/solver_direct_elasticity.cpp @@ -1410,8 +1410,7 @@ void CFEASolver::Preprocessing(CGeometry *geometry, CSolver **solver_container, bool body_forces = config->GetDeadLoad(); // Body forces (dead loads). bool fsi = config->GetFSI_Simulation(); - bool consistent_interpolation = !config->GetMatchingMesh() && ( - !config->GetConservativeInterpolation() || + bool consistent_interpolation = (!config->GetConservativeInterpolation() || (config->GetKindInterpolation() == WEIGHTED_AVERAGE)); bool topology_mode = config->GetTopology_Optimization(); // Density-based topology optimization diff --git a/SU2_CFD/src/solver_direct_mean_inc.cpp b/SU2_CFD/src/solver_direct_mean_inc.cpp index e8abe52b058..bc32f846280 100644 --- a/SU2_CFD/src/solver_direct_mean_inc.cpp +++ b/SU2_CFD/src/solver_direct_mean_inc.cpp @@ -92,7 +92,9 @@ CIncEulerSolver::CIncEulerSolver(void) : CSolver() { Cauchy_Serie = NULL; FluidModel = NULL; - + + SlidingState = NULL; + SlidingStateNodes = NULL; } CIncEulerSolver::CIncEulerSolver(CGeometry *geometry, CConfig *config, unsigned short iMesh) : CSolver() { @@ -517,6 +519,31 @@ CIncEulerSolver::CIncEulerSolver(CGeometry *geometry, CConfig *config, unsigned break; } + /*--- Initializate quantities for SlidingMesh Interface ---*/ + + SlidingState = new su2double*** [nMarker]; + SlidingStateNodes = new int* [nMarker]; + + for (iMarker = 0; iMarker < nMarker; iMarker++){ + SlidingState[iMarker] = NULL; + SlidingStateNodes[iMarker] = NULL; + + if (config->GetMarker_All_KindBC(iMarker) == FLUID_INTERFACE){ + + SlidingState[iMarker] = new su2double**[geometry->GetnVertex(iMarker)]; + SlidingStateNodes[iMarker] = new int [geometry->GetnVertex(iMarker)]; + + for (iPoint = 0; iPoint < geometry->GetnVertex(iMarker); iPoint++){ + SlidingState[iMarker][iPoint] = new su2double*[nPrimVar+1]; + + SlidingStateNodes[iMarker][iPoint] = 0; + for (iVar = 0; iVar < nPrimVar+1; iVar++) + SlidingState[iMarker][iPoint][iVar] = NULL; + } + + } + } + /*--- Initialize the cauchy critera array for fixed CL mode ---*/ if (config->GetFixed_CL_Mode()) @@ -674,6 +701,29 @@ CIncEulerSolver::~CIncEulerSolver(void) { delete [] CharacPrimVar; } + if (SlidingState != NULL) { + for (iMarker = 0; iMarker < nMarker; iMarker++) { + if ( SlidingState[iMarker] != NULL ) { + for (iVertex = 0; iVertex < nVertex[iMarker]; iVertex++) + if ( SlidingState[iMarker][iVertex] != NULL ){ + for (iVar = 0; iVar < nPrimVar+1; iVar++) + delete [] SlidingState[iMarker][iVertex][iVar]; + delete [] SlidingState[iMarker][iVertex]; + } + delete [] SlidingState[iMarker]; + } + } + delete [] SlidingState; + } + + if ( SlidingStateNodes != NULL ){ + for (iMarker = 0; iMarker < nMarker; iMarker++){ + if (SlidingStateNodes[iMarker] != NULL) + delete [] SlidingStateNodes[iMarker]; + } + delete [] SlidingStateNodes; + } + if (Inlet_Ttotal != NULL) { for (iMarker = 0; iMarker < nMarker; iMarker++) if (Inlet_Ttotal[iMarker] != NULL) @@ -6009,6 +6059,153 @@ void CIncEulerSolver::BC_Sym_Plane(CGeometry *geometry, CSolver **solver_contain } +void CIncEulerSolver::BC_Fluid_Interface(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, + CConfig *config) { + + unsigned long iVertex, jVertex, iPoint, Point_Normal = 0; + unsigned short iDim, iVar, iMarker, nDonorVertex; + + bool implicit = (config->GetKind_TimeIntScheme_Flow() == EULER_IMPLICIT); + bool grid_movement = config->GetGrid_Movement(); + bool viscous = config->GetViscous(); + + su2double *Normal = new su2double[nDim]; + su2double *PrimVar_i = new su2double[nPrimVar]; + su2double *PrimVar_j = new su2double[nPrimVar]; + su2double *tmp_residual = new su2double[nVar]; + + su2double weight; + + for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { + + if (config->GetMarker_All_KindBC(iMarker) == FLUID_INTERFACE) { + + for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { + iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); + + if (geometry->node[iPoint]->GetDomain()) { + + nDonorVertex = GetnSlidingStates(iMarker, iVertex); + + /*--- Initialize Residual, this will serve to accumulate the average ---*/ + + for (iVar = 0; iVar < nVar; iVar++) + Residual[iVar] = 0.0; + + /*--- Loop over the nDonorVertexes and compute the averaged flux ---*/ + + for (jVertex = 0; jVertex < nDonorVertex; jVertex++){ + + Point_Normal = geometry->vertex[iMarker][iVertex]->GetNormal_Neighbor(); + + for (iVar = 0; iVar < nPrimVar; iVar++) { + PrimVar_i[iVar] = node[iPoint]->GetPrimitive(iVar); + PrimVar_j[iVar] = GetSlidingState(iMarker, iVertex, iVar, jVertex); + } + + /*--- Get the weight computed in the interpolator class for the j-th donor vertex ---*/ + + weight = GetSlidingState(iMarker, iVertex, nPrimVar, jVertex); + + /*--- Set primitive variables ---*/ + + conv_numerics->SetPrimitive( PrimVar_i, PrimVar_j ); + + /*--- Set the normal vector ---*/ + + geometry->vertex[iMarker][iVertex]->GetNormal(Normal); + for (iDim = 0; iDim < nDim; iDim++) + Normal[iDim] = -Normal[iDim]; + + conv_numerics->SetNormal(Normal); + + if (grid_movement) + conv_numerics->SetGridVel(geometry->node[iPoint]->GetGridVel(), geometry->node[iPoint]->GetGridVel()); + + /*--- Compute the convective residual using an upwind scheme ---*/ + + conv_numerics->ComputeResidual(tmp_residual, Jacobian_i, Jacobian_j, config); + + /*--- Accumulate the residuals to compute the average ---*/ + + for (iVar = 0; iVar < nVar; iVar++) + Residual[iVar] += weight*tmp_residual[iVar]; + + } + + /*--- Add Residuals and Jacobians ---*/ + + LinSysRes.AddBlock(iPoint, Residual); + if (implicit) + Jacobian.AddBlock(iPoint, iPoint, Jacobian_i); + + if (viscous) { + + /*--- Initialize Residual, this will serve to accumulate the average ---*/ + + for (iVar = 0; iVar < nVar; iVar++) + Residual[iVar] = 0.0; + + /*--- Loop over the nDonorVertexes and compute the averaged flux ---*/ + + for (jVertex = 0; jVertex < nDonorVertex; jVertex++){ + PrimVar_j[nDim+5] = GetSlidingState(iMarker, iVertex, nDim+5, jVertex); + PrimVar_j[nDim+6] = GetSlidingState(iMarker, iVertex, nDim+6, jVertex); + + /*--- Get the weight computed in the interpolator class for the j-th donor vertex ---*/ + + weight = GetSlidingState(iMarker, iVertex, nPrimVar, jVertex); + + /*--- Set the normal vector and the coordinates ---*/ + + visc_numerics->SetNormal(Normal); + visc_numerics->SetCoord(geometry->node[iPoint]->GetCoord(), geometry->node[Point_Normal]->GetCoord()); + + /*--- Primitive variables, and gradient ---*/ + + visc_numerics->SetPrimitive(PrimVar_i, PrimVar_j); + visc_numerics->SetPrimVarGradient(node[iPoint]->GetGradient_Primitive(), node[iPoint]->GetGradient_Primitive()); + + /*--- Turbulent kinetic energy ---*/ + + if (config->GetKind_Turb_Model() == SST) + visc_numerics->SetTurbKineticEnergy(solver_container[TURB_SOL]->node[iPoint]->GetSolution(0), solver_container[TURB_SOL]->node[iPoint]->GetSolution(0)); + + /*--- Set the wall shear stress values (wall functions) to -1 (no evaluation using wall functions) ---*/ + + visc_numerics->SetTauWall(-1.0, -1.0); + + /*--- Compute and update residual ---*/ + + visc_numerics->ComputeResidual(tmp_residual, Jacobian_i, Jacobian_j, config); + + /*--- Accumulate the residuals to compute the average ---*/ + + for (iVar = 0; iVar < nVar; iVar++) + Residual[iVar] += weight*tmp_residual[iVar]; + } + + LinSysRes.SubtractBlock(iPoint, Residual); + + /*--- Jacobian contribution for implicit integration ---*/ + + if (implicit) + Jacobian.SubtractBlock(iPoint, iPoint, Jacobian_i); + + } + } + } + } + } + + /*--- Free locally allocated memory ---*/ + + delete [] tmp_residual; + delete [] Normal; + delete [] PrimVar_i; + delete [] PrimVar_j; +} + void CIncEulerSolver::BC_Custom(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, CConfig *config, unsigned short val_marker) { } void CIncEulerSolver::SetResidual_DualTime(CGeometry *geometry, CSolver **solver_container, CConfig *config, @@ -6390,7 +6587,7 @@ void CIncEulerSolver::GetOutlet_Properties(CGeometry *geometry, CConfig *config, AxiFactor = 1.0; } - Density = V_outlet[nDim+2]; + Density = V_outlet[nDim+2]; Velocity2 = 0.0; Area = 0.0; MassFlow = 0.0; @@ -6867,6 +7064,9 @@ CIncNSSolver::CIncNSSolver(void) : CIncEulerSolver() { CMerit_Visc = NULL; CT_Visc = NULL; CQ_Visc = NULL; + SlidingState = NULL; + SlidingStateNodes = NULL; + } CIncNSSolver::CIncNSSolver(CGeometry *geometry, CConfig *config, unsigned short iMesh) : CIncEulerSolver() { @@ -7351,6 +7551,32 @@ CIncNSSolver::CIncNSSolver(CGeometry *geometry, CConfig *config, unsigned short break; } + /*--- Initializate quantities for SlidingMesh Interface ---*/ + + SlidingState = new su2double*** [nMarker]; + SlidingStateNodes = new int* [nMarker]; + + for (iMarker = 0; iMarker < nMarker; iMarker++){ + + SlidingState[iMarker] = NULL; + SlidingStateNodes[iMarker] = NULL; + + if (config->GetMarker_All_KindBC(iMarker) == FLUID_INTERFACE){ + + SlidingState[iMarker] = new su2double**[geometry->GetnVertex(iMarker)]; + SlidingStateNodes[iMarker] = new int [geometry->GetnVertex(iMarker)]; + + for (iPoint = 0; iPoint < geometry->GetnVertex(iMarker); iPoint++){ + SlidingState[iMarker][iPoint] = new su2double*[nPrimVar+1]; + + SlidingStateNodes[iMarker][iPoint] = 0; + for (iVar = 0; iVar < nPrimVar+1; iVar++) + SlidingState[iMarker][iPoint][iVar] = NULL; + } + + } + } + /*--- Initialize the cauchy critera array for fixed CL mode ---*/ if (config->GetFixed_CL_Mode()) diff --git a/SU2_CFD/src/transfer_physics.cpp b/SU2_CFD/src/transfer_physics.cpp index 3553e661b2b..fda4f4ac89d 100644 --- a/SU2_CFD/src/transfer_physics.cpp +++ b/SU2_CFD/src/transfer_physics.cpp @@ -53,8 +53,7 @@ void CTransfer_FlowTraction::Preprocess(CConfig *flow_config) { /*--- Store if consistent interpolation is in use, in which case we need to transfer stresses and integrate on the structural side rather than directly transferring forces. ---*/ - consistent_interpolation = !flow_config->GetMatchingMesh() && ( - !flow_config->GetConservativeInterpolation() || + consistent_interpolation = (!flow_config->GetConservativeInterpolation() || (flow_config->GetKindInterpolation() == WEIGHTED_AVERAGE)); /*--- Compute the constant factor to dimensionalize pressure and shear stress. ---*/ @@ -514,7 +513,34 @@ CTransfer_SlidingInterface::CTransfer_SlidingInterface(void) : CTransfer() { } -CTransfer_SlidingInterface::CTransfer_SlidingInterface(unsigned short val_nVar, unsigned short val_nConst, CConfig *config) : CTransfer(val_nVar, val_nConst, config) { +CTransfer_SlidingInterface::CTransfer_SlidingInterface(unsigned short val_nVar, unsigned short val_nConst, CConfig *config) : CTransfer() { + + rank = SU2_MPI::GetRank(); + size = SU2_MPI::GetSize(); + + Physical_Constants = NULL; + Donor_Variable = NULL; + Target_Variable = NULL; + + unsigned short iVar; + + Physical_Constants = new su2double[val_nConst]; + Donor_Variable = new su2double[val_nVar]; + + Target_Variable = new su2double[val_nVar+1]; + + valAggregated = false; + + nVar = val_nVar; + + for (iVar = 0; iVar < nVar; iVar++) { + Donor_Variable[iVar] = 0.0; + Target_Variable[iVar] = 0.0; + } + + for (iVar = 0; iVar < val_nConst; iVar++) { + Physical_Constants[iVar] = 0.0; + } } @@ -553,6 +579,23 @@ void CTransfer_SlidingInterface::GetDonor_Variable(CSolver *donor_solution, CGeo } } +void CTransfer_SlidingInterface::InitializeTarget_Variable(CSolver *target_solution, unsigned long Marker_Target, + unsigned long Vertex_Target, unsigned short nDonorPoints) { + + target_solution->SetnSlidingStates(Marker_Target, Vertex_Target, nDonorPoints); // This is to allocate + target_solution->SetSlidingStateStructure(Marker_Target, Vertex_Target); + target_solution->SetnSlidingStates(Marker_Target, Vertex_Target, 0); // Reset counter to 0 + +} + +void CTransfer_SlidingInterface::RecoverTarget_Variable(long indexPoint_iVertex, su2double *Buffer_Bcast_Variables, + su2double donorCoeff){ + for (unsigned short iVar = 0; iVar < nVar; iVar++) + Target_Variable[iVar] = Buffer_Bcast_Variables[ indexPoint_iVertex*nVar + iVar ]; + + Target_Variable[nVar] = donorCoeff; +} + void CTransfer_SlidingInterface::SetTarget_Variable(CSolver *target_solution, CGeometry *target_geometry, CConfig *target_config, unsigned long Marker_Target, unsigned long Vertex_Target, unsigned long Point_Target) { diff --git a/SU2_CFD/src/transfer_structure.cpp b/SU2_CFD/src/transfer_structure.cpp index 45e24f335bf..1f5ced99835 100644 --- a/SU2_CFD/src/transfer_structure.cpp +++ b/SU2_CFD/src/transfer_structure.cpp @@ -65,11 +65,10 @@ CTransfer::CTransfer(unsigned short val_nVar, unsigned short val_nConst, CConfig Physical_Constants = new su2double[val_nConst]; Donor_Variable = new su2double[val_nVar]; - - if( config->GetFSI_Simulation() ) - Target_Variable = new su2double[val_nVar]; - else - Target_Variable = new su2double[val_nVar+1]; + Target_Variable = new su2double[val_nVar]; + + /*--- By default, the value is aggregated in the transfer routine ---*/ + valAggregated = true; nVar = val_nVar; @@ -89,720 +88,19 @@ CTransfer::CTransfer(unsigned short val_nVar, unsigned short val_nConst, CConfig CTransfer::~CTransfer(void) { - if (Physical_Constants != NULL) delete [] Physical_Constants; - if (Donor_Variable != NULL) delete [] Donor_Variable; - if (Target_Variable != NULL) delete [] Target_Variable; - - if (SpanValueCoeffTarget != NULL) delete[] SpanValueCoeffTarget; - if (SpanLevelDonor != NULL) delete[] SpanLevelDonor; - - -} - -void CTransfer::Scatter_InterfaceData(CSolver *donor_solution, CSolver *target_solution, - CGeometry *donor_geometry, CGeometry *target_geometry, - CConfig *donor_config, CConfig *target_config) { - - unsigned short nMarkerInt, nMarkerDonor, nMarkerTarget; // Number of markers on the interface, donor and target side - unsigned short iMarkerInt, iMarkerDonor, iMarkerTarget; // Variables for iteration over markers - int Marker_Donor = -1, Marker_Target = -1; - int Target_check, Donor_check; - - unsigned long iVertex; // Variables for iteration over vertices and nodes - - unsigned short iVar; - - GetPhysical_Constants(donor_solution, target_solution, donor_geometry, target_geometry, - donor_config, target_config); - - unsigned long Point_Donor, Point_Target; - - bool fsi = donor_config->GetFSI_Simulation(); - -#ifdef HAVE_MPI - int *Buffer_Recv_mark = NULL, iRank; - - if (rank == MASTER_NODE) - Buffer_Recv_mark = new int[size]; -#endif - - unsigned long nLocalVertexDonor = 0, nLocalVertexTarget = 0; - unsigned long MaxLocalVertexDonor = 0, MaxLocalVertexTarget = 0; - - unsigned long nBuffer_DonorVariables = 0, nBuffer_TargetVariables = 0; - unsigned long nBuffer_DonorIndices = 0, nBuffer_TargetIndices = 0; - - unsigned long Processor_Target; - - int iProcessor, nProcessor = 0; - - /*--- Number of markers on the FSI interface ---*/ - - nMarkerInt = (donor_config->GetMarker_n_ZoneInterface())/2; - nMarkerTarget = target_geometry->GetnMarker(); - nMarkerDonor = donor_geometry->GetnMarker(); - - nProcessor = size; - - /*--- Outer loop over the markers on the FSI interface: compute one by one ---*/ - /*--- The tags are always an integer greater than 1: loop from 1 to nMarkerFSI ---*/ - - for (iMarkerInt = 1; iMarkerInt <= nMarkerInt; iMarkerInt++) { - - Marker_Donor = -1; - Marker_Target = -1; - - /*--- Initialize pointer buffers inside the loop, so we can delete for each marker. ---*/ - unsigned long Buffer_Send_nVertexDonor[1], *Buffer_Recv_nVertexDonor = NULL; - unsigned long Buffer_Send_nVertexTarget[1], *Buffer_Recv_nVertexTarget = NULL; - - /*--- The donor and target markers are tagged with the same index. - *--- This is independent of the MPI domain decomposition. - *--- We need to loop over all markers on both sides and get the number of nodes - *--- that belong to each FSI marker for each processor ---*/ - - /*--- On the donor side ---*/ - - for (iMarkerDonor = 0; iMarkerDonor < nMarkerDonor; iMarkerDonor++) { - /*--- If the tag GetMarker_All_ZoneInterface(iMarkerDonor) equals the index we are looping at ---*/ - if ( donor_config->GetMarker_All_ZoneInterface(iMarkerDonor) == iMarkerInt ) { - Marker_Donor = iMarkerDonor; - /*--- Exit the for loop: we have found the local index for iMarkerFSI on the FEA side ---*/ - break; - } - } - - /*--- On the target side ---*/ - - for (iMarkerTarget = 0; iMarkerTarget < nMarkerTarget; iMarkerTarget++) { - /*--- If the tag GetMarker_All_ZoneInterface(iMarkerFlow) equals the index we are looping at ---*/ - if ( target_config->GetMarker_All_ZoneInterface(iMarkerTarget) == iMarkerInt ) { - Marker_Target = iMarkerTarget; - /*--- Exit the for loop: we have found the local index for iMarkerFSI on the FEA side ---*/ - break; - } - } - - #ifdef HAVE_MPI - - Donor_check = -1; - Target_check = -1; - - /*--- We gather a vector in MASTER_NODE that determines if the boundary is not on the processor because of the partition or because the zone does not include it ---*/ - - SU2_MPI::Gather(&Marker_Donor , 1, MPI_INT, Buffer_Recv_mark, 1, MPI_INT, MASTER_NODE, MPI_COMM_WORLD); - - if (rank == MASTER_NODE) { - for (iRank = 0; iRank < nProcessor; iRank++) { - if( Buffer_Recv_mark[iRank] != -1 ) { - Donor_check = Buffer_Recv_mark[iRank]; - break; - } - } - } - - SU2_MPI::Bcast(&Donor_check , 1, MPI_INT, MASTER_NODE, MPI_COMM_WORLD); - - SU2_MPI::Gather(&Marker_Target, 1, MPI_INT, Buffer_Recv_mark, 1, MPI_INT, MASTER_NODE, MPI_COMM_WORLD); - - if (rank == MASTER_NODE) { - for (iRank = 0; iRank < nProcessor; iRank++) { - if( Buffer_Recv_mark[iRank] != -1 ) { - Target_check = Buffer_Recv_mark[iRank]; - break; - } - } - } - - SU2_MPI::Bcast(&Target_check, 1, MPI_INT, MASTER_NODE, MPI_COMM_WORLD); - - #else - Donor_check = Marker_Donor; - Target_check = Marker_Target; - #endif - - if(Target_check == -1 || Donor_check == -1) { - continue; - } - - nLocalVertexDonor = 0; - nLocalVertexTarget = 0; - - if( Marker_Donor != -1 ) - nLocalVertexDonor = donor_geometry->GetnVertex(Marker_Donor); - - if( Marker_Target != -1 ) - nLocalVertexTarget = target_geometry->GetnVertex(Marker_Target); - - Buffer_Send_nVertexDonor[0] = nLocalVertexDonor; // Retrieve total number of vertices on Donor marker - Buffer_Send_nVertexTarget[0] = nLocalVertexTarget; // Retrieve total number of vertices on Target marker - - if (rank == MASTER_NODE) Buffer_Recv_nVertexDonor = new unsigned long[size]; // Allocate memory to receive how many vertices are on each rank on the structural side - if (rank == MASTER_NODE) Buffer_Recv_nVertexTarget = new unsigned long[size]; // Allocate memory to receive how many vertices are on each rank on the fluid side -#ifdef HAVE_MPI - /*--- We receive MaxLocalVertexFEA as the maximum number of vertices in one single processor on the structural side---*/ - SU2_MPI::Allreduce(&nLocalVertexDonor, &MaxLocalVertexDonor, 1, MPI_UNSIGNED_LONG, MPI_MAX, MPI_COMM_WORLD); - /*--- We receive MaxLocalVertexFlow as the maximum number of vertices in one single processor on the fluid side ---*/ - SU2_MPI::Allreduce(&nLocalVertexTarget, &MaxLocalVertexTarget, 1, MPI_UNSIGNED_LONG, MPI_MAX, MPI_COMM_WORLD); - - /*--- We gather a vector in MASTER_NODE that determines how many elements are there on each processor on the structural side ---*/ - SU2_MPI::Gather(&Buffer_Send_nVertexDonor, 1, MPI_UNSIGNED_LONG, Buffer_Recv_nVertexDonor, 1, MPI_UNSIGNED_LONG, MASTER_NODE, MPI_COMM_WORLD); - /*--- We gather a vector in MASTER_NODE that determines how many elements are there on each processor on the fluid side ---*/ - SU2_MPI::Gather(&Buffer_Send_nVertexTarget, 1, MPI_UNSIGNED_LONG, Buffer_Recv_nVertexTarget, 1, MPI_UNSIGNED_LONG, MASTER_NODE, MPI_COMM_WORLD); -#else - MaxLocalVertexDonor = nLocalVertexDonor; - MaxLocalVertexTarget = nLocalVertexTarget; - - Buffer_Recv_nVertexDonor[0] = Buffer_Send_nVertexDonor[0]; - Buffer_Recv_nVertexTarget[0] = Buffer_Send_nVertexTarget[0]; - -#endif - - /*--- We will be gathering the structural coordinates into the master node ---*/ - /*--- Then we will distribute them using a scatter operation into the appropriate fluid processor ---*/ - nBuffer_DonorVariables = MaxLocalVertexDonor * nVar; - nBuffer_TargetVariables = MaxLocalVertexTarget * nVar; - - /*--- We will be gathering donor index and donor processor (for flow -> donor = structure) ---*/ - /*--- Then we will pass on to the structural side the index (fea point) to the appropriate processor ---*/ - nBuffer_DonorIndices = 2 * MaxLocalVertexDonor; - nBuffer_TargetIndices = MaxLocalVertexTarget; - - /*--- Send and Recv buffers ---*/ - - /*--- Buffers to send and receive the variables in the donor mesh ---*/ - su2double *Buffer_Send_DonorVariables = new su2double[nBuffer_DonorVariables]; - su2double *Buffer_Recv_DonorVariables = NULL; - - /*--- Buffers to send and receive the indices in the donor mesh ---*/ - long *Buffer_Send_DonorIndices = new long[nBuffer_DonorIndices]; - long *Buffer_Recv_DonorIndices = NULL; - - /*--- Buffers to send and receive the variables in the target mesh---*/ - su2double *Buffer_Send_TargetVariables = NULL; - su2double *Buffer_Recv_TargetVariables = new su2double[nBuffer_TargetVariables]; - - /*--- Buffers to send and receive the target indices ---*/ - long *Buffer_Send_TargetIndices = NULL; - long *Buffer_Recv_TargetIndices = new long[nBuffer_TargetIndices]; - - /*--- Prepare the receive buffers (1st step) and send buffers (2nd step) on the master node only. ---*/ - - if (rank == MASTER_NODE) { - Buffer_Recv_DonorVariables = new su2double[size*nBuffer_DonorVariables]; - Buffer_Recv_DonorIndices = new long[size*nBuffer_DonorIndices]; - Buffer_Send_TargetVariables = new su2double[size*nBuffer_TargetVariables]; - Buffer_Send_TargetIndices = new long[size*nBuffer_TargetIndices]; - } - - /*--- On the fluid side ---*/ - - /*--- If this processor owns the marker we are looping at on the structural side ---*/ - - /*--- First we initialize all of the indices and processors to -1 ---*/ - /*--- This helps on identifying halo nodes and avoids setting wrong values ---*/ - for (iVertex = 0; iVertex < nBuffer_DonorIndices; iVertex++) - Buffer_Send_DonorIndices[iVertex] = -1; - - /*--- We have identified the local index of the FEA marker ---*/ - /*--- We loop over all the vertices in that marker and in that particular processor ---*/ - - for (iVertex = 0; iVertex < nLocalVertexDonor; iVertex++) { - - Point_Donor = donor_geometry->vertex[Marker_Donor][iVertex]->GetNode(); - - /*--- If this processor owns the node ---*/ - if (donor_geometry->node[Point_Donor]->GetDomain()) { - Point_Target = donor_geometry->vertex[Marker_Donor][iVertex]->GetDonorPoint(); - - Processor_Target = donor_geometry->vertex[Marker_Donor][iVertex]->GetDonorProcessor(); - - GetDonor_Variable(donor_solution, donor_geometry, donor_config, Marker_Donor, iVertex, Point_Donor); - - for (iVar = 0; iVar < nVar; iVar++) - Buffer_Send_DonorVariables[iVertex*nVar+iVar] = Donor_Variable[iVar]; - - - Buffer_Send_DonorIndices[2*iVertex] = Point_Target; - Buffer_Send_DonorIndices[2*iVertex + 1] = Processor_Target; - } - - } - - -#ifdef HAVE_MPI - /*--- Once all the messages have been sent, we gather them all into the MASTER_NODE ---*/ - SU2_MPI::Gather(Buffer_Send_DonorVariables, nBuffer_DonorVariables, MPI_DOUBLE, Buffer_Recv_DonorVariables, nBuffer_DonorVariables, MPI_DOUBLE, MASTER_NODE, MPI_COMM_WORLD); - SU2_MPI::Gather(Buffer_Send_DonorIndices, nBuffer_DonorIndices, MPI_LONG, Buffer_Recv_DonorIndices, nBuffer_DonorIndices, MPI_LONG, MASTER_NODE, MPI_COMM_WORLD); - -#else - for (unsigned long iVariable = 0; iVariable < nBuffer_DonorVariables; iVariable++) - Buffer_Recv_DonorVariables[iVariable] = Buffer_Send_DonorVariables[iVariable]; - for (unsigned long iVariable = 0; iVariable < nBuffer_DonorIndices; iVariable++) - Buffer_Recv_DonorIndices[iVariable] = Buffer_Send_DonorIndices[iVariable]; -#endif - - /*--- Counter to determine where in the array we have to set the information ---*/ - long *Counter_Processor_Target = NULL; - long iProcessor_Donor = 0, iIndex_Donor = 0; - long iProcessor_Target = 0, iPoint_Target = 0, iIndex_Target = 0; - long Point_Target_Send = 0, Processor_Target_Send = 0; - - /*--- Now we pack the information to send it over to the different processors ---*/ - - if (rank == MASTER_NODE) { - - /*--- We set the counter to 0 ---*/ - Counter_Processor_Target = new long[nProcessor]; - for (iProcessor = 0; iProcessor < nProcessor; iProcessor++) { - Counter_Processor_Target[iProcessor] = 0; - } - - /*--- First we initialize the index vector to -1 ---*/ - /*--- This helps on identifying halo nodes and avoids setting wrong values ---*/ - for (iVertex = 0; iVertex < nProcessor*nBuffer_TargetIndices; iVertex++) - Buffer_Send_TargetIndices[iVertex] = -2; - - /*--- As of now we do the loop over the flow points ---*/ - /*--- The number of points for flow and structure does not necessarily have to match ---*/ - /*--- In fact, it's possible that a processor asks for nStruct nodes and there are only ---*/ - /*--- nFlow < nStruct available; this is due to halo nodes ---*/ - - /*--- For every processor from which we have received information ---*/ - /*--- (This is, for every processor on the structural side) ---*/ - for (iProcessor = 0; iProcessor < nProcessor; iProcessor++) { - - /*--- This is the initial index on the coordinates buffer for that particular processor on the structural side ---*/ - iProcessor_Donor = iProcessor*nBuffer_DonorVariables; - /*--- This is the initial index on the donor index/processor buffer for that particular processor on the structural side ---*/ - iIndex_Donor = iProcessor*nBuffer_DonorIndices; - - /*--- For every vertex in the information retreived from iProcessor ---*/ - for (iVertex = 0; iVertex < Buffer_Recv_nVertexDonor[iProcessor]; iVertex++) { - - /*--- The processor and index for the flow are: ---*/ - Processor_Target_Send = Buffer_Recv_DonorIndices[iIndex_Donor+iVertex*2+1]; - Point_Target_Send = Buffer_Recv_DonorIndices[iIndex_Donor+iVertex*2]; - - /*--- Load the buffer at the appropriate position ---*/ - /*--- This is determined on the fluid side by: - *--- Processor_Target*nBuffer_StructTraction -> Initial position of the processor array (fluid side) - *--- + - *--- Counter_Processor_Struct*nVar -> Initial position of the nVar array for the particular point on the fluid side - *--- + - *--- iVar -> Position within the nVar array that corresponds to a point - *--- - *--- While on the structural side is: - *--- iProcessor*nBuffer_FlowTraction -> Initial position on the processor array (structural side) - *--- + - *--- iVertex*nVar -> Initial position of the nVar array for the particular point on the structural side - */ - - /*--- We check that we are not setting the value for a halo node ---*/ - if (Point_Target_Send != -1) { - iProcessor_Target = Processor_Target_Send*nBuffer_TargetVariables; - iIndex_Target = Processor_Target_Send*nBuffer_TargetIndices; - iPoint_Target = Counter_Processor_Target[Processor_Target_Send]*nVar; - - for (iVar = 0; iVar < nVar; iVar++) - Buffer_Send_TargetVariables[iProcessor_Target + iPoint_Target + iVar] = Buffer_Recv_DonorVariables[iProcessor_Donor + iVertex*nVar + iVar]; - - /*--- We set the fluid index at an appropriate position matching the coordinates ---*/ - Buffer_Send_TargetIndices[iIndex_Target + Counter_Processor_Target[Processor_Target_Send]] = Point_Target_Send; - - Counter_Processor_Target[Processor_Target_Send]++; - } - - } - - } - - } - -#ifdef HAVE_MPI - /*--- Once all the messages have been prepared, we scatter them all from the MASTER_NODE ---*/ - SU2_MPI::Scatter(Buffer_Send_TargetVariables, nBuffer_TargetVariables, MPI_DOUBLE, Buffer_Recv_TargetVariables, nBuffer_TargetVariables, MPI_DOUBLE, MASTER_NODE, MPI_COMM_WORLD); - SU2_MPI::Scatter(Buffer_Send_TargetIndices, nBuffer_TargetIndices, MPI_LONG, Buffer_Recv_TargetIndices, nBuffer_TargetIndices, MPI_LONG, MASTER_NODE, MPI_COMM_WORLD); -#else - for (unsigned long iVariable = 0; iVariable < nBuffer_TargetVariables; iVariable++) - Buffer_Recv_TargetVariables[iVariable] = Buffer_Send_TargetVariables[iVariable]; - for (unsigned long iVariable = 0; iVariable < nBuffer_TargetIndices; iVariable++) - Buffer_Recv_TargetIndices[iVariable] = Buffer_Send_TargetIndices[iVariable]; -#endif - - long indexPoint_iVertex, Point_Target_Check =0; - - /*--- For the target marker we are studying ---*/ - if (Marker_Target >= 0) { - - /*--- We have identified the local index of the Structural marker ---*/ - /*--- We loop over all the vertices in that marker and in that particular processor ---*/ - - for (iVertex = 0; iVertex < nLocalVertexTarget; iVertex++) { - - Point_Target = target_geometry->vertex[Marker_Target][iVertex]->GetNode(); - - if (target_geometry->node[Point_Target]->GetDomain()) { - /*--- Find the index of the point Point_Struct in the buffer Buffer_Recv_SetIndex ---*/ - indexPoint_iVertex = std::distance(Buffer_Recv_TargetIndices, std::find(Buffer_Recv_TargetIndices, Buffer_Recv_TargetIndices + MaxLocalVertexTarget, Point_Target)); - - Point_Target_Check = Buffer_Recv_TargetIndices[indexPoint_iVertex]; - - if (Point_Target_Check < 0 && fsi) { - SU2_MPI::Error("A nonphysical point is being considered for traction transfer.", CURRENT_FUNCTION); - } - - for (iVar = 0; iVar < nVar; iVar++) - Target_Variable[iVar] = Buffer_Recv_TargetVariables[indexPoint_iVertex*nVar+iVar]; - - SetTarget_Variable(target_solution, target_geometry, target_config, Marker_Target, iVertex, Point_Target); - - } - - } - - } - - delete [] Buffer_Send_DonorVariables; - delete [] Buffer_Send_DonorIndices; - delete [] Buffer_Recv_TargetVariables; - delete [] Buffer_Recv_TargetIndices; - - if (rank == MASTER_NODE) { - delete [] Buffer_Recv_nVertexDonor; - delete [] Buffer_Recv_nVertexTarget; - delete [] Buffer_Recv_DonorVariables; - delete [] Buffer_Recv_DonorIndices; - delete [] Buffer_Send_TargetVariables; - delete [] Buffer_Send_TargetIndices; - delete [] Counter_Processor_Target; - } - - } - - #ifdef HAVE_MPI - if (rank == MASTER_NODE && Buffer_Recv_mark != NULL) - delete [] Buffer_Recv_mark; - #endif - -} - -void CTransfer::Broadcast_InterfaceData_Matching(CSolver *donor_solution, CSolver *target_solution, - CGeometry *donor_geometry, CGeometry *target_geometry, - CConfig *donor_config, CConfig *target_config) { - - unsigned short nMarkerInt, nMarkerDonor, nMarkerTarget; // Number of markers on the interface, donor and target side - unsigned short iMarkerInt, iMarkerDonor, iMarkerTarget; // Variables for iteration over markers - int Marker_Donor = -1, Marker_Target = -1; - int Target_check, Donor_check; - - unsigned long iVertex; // Variables for iteration over vertices and nodes - - unsigned short iVar; - - GetPhysical_Constants(donor_solution, target_solution, donor_geometry, target_geometry, - donor_config, target_config); - - unsigned long Point_Donor_Global, Donor_Global_Index; - unsigned long Point_Donor, Point_Target; - - bool fsi = donor_config->GetFSI_Simulation(); - -#ifdef HAVE_MPI - int *Buffer_Recv_mark = NULL, iRank; - - if (rank == MASTER_NODE) - Buffer_Recv_mark = new int[size]; -#endif - - unsigned long iLocalVertex = 0; - unsigned long nLocalVertexDonor = 0, nLocalVertexDonorOwned = 0; - - unsigned long MaxLocalVertexDonor = 0; - unsigned long TotalVertexDonor = 0; - - unsigned long nBuffer_DonorVariables = 0; - unsigned long nBuffer_DonorIndices = 0; - - unsigned long nBuffer_BcastVariables = 0, nBuffer_BcastIndices = 0; - - int nProcessor = 0; - - /*--- Number of markers on the FSI interface ---*/ - - nMarkerInt = ( donor_config->GetMarker_n_ZoneInterface() ) / 2; - nMarkerTarget = target_geometry->GetnMarker(); - nMarkerDonor = donor_geometry->GetnMarker(); - - nProcessor = size; - - /*--- Outer loop over the markers on the FSI interface: compute one by one ---*/ - /*--- The tags are always an integer greater than 1: loop from 1 to nMarkerFSI ---*/ - - for (iMarkerInt = 1; iMarkerInt <= nMarkerInt; iMarkerInt++) { - - Marker_Donor = -1; - Marker_Target = -1; - - /*--- Initialize pointer buffers inside the loop, so we can delete for each marker. ---*/ - unsigned long Buffer_Send_nVertexDonor[1], *Buffer_Recv_nVertexDonor = NULL; - - for (iMarkerDonor = 0; iMarkerDonor < nMarkerDonor; iMarkerDonor++) { - /*--- If the tag GetMarker_All_ZoneInterface(iMarkerDonor) equals the index we are looping at ---*/ - if ( donor_config->GetMarker_All_ZoneInterface(iMarkerDonor) == iMarkerInt ) { - Marker_Donor = iMarkerDonor; - /*--- Exit the for loop: we have found the local index for iMarkerFSI on the FEA side ---*/ - break; - } - } - - /*--- On the target side we only have to identify the marker; then we'll loop over it and retrieve from the fluid points ---*/ - - for (iMarkerTarget = 0; iMarkerTarget < nMarkerTarget; iMarkerTarget++) { - /*--- If the tag GetMarker_All_ZoneInterface(iMarkerFlow) equals the index we are looping at ---*/ - if ( target_config->GetMarker_All_ZoneInterface(iMarkerTarget) == iMarkerInt ) { - /*--- Store the identifier for the fluid marker ---*/ - Marker_Target = iMarkerTarget; - /*--- Exit the for loop: we have found the local index for iMarkerFSI on the FEA side ---*/ - break; - } - } - - #ifdef HAVE_MPI - - Donor_check = -1; - Target_check = -1; - - /*--- We gather a vector in MASTER_NODE that determines if the boundary is not on the processor because of the partition or because the zone does not include it ---*/ - - SU2_MPI::Gather(&Marker_Donor , 1, MPI_INT, Buffer_Recv_mark, 1, MPI_INT, MASTER_NODE, MPI_COMM_WORLD); - - if (rank == MASTER_NODE) { - for (iRank = 0; iRank < nProcessor; iRank++) { - if( Buffer_Recv_mark[iRank] != -1 ) { - Donor_check = Buffer_Recv_mark[iRank]; - break; - } - } - } - - SU2_MPI::Bcast(&Donor_check , 1, MPI_INT, MASTER_NODE, MPI_COMM_WORLD); - - SU2_MPI::Gather(&Marker_Target, 1, MPI_INT, Buffer_Recv_mark, 1, MPI_INT, MASTER_NODE, MPI_COMM_WORLD); - - if (rank == MASTER_NODE) { - for (iRank = 0; iRank < nProcessor; iRank++) { - if( Buffer_Recv_mark[iRank] != -1 ) { - Target_check = Buffer_Recv_mark[iRank]; - break; - } - } - } - - SU2_MPI::Bcast(&Target_check, 1, MPI_INT, MASTER_NODE, MPI_COMM_WORLD); - - #else - Donor_check = Marker_Donor; - Target_check = Marker_Target; - #endif - - if(Target_check == -1 || Donor_check == -1) { - continue; - } - - nLocalVertexDonorOwned = 0; - nLocalVertexDonor = 0; - - if( Marker_Donor != -1 ) { - nLocalVertexDonor = donor_geometry->GetnVertex(Marker_Donor); - - for (iVertex = 0; iVertex < nLocalVertexDonor; iVertex++) { - Point_Donor = donor_geometry->vertex[Marker_Donor][iVertex]->GetNode(); - if (donor_geometry->node[Point_Donor]->GetDomain()) - nLocalVertexDonorOwned++; - } - } - - Buffer_Send_nVertexDonor[0] = nLocalVertexDonor; // Retrieve total number of vertices on Donor marker - - if (rank == MASTER_NODE) Buffer_Recv_nVertexDonor = new unsigned long[size]; // Allocate memory to receive how many vertices are on each rank on the structural side - -#ifdef HAVE_MPI - /*--- We receive MaxLocalVertexDonor as the maximum number of vertices in one single processor on the donor side---*/ - SU2_MPI::Allreduce(&nLocalVertexDonor, &MaxLocalVertexDonor, 1, MPI_UNSIGNED_LONG, MPI_MAX, MPI_COMM_WORLD); - /*--- We receive TotalVertexDonorOwned as the total (real) number of vertices in one single interface marker on the donor side ---*/ - SU2_MPI::Allreduce(&nLocalVertexDonorOwned, &TotalVertexDonor, 1, MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); - /*--- We gather a vector in MASTER_NODE that determines how many elements are there on each processor on the structural side ---*/ - SU2_MPI::Gather(&Buffer_Send_nVertexDonor, 1, MPI_UNSIGNED_LONG, Buffer_Recv_nVertexDonor, 1, MPI_UNSIGNED_LONG, MASTER_NODE, MPI_COMM_WORLD); -#else - MaxLocalVertexDonor = nLocalVertexDonor; - TotalVertexDonor = nLocalVertexDonorOwned; - Buffer_Recv_nVertexDonor[0] = Buffer_Send_nVertexDonor[0]; -#endif - - /*--- We will be gathering the donor information into the master node ---*/ - nBuffer_DonorVariables = MaxLocalVertexDonor * nVar; - nBuffer_DonorIndices = MaxLocalVertexDonor; - - /*--- Then we will broadcasting it to all the processors so they can retrieve the info they need ---*/ - /*--- We only broadcast those nodes that we need ---*/ - nBuffer_BcastVariables = TotalVertexDonor * nVar; - nBuffer_BcastIndices = TotalVertexDonor; - - /*--- Send and Recv buffers ---*/ - - /*--- Buffers to send and receive the variables in the donor mesh ---*/ - su2double *Buffer_Send_DonorVariables = new su2double[nBuffer_DonorVariables]; - su2double *Buffer_Recv_DonorVariables = NULL; - - /*--- Buffers to send and receive the indices in the donor mesh ---*/ - long *Buffer_Send_DonorIndices = new long[nBuffer_DonorIndices]; - long *Buffer_Recv_DonorIndices = NULL; - - /*--- Buffers to broadcast the variables and the indices ---*/ - su2double *Buffer_Bcast_Variables = new su2double[nBuffer_BcastVariables]; - long *Buffer_Bcast_Indices = new long[nBuffer_BcastIndices]; - - /*--- Prepare the receive buffers (1st step) and send buffers (2nd step) on the master node only. ---*/ - - if (rank == MASTER_NODE) { - Buffer_Recv_DonorVariables = new su2double[size*nBuffer_DonorVariables]; - Buffer_Recv_DonorIndices = new long[size*nBuffer_DonorIndices]; - } - - /*--- On the donor side ---*/ - /*--- First we initialize all of the indices and processors to -1 ---*/ - /*--- This helps on identifying halo nodes and avoids setting wrong values ---*/ - for (iVertex = 0; iVertex < nBuffer_DonorIndices; iVertex++) - Buffer_Send_DonorIndices[iVertex] = -1; - - for (iVertex = 0; iVertex < nLocalVertexDonor; iVertex++) { - - Point_Donor = donor_geometry->vertex[Marker_Donor][iVertex]->GetNode(); - - /*--- If this processor owns the node ---*/ - if (donor_geometry->node[Point_Donor]->GetDomain()) { - - GetDonor_Variable(donor_solution, donor_geometry, donor_config, Marker_Donor, iVertex, Point_Donor); - - for (iVar = 0; iVar < nVar; iVar++) - Buffer_Send_DonorVariables[iVertex*nVar+iVar] = Donor_Variable[iVar]; - - Point_Donor_Global = donor_geometry->node[Point_Donor]->GetGlobalIndex(); - - Buffer_Send_DonorIndices[iVertex] = Point_Donor_Global; - } - - } - -#ifdef HAVE_MPI - /*--- Once all the messages have been prepared, we gather them all into the MASTER_NODE ---*/ - SU2_MPI::Gather(Buffer_Send_DonorVariables, nBuffer_DonorVariables, MPI_DOUBLE, Buffer_Recv_DonorVariables, nBuffer_DonorVariables, MPI_DOUBLE, MASTER_NODE, MPI_COMM_WORLD); - SU2_MPI::Gather(Buffer_Send_DonorIndices, nBuffer_DonorIndices, MPI_LONG, Buffer_Recv_DonorIndices, nBuffer_DonorIndices, MPI_LONG, MASTER_NODE, MPI_COMM_WORLD); - -#else - for (unsigned long iVariable = 0; iVariable < nBuffer_DonorVariables; iVariable++) - Buffer_Recv_DonorVariables[iVariable] = Buffer_Send_DonorVariables[iVariable]; - for (unsigned long iVariable = 0; iVariable < nBuffer_DonorIndices; iVariable++) - Buffer_Recv_DonorIndices[iVariable] = Buffer_Send_DonorIndices[iVariable]; -#endif - - /*--- Now we pack the information to send it over to the different processors ---*/ - - if (rank == MASTER_NODE) { - - /*--- For all the data we have received ---*/ - /*--- We initialize a counter to determine the position in the broadcast vector ---*/ - iLocalVertex = 0; - - for (iVertex = 0; iVertex < nProcessor*nBuffer_DonorIndices; iVertex++) { - - /*--- If the donor index is not -1 (this is, if the node is not originally a halo node) ---*/ - if (Buffer_Recv_DonorIndices[iVertex] != -1) { - - /*--- We set the donor index ---*/ - Buffer_Bcast_Indices[iLocalVertex] = Buffer_Recv_DonorIndices[iVertex]; - - for (iVar = 0; iVar < nVar; iVar++) { - Buffer_Bcast_Variables[iLocalVertex*nVar+iVar] = Buffer_Recv_DonorVariables[iVertex*nVar + iVar]; - } - - iLocalVertex++; - - } - - if (iLocalVertex == TotalVertexDonor) break; - - } - - } - -#ifdef HAVE_MPI - SU2_MPI::Bcast(Buffer_Bcast_Variables, nBuffer_BcastVariables, MPI_DOUBLE, MASTER_NODE, MPI_COMM_WORLD); - SU2_MPI::Bcast(Buffer_Bcast_Indices, nBuffer_BcastIndices, MPI_LONG, MASTER_NODE, MPI_COMM_WORLD); -#endif - - long indexPoint_iVertex, Point_Target_Check=0; - - /*--- For the target marker we are studying ---*/ - if (Marker_Target >= 0) { - - /*--- We have identified the local index of the Structural marker ---*/ - /*--- We loop over all the vertices in that marker and in that particular processor ---*/ - - for (iVertex = 0; iVertex < target_geometry->GetnVertex(Marker_Target); iVertex++) { - - Point_Target = target_geometry->vertex[Marker_Target][iVertex]->GetNode(); - - /*--- If this processor owns the node ---*/ - if (target_geometry->node[Point_Target]->GetDomain()) { - - /*--- Find the global index of the donor point for Point_Target ---*/ - Donor_Global_Index = target_geometry->vertex[Marker_Target][iVertex]->GetGlobalDonorPoint(); - - /*--- Find the index of the global donor point in the buffer Buffer_Bcast_Indices ---*/ - indexPoint_iVertex = std::distance(Buffer_Bcast_Indices, std::find(Buffer_Bcast_Indices, Buffer_Bcast_Indices + nBuffer_BcastIndices, Donor_Global_Index)); - - Point_Target_Check = Buffer_Bcast_Indices[indexPoint_iVertex]; - - if (Point_Target_Check < 0 && fsi) { - SU2_MPI::Error("A nonphysical point is being considered for traction transfer.", CURRENT_FUNCTION); - } - - for (iVar = 0; iVar < nVar; iVar++) - Target_Variable[iVar] = Buffer_Bcast_Variables[indexPoint_iVertex*nVar+iVar]; - - if (Point_Target_Check >= 0) - SetTarget_Variable(target_solution, target_geometry, target_config, Marker_Target, iVertex, Point_Target); - - } - - } - - } - - delete [] Buffer_Send_DonorVariables; - delete [] Buffer_Send_DonorIndices; - delete [] Buffer_Bcast_Variables; - delete [] Buffer_Bcast_Indices; - - if (rank == MASTER_NODE) { - delete [] Buffer_Recv_nVertexDonor; - delete [] Buffer_Recv_DonorVariables; - delete [] Buffer_Recv_DonorIndices; - } - } - - #ifdef HAVE_MPI - if (rank == MASTER_NODE && Buffer_Recv_mark != NULL) - delete [] Buffer_Recv_mark; - #endif + if (Physical_Constants != NULL) delete [] Physical_Constants; + if (Donor_Variable != NULL) delete [] Donor_Variable; + if (Target_Variable != NULL) delete [] Target_Variable; + + if (SpanValueCoeffTarget != NULL) delete[] SpanValueCoeffTarget; + if (SpanLevelDonor != NULL) delete[] SpanLevelDonor; + } -void CTransfer::Broadcast_InterfaceData_Interpolate(CSolver *donor_solution, CSolver *target_solution, - CGeometry *donor_geometry, CGeometry *target_geometry, - CConfig *donor_config, CConfig *target_config) { +void CTransfer::Broadcast_InterfaceData(CSolver *donor_solution, CSolver *target_solution, + CGeometry *donor_geometry, CGeometry *target_geometry, + CConfig *donor_config, CConfig *target_config) { unsigned short nMarkerInt, nMarkerDonor, nMarkerTarget; // Number of markers on the interface, donor and target side @@ -1083,17 +381,7 @@ void CTransfer::Broadcast_InterfaceData_Interpolate(CSolver *donor_solution, CSo nDonorPoints = target_geometry->vertex[Marker_Target][iVertex]->GetnDonorPoints(); Point_Target_Check = -1; - if(!fsi){ - target_solution->SetnSlidingStates(Marker_Target, iVertex, nDonorPoints); // This is to allocate - target_solution->SetSlidingStateStructure(Marker_Target, iVertex); - target_solution->SetnSlidingStates(Marker_Target, iVertex, 0); // Reset counter to 0 - } - else{ - /*--- As we will be adding data, we need to set the variable to 0 ---*/ - for (iVar = 0; iVar < nVar; iVar++) - Target_Variable[iVar] = 0.0; - } - + InitializeTarget_Variable(target_solution, Marker_Target, iVertex, nDonorPoints); /*--- For the number of donor points ---*/ for (iDonorPoint = 0; iDonorPoint < nDonorPoints; iDonorPoint++) { @@ -1110,27 +398,16 @@ void CTransfer::Broadcast_InterfaceData_Interpolate(CSolver *donor_solution, CSo Point_Target_Check = Buffer_Bcast_Indices[indexPoint_iVertex]; - if (Point_Target_Check < 0 && fsi) { - SU2_MPI::Error("A nonphysical point is being considered for traction transfer.", CURRENT_FUNCTION); - } - else if (fsi){ - for (iVar = 0; iVar < nVar; iVar++) - Target_Variable[iVar] += donorCoeff * Buffer_Bcast_Variables[indexPoint_iVertex*nVar+iVar]; - } - else{ - for (iVar = 0; iVar < nVar; iVar++) - Target_Variable[iVar] = Buffer_Bcast_Variables[ indexPoint_iVertex*nVar + iVar ]; - - Target_Variable[nVar] = donorCoeff; - - //for (iVar = 0; iVar < nVar+1; iVar++) cout << Target_Variable[iVar] << " "; cout << endl; getchar(); - - SetTarget_Variable(target_solution, target_geometry, target_config, Marker_Target, iVertex, Point_Target); - } + /*--- Recover the Target_Variable from the buffer of variables ---*/ + RecoverTarget_Variable(indexPoint_iVertex, Buffer_Bcast_Variables, donorCoeff); + + /*--- If the value is not directly aggregated in the previous function ---*/ + if (!valAggregated) SetTarget_Variable(target_solution, target_geometry, target_config, Marker_Target, iVertex, Point_Target); + } - if (Point_Target_Check >= 0 && fsi) - SetTarget_Variable(target_solution, target_geometry, target_config, Marker_Target, iVertex, Point_Target); + /*--- If we have aggregated the values in the function RecoverTarget_Variable, the set is outside the loop ---*/ + if (valAggregated) SetTarget_Variable(target_solution, target_geometry, target_config, Marker_Target, iVertex, Point_Target); } } @@ -1156,290 +433,6 @@ void CTransfer::Broadcast_InterfaceData_Interpolate(CSolver *donor_solution, CSo #endif } -void CTransfer::Allgather_InterfaceData(CSolver *donor_solution, CSolver *target_solution, - CGeometry *donor_geometry, CGeometry *target_geometry, - CConfig *donor_config, CConfig *target_config) { - - - unsigned short nMarkerInt, nMarkerDonor, nMarkerTarget; // Number of markers on the interface, donor and target side - unsigned short iMarkerInt, iMarkerDonor, iMarkerTarget; // Variables for iteration over markers - int Marker_Donor = -1, Marker_Target = -1; - int Target_check, Donor_check; - - unsigned long iVertex; // Variables for iteration over vertices and nodes - unsigned short iVar; - - GetPhysical_Constants(donor_solution, target_solution, donor_geometry, target_geometry, - donor_config, target_config); - - unsigned long Point_Donor_Global, Donor_Global_Index; - unsigned long Point_Donor, Point_Target; - - bool fsi = donor_config->GetFSI_Simulation(); - -#ifdef HAVE_MPI - int *Buffer_Recv_mark = NULL, iRank; - - if (rank == MASTER_NODE) - Buffer_Recv_mark = new int[size]; -#endif - - unsigned long iLocalVertex = 0; - unsigned long nLocalVertexDonor = 0; - - unsigned long MaxLocalVertexDonor = 0; - - unsigned long nBuffer_DonorVariables = 0; - unsigned long nBuffer_DonorIndices = 0; - - int nProcessor = 0; - - /*--- Number of markers on the FSI interface ---*/ - - nMarkerInt = (donor_config->GetMarker_n_ZoneInterface())/2; - nMarkerTarget = target_geometry->GetnMarker(); - nMarkerDonor = donor_geometry->GetnMarker(); - - nProcessor = size; - - /*--- Outer loop over the markers on the FSI interface: compute one by one ---*/ - /*--- The tags are always an integer greater than 1: loop from 1 to nMarkerFSI ---*/ - - for (iMarkerInt = 1; iMarkerInt <= nMarkerInt; iMarkerInt++) { - - Marker_Donor = -1; - Marker_Target = -1; - - /*--- Initialize pointer buffers inside the loop, so we can delete for each marker. ---*/ - /*--- We are only sending the values the processor owns ---*/ - unsigned long Buffer_Send_nVertexDonor[1], *Buffer_Recv_nVertexDonor = NULL; - - /*--- The donor and target markers are tagged with the same index. - *--- This is independent of the MPI domain decomposition. - *--- We need to loop over all markers on both sides and get the number of nodes - *--- that belong to each FSI marker for each processor ---*/ - - /*--- On the donor side ---*/ - - for (iMarkerDonor = 0; iMarkerDonor < nMarkerDonor; iMarkerDonor++) { - /*--- If the tag GetMarker_All_ZoneInterface(iMarkerDonor) equals the index we are looping at ---*/ - if ( donor_config->GetMarker_All_ZoneInterface(iMarkerDonor) == iMarkerInt ) { - /*--- Store the identifier for the structural marker ---*/ - Marker_Donor = iMarkerDonor; - /*--- Exit the for loop: we have found the local index for iMarkerFSI on the FEA side ---*/ - break; - } - } - - /*--- On the target side we only have to identify the marker; then we'll loop over it and retrieve from the donor points ---*/ - - for (iMarkerTarget = 0; iMarkerTarget < nMarkerTarget; iMarkerTarget++) { - /*--- If the tag GetMarker_All_ZoneInterface(iMarkerFlow) equals the index we are looping at ---*/ - if ( target_config->GetMarker_All_ZoneInterface(iMarkerTarget) == iMarkerInt ) { - /*--- Store the identifier for the fluid marker ---*/ - Marker_Target = iMarkerTarget; - /*--- Exit the for loop: we have found the local index for iMarkerFSI on the FEA side ---*/ - break; - } - } - - #ifdef HAVE_MPI - - Donor_check = -1; - Target_check = -1; - - /*--- We gather a vector in MASTER_NODE that determines if the boundary is not on the processor because of the partition or because the zone does not include it ---*/ - - SU2_MPI::Gather(&Marker_Donor , 1, MPI_INT, Buffer_Recv_mark, 1, MPI_INT, MASTER_NODE, MPI_COMM_WORLD); - - if (rank == MASTER_NODE) { - for (iRank = 0; iRank < nProcessor; iRank++) { - if( Buffer_Recv_mark[iRank] != -1 ) { - Donor_check = Buffer_Recv_mark[iRank]; - break; - } - } - } - - SU2_MPI::Bcast(&Donor_check , 1, MPI_INT, MASTER_NODE, MPI_COMM_WORLD); - - SU2_MPI::Gather(&Marker_Target, 1, MPI_INT, Buffer_Recv_mark, 1, MPI_INT, MASTER_NODE, MPI_COMM_WORLD); - - if (rank == MASTER_NODE) { - for (iRank = 0; iRank < nProcessor; iRank++) { - if( Buffer_Recv_mark[iRank] != -1 ) { - Target_check = Buffer_Recv_mark[iRank]; - break; - } - } - } - - SU2_MPI::Bcast(&Target_check, 1, MPI_INT, MASTER_NODE, MPI_COMM_WORLD); - - #else - Donor_check = Marker_Donor; - Target_check = Marker_Target; - #endif - - if(Target_check == -1 || Donor_check == -1) { - continue; - } - - nLocalVertexDonor = 0; - - if( Marker_Donor != -1 ) - nLocalVertexDonor = donor_geometry->GetnVertex(Marker_Donor); - - Buffer_Send_nVertexDonor[0] = nLocalVertexDonor; // Retrieve total number of vertices on Donor marker - Buffer_Recv_nVertexDonor = new unsigned long[size]; // Allocate memory to receive how many vertices are on each rank on the structural side - -#ifdef HAVE_MPI - /*--- We receive MaxLocalVertexDonor as the maximum number of vertices in one single processor on the donor side---*/ - SU2_MPI::Allreduce(&nLocalVertexDonor, &MaxLocalVertexDonor, 1, MPI_UNSIGNED_LONG, MPI_MAX, MPI_COMM_WORLD); - /*--- We gather a vector in all processors that determines how many elements are there on each processor on the structural side ---*/ - SU2_MPI::Allgather(&Buffer_Send_nVertexDonor, 1, MPI_UNSIGNED_LONG, Buffer_Recv_nVertexDonor, 1, MPI_UNSIGNED_LONG, MPI_COMM_WORLD); -#else - MaxLocalVertexDonor = nLocalVertexDonor; - Buffer_Recv_nVertexDonor[0] = Buffer_Send_nVertexDonor[0]; -#endif - - /*--- We will be gathering the donor information into the master node ---*/ - nBuffer_DonorVariables = MaxLocalVertexDonor * nVar; - nBuffer_DonorIndices = MaxLocalVertexDonor; - - /*--- Send and Recv buffers ---*/ - - /*--- Buffers to send and receive the variables in the donor mesh ---*/ - su2double *Buffer_Send_DonorVariables = new su2double[nBuffer_DonorVariables]; - su2double *Buffer_Recv_DonorVariables = new su2double[size*nBuffer_DonorVariables]; - - /*--- Buffers to send and receive the indices in the donor mesh ---*/ - long *Buffer_Send_DonorIndices = new long[nBuffer_DonorIndices]; - long *Buffer_Recv_DonorIndices = new long[size*nBuffer_DonorIndices]; - - /*--- On the donor side ---*/ - /*--- First we initialize all of the indices and processors to -1 ---*/ - /*--- This helps on identifying halo nodes and avoids setting wrong values ---*/ - for (iVertex = 0; iVertex < nBuffer_DonorIndices; iVertex++) - Buffer_Send_DonorIndices[iVertex] = -1; - - /*--- Also to avoid having random values in the variables vector ---*/ - for (iVertex = 0; iVertex < nBuffer_DonorIndices; iVertex++) { - for (iVar = 0; iVar < nVar; iVar++) { - Buffer_Send_DonorVariables[iVertex*nVar + iVar] = 0.0; - } - } - - if (Marker_Donor >= 0) { - - iLocalVertex = 0; - - for (iVertex = 0; iVertex < donor_geometry->GetnVertex(Marker_Donor); iVertex++) { - - Point_Donor = donor_geometry->vertex[Marker_Donor][iVertex]->GetNode(); - - GetDonor_Variable(donor_solution, donor_geometry, donor_config, Marker_Donor, iVertex, Point_Donor); - - /*--- If this processor owns the node ---*/ - if (donor_geometry->node[Point_Donor]->GetDomain()) { - for (iVar = 0; iVar < nVar; iVar++) { - Buffer_Send_DonorVariables[iLocalVertex*nVar+iVar] = Donor_Variable[iVar]; - } - - Point_Donor_Global = donor_geometry->node[Point_Donor]->GetGlobalIndex(); - Buffer_Send_DonorIndices[iLocalVertex] = Point_Donor_Global; - - iLocalVertex++; - } - - } - - } - -#ifdef HAVE_MPI - /*--- Once all the messages have been prepared, we gather them all into all the processors ---*/ - SU2_MPI::Allgather(Buffer_Send_DonorVariables, nBuffer_DonorVariables, MPI_DOUBLE, Buffer_Recv_DonorVariables, nBuffer_DonorVariables, MPI_DOUBLE, MPI_COMM_WORLD); - SU2_MPI::Allgather(Buffer_Send_DonorIndices, nBuffer_DonorIndices, MPI_LONG, Buffer_Recv_DonorIndices, nBuffer_DonorIndices, MPI_LONG, MPI_COMM_WORLD); -#else - for (unsigned long iVariable = 0; iVariable < nBuffer_DonorVariables; iVariable++) - Buffer_Recv_DonorVariables[iVariable] = Buffer_Send_DonorVariables[iVariable]; - for (unsigned long iVariable = 0; iVariable < nBuffer_DonorIndices; iVariable++) - Buffer_Recv_DonorIndices[iVariable] = Buffer_Send_DonorIndices[iVariable]; -#endif - - long indexPoint_iVertex, Point_Target_Check = 0; - unsigned short iDonorPoint, nDonorPoints; - su2double donorCoeff; - - /*--- For the target marker we are studying ---*/ - if (Marker_Target >= 0) { - - /*--- We have identified the local index of the Structural marker ---*/ - /*--- We loop over all the vertices in that marker and in that particular processor ---*/ - - for (iVertex = 0; iVertex < target_geometry->GetnVertex(Marker_Target); iVertex++) { - - Point_Target = target_geometry->vertex[Marker_Target][iVertex]->GetNode(); - - /*--- If this processor owns the node ---*/ - if (target_geometry->node[Point_Target]->GetDomain()) { - - nDonorPoints = target_geometry->vertex[Marker_Target][iVertex]->GetnDonorPoints(); - - /*--- As we will be adding data, we need to set the variable to 0 ---*/ - for (iVar = 0; iVar < nVar; iVar++) Target_Variable[iVar] = 0.0; - - Point_Target_Check = -1; - - /*--- For the number of donor points ---*/ - for (iDonorPoint = 0; iDonorPoint < nDonorPoints; iDonorPoint++) { - - /*--- Find the global index of the donor points for Point_Target ---*/ - Donor_Global_Index = target_geometry->vertex[Marker_Target][iVertex]->GetInterpDonorPoint(iDonorPoint); - - /*--- We need to get the donor coefficient in a way like this: ---*/ - donorCoeff = target_geometry->vertex[Marker_Target][iVertex]->GetDonorCoeff(iDonorPoint); - - /*--- Find the index of the global donor point in the buffer Buffer_Bcast_Indices ---*/ - indexPoint_iVertex = std::distance(Buffer_Recv_DonorIndices, std::find(Buffer_Recv_DonorIndices, Buffer_Recv_DonorIndices + nProcessor*nBuffer_DonorIndices, Donor_Global_Index)); - - Point_Target_Check = Buffer_Recv_DonorIndices[indexPoint_iVertex]; - - if (Point_Target_Check < 0 && fsi) { - SU2_MPI::Error("A nonphysical point is being considered for traction transfer.", CURRENT_FUNCTION); - } - - for (iVar = 0; iVar < nVar; iVar++) - Target_Variable[iVar] += donorCoeff * Buffer_Recv_DonorVariables[indexPoint_iVertex*nVar+iVar]; - } - - if (Point_Target_Check >= 0) - SetTarget_Variable(target_solution, target_geometry, target_config, Marker_Target, iVertex, Point_Target); - - } - - } - - } - - delete [] Buffer_Send_DonorVariables; - delete [] Buffer_Send_DonorIndices; - - delete [] Buffer_Recv_DonorVariables; - delete [] Buffer_Recv_DonorIndices; - - delete [] Buffer_Recv_nVertexDonor; - - } - - #ifdef HAVE_MPI - if (rank == MASTER_NODE && Buffer_Recv_mark != NULL) - delete [] Buffer_Recv_mark; - #endif - -} - - void CTransfer::Preprocessing_InterfaceAverage(CGeometry *donor_geometry, CGeometry *target_geometry, CConfig *donor_config, CConfig *target_config, unsigned short iMarkerInt){ diff --git a/TestCases/coupled_cht/incompressible/coupled_cht_incompressible.cfg b/TestCases/coupled_cht/incompressible/coupled_cht_incompressible.cfg index 19af805071e..4d46d6bea06 100644 --- a/TestCases/coupled_cht/incompressible/coupled_cht_incompressible.cfg +++ b/TestCases/coupled_cht/incompressible/coupled_cht_incompressible.cfg @@ -81,8 +81,6 @@ MARKER_HEATFLUX= ( INNERPIN, 4000.0 ) MARKER_CHT_INTERFACE= (PIN, PINSD) MARKER_ZONE_INTERFACE= (PIN, PINSD) -MATCHING_MESH=YES - % ------------------------ SURFACES IDENTIFICATION ----------------------------% MARKER_PLOTTING = ( PINSD ) diff --git a/TestCases/fea_fsi/Airfoil_RBF/configFEA.cfg b/TestCases/fea_fsi/Airfoil_RBF/configFEA.cfg index 0f06b21a31c..5539a5fd446 100644 --- a/TestCases/fea_fsi/Airfoil_RBF/configFEA.cfg +++ b/TestCases/fea_fsi/Airfoil_RBF/configFEA.cfg @@ -6,7 +6,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Interface options ---------------------------------------------------- % -MATCHING_MESH = NO + KIND_INTERPOLATION = RADIAL_BASIS_FUNCTION CONSERVATIVE_INTERPOLATION = NO KIND_RADIAL_BASIS_FUNCTION = WENDLAND_C2 diff --git a/TestCases/fea_fsi/Airfoil_RBF/configFlow.cfg b/TestCases/fea_fsi/Airfoil_RBF/configFlow.cfg index e9dbb7f41f3..51f988e9cfd 100644 --- a/TestCases/fea_fsi/Airfoil_RBF/configFlow.cfg +++ b/TestCases/fea_fsi/Airfoil_RBF/configFlow.cfg @@ -6,7 +6,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Interface options ---------------------------------------------------- % -MATCHING_MESH = NO + KIND_INTERPOLATION = RADIAL_BASIS_FUNCTION CONSERVATIVE_INTERPOLATION = NO KIND_RADIAL_BASIS_FUNCTION = WENDLAND_C2 diff --git a/TestCases/fea_fsi/Airfoil_RBF/settings.cfg b/TestCases/fea_fsi/Airfoil_RBF/settings.cfg index 58201e4968c..c42c9451af2 100644 --- a/TestCases/fea_fsi/Airfoil_RBF/settings.cfg +++ b/TestCases/fea_fsi/Airfoil_RBF/settings.cfg @@ -6,7 +6,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Interface options ---------------------------------------------------- % -MATCHING_MESH = NO + % This is one of the ways of interpolating between non-matching meshes, % its attractiveness comes from removing the need to map nodes between % sides, the downside is that dense matrix algebra is involved, so w.r.t. diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index 57dc184782e..6292e5a646d 100644 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -920,6 +920,29 @@ def main(): bars_SST_2D.timeout = 1600 bars_SST_2D.tol = 0.00001 test_list.append(bars_SST_2D) + + # Sliding mesh with incompressible flows (steady) + slinc_steady = TestCase('slinc_steady') + slinc_steady.cfg_dir = "sliding_interface/incompressible_steady" + slinc_steady.cfg_file = "config.cfg" + slinc_steady.test_iter = 19 + slinc_steady.test_vals = [-4.214657, 1.265231, 0.000000, 0.000000] #last 4 columns + slinc_steady.su2_exec = "SU2_CFD" + slinc_steady.timeout = 100 + slinc_steady.tol = 0.00002 + test_list.append(slinc_steady) + + # Sliding mesh with incompressible flows (unsteady) + # slinc_unsteady = TestCase('slinc_unsteady') + # slinc_unsteady.cfg_dir = "sliding_interface/incompressible_unsteady" + # slinc_unsteady.cfg_file = "config.cfg" + # slinc_unsteady.test_iter = 19 + # slinc_unsteady.test_vals = [-3.513701,1.931626,0.000000,0.000000] #last 4 columns + # slinc_unsteady.su2_exec = "SU2_CFD" + # slinc_unsteady.timeout = 100 + # slinc_unsteady.tol = 0.00001 + # slinc_unsteady.unsteady = True + # test_list.append(slinc_unsteady) ########################## ### FEA - FSI ### diff --git a/TestCases/serial_regression.py b/TestCases/serial_regression.py index bea53350c3b..7c5165fa84a 100644 --- a/TestCases/serial_regression.py +++ b/TestCases/serial_regression.py @@ -931,6 +931,29 @@ def main(): bars_SST_2D.timeout = 1600 bars_SST_2D.tol = 0.00001 test_list.append(bars_SST_2D) + + # Sliding mesh with incompressible flows (steady) + slinc_steady = TestCase('slinc_steady') + slinc_steady.cfg_dir = "sliding_interface/incompressible_steady" + slinc_steady.cfg_file = "config.cfg" + slinc_steady.test_iter = 19 + slinc_steady.test_vals = [-4.214657,1.265231,0.000000,0.000000] #last 4 columns + slinc_steady.su2_exec = "SU2_CFD" + slinc_steady.timeout = 100 + slinc_steady.tol = 0.00001 + test_list.append(slinc_steady) + + # Sliding mesh with incompressible flows (unsteady) + # slinc_unsteady = TestCase('slinc_unsteady') + # slinc_unsteady.cfg_dir = "sliding_interface/incompressible_unsteady" + # slinc_unsteady.cfg_file = "config.cfg" + # slinc_unsteady.test_iter = 19 + # slinc_unsteady.test_vals = [-3.515218,1.930028,0.000000,0.000000] #last 4 columns + # slinc_unsteady.su2_exec = "SU2_CFD" + # slinc_unsteady.timeout = 100 + # slinc_unsteady.tol = 0.00001 + # slinc_unsteady.unsteady = True + # test_list.append(slinc_unsteady) ########################## ### FEA - FSI ### diff --git a/TestCases/sliding_interface/bars_SST_2D/bars.cfg b/TestCases/sliding_interface/bars_SST_2D/bars.cfg index 7bac13e12f0..5247728925b 100644 --- a/TestCases/sliding_interface/bars_SST_2D/bars.cfg +++ b/TestCases/sliding_interface/bars_SST_2D/bars.cfg @@ -127,7 +127,7 @@ KT_CONSTANT= 0.028085 % MARKER_ZONE_INTERFACE= (outflow_bars, inflow_channel) MARKER_FLUID_INTERFACE= (outflow_bars, inflow_channel) -MATCHING_MESH= NO + %Dynamic Mesh simulation(Yes, No) % Navier-Stokes wall boundary marker(s) (NONE = no marker) % diff --git a/TestCases/sliding_interface/channel_2D/channel_2D_NN.cfg b/TestCases/sliding_interface/channel_2D/channel_2D_NN.cfg index 7ae3e6968a1..3183ca68602 100644 --- a/TestCases/sliding_interface/channel_2D/channel_2D_NN.cfg +++ b/TestCases/sliding_interface/channel_2D/channel_2D_NN.cfg @@ -79,7 +79,7 @@ MARKER_RIEMANN= (up_inlet, STATIC_SUPERSONIC_INFLOW_PT, 95750, 288.15, 3.0, 0.0, % Zone interaction boundary definition MARKER_ZONE_INTERFACE= ( internal_interface, inner_interface, domain_interface, external_interface ) MARKER_FLUID_INTERFACE= ( internal_interface, inner_interface, domain_interface, external_interface ) -MATCHING_MESH= NO + % % % ----------------------- DYNAMIC MESH DEFINITION -----------------------------% diff --git a/TestCases/sliding_interface/channel_2D/channel_2D_WA.cfg b/TestCases/sliding_interface/channel_2D/channel_2D_WA.cfg index 2cf8bc97206..b741b61fd2d 100644 --- a/TestCases/sliding_interface/channel_2D/channel_2D_WA.cfg +++ b/TestCases/sliding_interface/channel_2D/channel_2D_WA.cfg @@ -79,7 +79,7 @@ MARKER_RIEMANN= (up_inlet, STATIC_SUPERSONIC_INFLOW_PT, 95750, 288.15, 3.0, 0.0, % Zone interaction boundary definition MARKER_ZONE_INTERFACE= ( internal_interface, inner_interface, domain_interface, external_interface ) MARKER_FLUID_INTERFACE= ( internal_interface, inner_interface, domain_interface, external_interface ) -MATCHING_MESH= NO + KIND_INTERPOLATION= WEIGHTED_AVERAGE % % diff --git a/TestCases/sliding_interface/channel_3D/channel_3D_NN.cfg b/TestCases/sliding_interface/channel_3D/channel_3D_NN.cfg index 36dabfca4f6..09b3334514a 100644 --- a/TestCases/sliding_interface/channel_3D/channel_3D_NN.cfg +++ b/TestCases/sliding_interface/channel_3D/channel_3D_NN.cfg @@ -79,7 +79,7 @@ MARKER_RIEMANN= (up_inlet, STATIC_SUPERSONIC_INFLOW_PT, 95750, 288.15, 3.0, 0.0, % Zone interaction boundary definition MARKER_ZONE_INTERFACE= ( internal_interface, inner_interface, domain_interface, external_interface ) MARKER_FLUID_INTERFACE= ( internal_interface, inner_interface, domain_interface, external_interface ) -MATCHING_MESH= NO + %KIND_INTERPOLATION= ISOPARAMETRIC % % diff --git a/TestCases/sliding_interface/channel_3D/channel_3D_WA.cfg b/TestCases/sliding_interface/channel_3D/channel_3D_WA.cfg index ce41e0a9d40..cd0feb0ede6 100644 --- a/TestCases/sliding_interface/channel_3D/channel_3D_WA.cfg +++ b/TestCases/sliding_interface/channel_3D/channel_3D_WA.cfg @@ -79,7 +79,7 @@ MARKER_RIEMANN= (up_inlet, STATIC_SUPERSONIC_INFLOW_PT, 95750, 288.15, 3.0, 0.0, % Zone interaction boundary definition MARKER_ZONE_INTERFACE= ( internal_interface, inner_interface, domain_interface, external_interface ) MARKER_FLUID_INTERFACE= ( internal_interface, inner_interface, domain_interface, external_interface ) -MATCHING_MESH= NO + KIND_INTERPOLATION= WEIGHTED_AVERAGE % diff --git a/TestCases/sliding_interface/incompressible_steady/config.cfg b/TestCases/sliding_interface/incompressible_steady/config.cfg new file mode 100644 index 00000000000..3f0a2c81b07 --- /dev/null +++ b/TestCases/sliding_interface/incompressible_steady/config.cfg @@ -0,0 +1,22 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% SU2 configuration file % +% Case description: Incompressible channel to test sliding interface % +% Author: Ruben Sanchez % +% Institution: Chair for Scientific Computing, TU Kaiserslautern % +% Date: January 28th, 2018 % +% File Version 6.1.0 "Falcon" % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +PHYSICAL_PROBLEM= MULTIZONE + +CONFIG_LIST = (configOut.cfg, configCircle.cfg) + +MARKER_ZONE_INTERFACE= (circleOut, circleIn) + +MESH_FILENAME= meshCircle.su2 + +TIME_DOMAIN = NO + +OUTER_ITER = 20 diff --git a/TestCases/sliding_interface/incompressible_steady/configCircle.cfg b/TestCases/sliding_interface/incompressible_steady/configCircle.cfg new file mode 100644 index 00000000000..826185c4078 --- /dev/null +++ b/TestCases/sliding_interface/incompressible_steady/configCircle.cfg @@ -0,0 +1,141 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% SU2 configuration file % +% Case description: Incompressible channel to test sliding interface % +% Author: Ruben Sanchez % +% Institution: Chair for Scientific Computing, TU Kaiserslautern % +% Date: January 28th, 2018 % +% File Version 6.1.0 "Falcon" % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% +% +% Physical governing equations (EULER, NAVIER_STOKES, +% WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, +% POISSON_EQUATION) +PHYSICAL_PROBLEM= NAVIER_STOKES +REGIME_TYPE= INCOMPRESSIBLE +KIND_TURB_MODEL= NONE +MATH_PROBLEM= DIRECT +RESTART_SOL= NO + +INC_NONDIM = DIMENSIONAL + +MULTIZONE_MESH = NO + +% ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------% + +INC_DENSITY_MODEL= VARIABLE +INC_ENERGY_EQUATION = YES +INC_DENSITY_INIT= 1.0 +INC_VELOCITY_INIT= ( 1.0, 0.0, 0.0 ) +INC_TEMPERATURE_INIT= 200 + +% ---- IDEAL GAS, POLYTROPIC, VAN DER WAALS AND PENG ROBINSON CONSTANTS -------% + +FLUID_MODEL= INC_IDEAL_GAS +SPECIFIC_HEAT_CP= 1004.703 +MOLECULAR_WEIGHT= 28.96 + +% --------------------------- VISCOSITY MODEL ---------------------------------% + +VISCOSITY_MODEL= CONSTANT_VISCOSITY +MU_CONSTANT= 5e-3 + +% ---------------------- REFERENCE VALUE DEFINITION ---------------------------% + +REF_ORIGIN_MOMENT_X = 0.25 +REF_ORIGIN_MOMENT_Y = 0.00 +REF_ORIGIN_MOMENT_Z = 0.00 + +REF_AREA= 1.0 + +% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% + +MARKER_FLUID_INTERFACE= (circleIn) + +MARKER_PLOTTING= ( NONE ) +MARKER_MONITORING= ( NONE ) + +% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% + +NUM_METHOD_GRAD= GREEN_GAUSS +CFL_NUMBER= 1000 +CFL_ADAPT= NO +CFL_ADAPT_PARAM= ( 1.5, 0.5, 15.0, 1e10) +MAX_DELTA_TIME= 1E6 +RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) +EXT_ITER= 200 + +% ------------------------ LINEAR SOLVER DEFINITION ---------------------------% + +LINEAR_SOLVER= FGMRES +LINEAR_SOLVER_PREC= ILU +LINEAR_SOLVER_ILU_FILL_IN= 0 +LINEAR_SOLVER_ERROR= 1E-8 +LINEAR_SOLVER_ITER= 10 + +% -------------------------- MULTIGRID PARAMETERS -----------------------------% + +MGLEVEL= 0 +MGCYCLE= V_CYCLE +MG_PRE_SMOOTH= ( 1, 1, 1, 1 ) +MG_POST_SMOOTH= ( 0, 0, 0, 0 ) +MG_CORRECTION_SMOOTH= ( 0, 0, 0, 0 ) +MG_DAMP_RESTRICTION= 0.8 +MG_DAMP_PROLONGATION= 0.8 + +% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% +% +CONV_NUM_METHOD_FLOW= FDS +MUSCL_FLOW= YES +SLOPE_LIMITER_FLOW= NONE +TIME_DISCRE_FLOW= EULER_IMPLICIT + +CONV_NUM_METHOD_TURB= SCALAR_UPWIND +MUSCL_TURB= NO +SLOPE_LIMITER_TURB= VENKATAKRISHNAN +TIME_DISCRE_TURB= EULER_IMPLICIT + +% --------------------------- CONVERGENCE PARAMETERS --------------------------% + +CONV_CRITERIA= RESIDUAL +RESIDUAL_REDUCTION= 12 +RESIDUAL_MINVAL= -16 +STARTCONV_ITER= 10 +CAUCHY_ELEMS= 100 +CAUCHY_EPS= 1E-6 +CAUCHY_FUNC_FLOW= DRAG + +% --------------------------- TURBULENCE PARAMETERS --------------------------% +FREESTREAM_TURBULENCEINTENSITY = 0.001 +FREESTREAM_TURB2LAMVISCRATIO = 100.0 + +% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% + +MESH_FILENAME= meshCircle.su2 + +MESH_FORMAT= SU2 +MESH_OUT_FILENAME= mesh_out.su2 + +SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_ADJ_FILENAME= solution_adj.dat + +OUTPUT_FORMAT= PARAVIEW +CONV_FILENAME= history_converge + +RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_ADJ_FILENAME= restart_adj.dat + +VOLUME_FLOW_FILENAME= flow +VOLUME_ADJ_FILENAME= adjoint + +GRAD_OBJFUNC_FILENAME= of_grad.dat + +SURFACE_FLOW_FILENAME= surface_flow +SURFACE_ADJ_FILENAME= surface_adjoint + +WRT_SOL_FREQ= 1000 +WRT_CON_FREQ= 1 + diff --git a/TestCases/sliding_interface/incompressible_steady/configOut.cfg b/TestCases/sliding_interface/incompressible_steady/configOut.cfg new file mode 100644 index 00000000000..e3c76897b1b --- /dev/null +++ b/TestCases/sliding_interface/incompressible_steady/configOut.cfg @@ -0,0 +1,147 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% SU2 configuration file % +% Case description: Incompressible channel to test sliding interface % +% Author: Ruben Sanchez % +% Institution: Chair for Scientific Computing, TU Kaiserslautern % +% Date: January 28th, 2018 % +% File Version 6.1.0 "Falcon" % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% +% +% Physical governing equations (EULER, NAVIER_STOKES, +% WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, +% POISSON_EQUATION) +PHYSICAL_PROBLEM= NAVIER_STOKES +REGIME_TYPE= INCOMPRESSIBLE +KIND_TURB_MODEL= NONE +MATH_PROBLEM= DIRECT +RESTART_SOL= NO + +INC_NONDIM = DIMENSIONAL + +MULTIZONE_MESH = NO + +% ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------% + +INC_DENSITY_MODEL= VARIABLE +INC_ENERGY_EQUATION = YES +INC_DENSITY_INIT= 1.0 +INC_VELOCITY_INIT= ( 1.0, 0.0, 0.0 ) +INC_TEMPERATURE_INIT= 200 + +% ---- IDEAL GAS, POLYTROPIC, VAN DER WAALS AND PENG ROBINSON CONSTANTS -------% + +FLUID_MODEL= INC_IDEAL_GAS +SPECIFIC_HEAT_CP= 1004.703 +MOLECULAR_WEIGHT= 28.96 + +% --------------------------- VISCOSITY MODEL ---------------------------------% + +VISCOSITY_MODEL= CONSTANT_VISCOSITY +MU_CONSTANT= 5e-3 + +% ---------------------- REFERENCE VALUE DEFINITION ---------------------------% + +REF_ORIGIN_MOMENT_X = 0.25 +REF_ORIGIN_MOMENT_Y = 0.00 +REF_ORIGIN_MOMENT_Z = 0.00 + +REF_AREA= 1.0 + +% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% + +MARKER_HEATFLUX = ( upper, -1000.0, lower, 1000.0 ) + +INC_OUTLET_TYPE = PRESSURE_OUTLET +MARKER_OUTLET= ( outlet, 0.0 ) + +MARKER_FLUID_INTERFACE= (circleOut) + +INC_INLET_TYPE= VELOCITY_INLET +SPECIFIED_INLET_PROFILE= YES +INLET_FILENAME= inlet.dat +MARKER_INLET= ( inlet, 200, 1.0, 1.0, 0.0, 0.0) + +MARKER_PLOTTING= ( NONE ) +MARKER_MONITORING= ( NONE ) + +% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% + +NUM_METHOD_GRAD= GREEN_GAUSS +CFL_NUMBER= 1000 +CFL_ADAPT= NO +CFL_ADAPT_PARAM= ( 1.5, 0.5, 15.0, 1e10) +MAX_DELTA_TIME= 1E6 +RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) +EXT_ITER= 200 + +% ------------------------ LINEAR SOLVER DEFINITION ---------------------------% + +LINEAR_SOLVER= FGMRES +LINEAR_SOLVER_PREC= ILU +LINEAR_SOLVER_ILU_FILL_IN= 0 +LINEAR_SOLVER_ERROR= 1E-8 +LINEAR_SOLVER_ITER= 10 + +% -------------------------- MULTIGRID PARAMETERS -----------------------------% + +MGLEVEL= 0 +MGCYCLE= V_CYCLE +MG_PRE_SMOOTH= ( 1, 1, 1, 1 ) +MG_POST_SMOOTH= ( 0, 0, 0, 0 ) +MG_CORRECTION_SMOOTH= ( 0, 0, 0, 0 ) +MG_DAMP_RESTRICTION= 0.8 +MG_DAMP_PROLONGATION= 0.8 + +% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% +% +CONV_NUM_METHOD_FLOW= FDS +MUSCL_FLOW= YES +SLOPE_LIMITER_FLOW= NONE +TIME_DISCRE_FLOW= EULER_IMPLICIT + +CONV_NUM_METHOD_TURB= SCALAR_UPWIND +MUSCL_TURB= NO +SLOPE_LIMITER_TURB= VENKATAKRISHNAN +TIME_DISCRE_TURB= EULER_IMPLICIT + +% --------------------------- CONVERGENCE PARAMETERS --------------------------% + +CONV_CRITERIA= RESIDUAL +RESIDUAL_REDUCTION= 12 +RESIDUAL_MINVAL= -16 +STARTCONV_ITER= 10 +CAUCHY_ELEMS= 100 +CAUCHY_EPS= 1E-6 +CAUCHY_FUNC_FLOW= DRAG + +% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% + +MESH_FILENAME= meshOut.su2 + +MESH_FORMAT= SU2 +MESH_OUT_FILENAME= mesh_out.su2 + +SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_ADJ_FILENAME= solution_adj.dat + +OUTPUT_FORMAT= PARAVIEW +CONV_FILENAME= history + +RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_ADJ_FILENAME= restart_adj.dat + +VOLUME_FLOW_FILENAME= flow +VOLUME_ADJ_FILENAME= adjoint + +GRAD_OBJFUNC_FILENAME= of_grad.dat + +SURFACE_FLOW_FILENAME= surface_flow +SURFACE_ADJ_FILENAME= surface_adjoint + +WRT_SOL_FREQ= 1000 +WRT_CON_FREQ= 1 + diff --git a/TestCases/sliding_interface/incompressible_unsteady/config.cfg b/TestCases/sliding_interface/incompressible_unsteady/config.cfg new file mode 100644 index 00000000000..de42431bdf0 --- /dev/null +++ b/TestCases/sliding_interface/incompressible_unsteady/config.cfg @@ -0,0 +1,24 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% SU2 configuration file % +% Case description: Incompressible unsteady channel to test sliding interface % +% Author: Ruben Sanchez % +% Institution: Chair for Scientific Computing, TU Kaiserslautern % +% Date: January 28th, 2018 % +% File Version 6.1.0 "Falcon" % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +PHYSICAL_PROBLEM= MULTIZONE + +CONFIG_LIST = (configOut.cfg, configCircle.cfg) + +MARKER_ZONE_INTERFACE= (circleOut, circleIn) + +MESH_FILENAME= meshCircle.su2 + +TIME_DOMAIN = YES +TIME_ITER = 1 +TIME_STEP = 1.0 + +OUTER_ITER = 20 diff --git a/TestCases/sliding_interface/incompressible_unsteady/configCircle.cfg b/TestCases/sliding_interface/incompressible_unsteady/configCircle.cfg new file mode 100644 index 00000000000..50741829b5f --- /dev/null +++ b/TestCases/sliding_interface/incompressible_unsteady/configCircle.cfg @@ -0,0 +1,149 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% SU2 configuration file % +% Case description: Incompressible unsteady channel to test sliding interface % +% Author: Ruben Sanchez % +% Institution: Chair for Scientific Computing, TU Kaiserslautern % +% Date: January 28th, 2018 % +% File Version 6.1.0 "Falcon" % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% +% +% Physical governing equations (EULER, NAVIER_STOKES, +% WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, +% POISSON_EQUATION) +PHYSICAL_PROBLEM= NAVIER_STOKES +REGIME_TYPE= INCOMPRESSIBLE +KIND_TURB_MODEL= NONE +MATH_PROBLEM= DIRECT +RESTART_SOL= NO + +INC_NONDIM = DIMENSIONAL + +MULTIZONE_MESH = NO + +% ------------------------- UNSTEADY SIMULATION -------------------------------% + +UNSTEADY_SIMULATION= DUAL_TIME_STEPPING-2ND_ORDER +UNST_TIMESTEP= 1.0 +UNST_INT_ITER= 20 +UNST_RESTART_ITER = 2 +INNER_ITER = 1 +UNST_TIME= 100 + +% ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------% + +INC_DENSITY_MODEL= VARIABLE +INC_ENERGY_EQUATION = YES +INC_DENSITY_INIT= 1.0 +INC_VELOCITY_INIT= ( 1.0, 0.0, 0.0 ) +INC_TEMPERATURE_INIT= 200 + +% ---- IDEAL GAS, POLYTROPIC, VAN DER WAALS AND PENG ROBINSON CONSTANTS -------% + +FLUID_MODEL= INC_IDEAL_GAS +SPECIFIC_HEAT_CP= 1004.703 +MOLECULAR_WEIGHT= 28.96 + +% --------------------------- VISCOSITY MODEL ---------------------------------% + +VISCOSITY_MODEL= CONSTANT_VISCOSITY +MU_CONSTANT= 5e-3 + +% ---------------------- REFERENCE VALUE DEFINITION ---------------------------% + +REF_ORIGIN_MOMENT_X = 0.25 +REF_ORIGIN_MOMENT_Y = 0.00 +REF_ORIGIN_MOMENT_Z = 0.00 + +REF_AREA= 1.0 + +% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% + +MARKER_FLUID_INTERFACE= (circleIn) + +MARKER_PLOTTING= ( NONE ) +MARKER_MONITORING= ( NONE ) + +% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% + +NUM_METHOD_GRAD= GREEN_GAUSS +CFL_NUMBER= 1000 +CFL_ADAPT= NO +CFL_ADAPT_PARAM= ( 1.5, 0.5, 15.0, 1e10) +MAX_DELTA_TIME= 1E6 +RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) +EXT_ITER= 200 + +% ------------------------ LINEAR SOLVER DEFINITION ---------------------------% + +LINEAR_SOLVER= FGMRES +LINEAR_SOLVER_PREC= ILU +LINEAR_SOLVER_ILU_FILL_IN= 0 +LINEAR_SOLVER_ERROR= 1E-8 +LINEAR_SOLVER_ITER= 10 + +% -------------------------- MULTIGRID PARAMETERS -----------------------------% + +MGLEVEL= 0 +MGCYCLE= V_CYCLE +MG_PRE_SMOOTH= ( 1, 1, 1, 1 ) +MG_POST_SMOOTH= ( 0, 0, 0, 0 ) +MG_CORRECTION_SMOOTH= ( 0, 0, 0, 0 ) +MG_DAMP_RESTRICTION= 0.8 +MG_DAMP_PROLONGATION= 0.8 + +% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% +% +CONV_NUM_METHOD_FLOW= FDS +MUSCL_FLOW= YES +SLOPE_LIMITER_FLOW= NONE +TIME_DISCRE_FLOW= EULER_IMPLICIT + +CONV_NUM_METHOD_TURB= SCALAR_UPWIND +MUSCL_TURB= NO +SLOPE_LIMITER_TURB= VENKATAKRISHNAN +TIME_DISCRE_TURB= EULER_IMPLICIT + +% --------------------------- CONVERGENCE PARAMETERS --------------------------% + +CONV_CRITERIA= RESIDUAL +RESIDUAL_REDUCTION= 12 +RESIDUAL_MINVAL= -16 +STARTCONV_ITER= 10 +CAUCHY_ELEMS= 100 +CAUCHY_EPS= 1E-6 +CAUCHY_FUNC_FLOW= DRAG + +% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% + +MESH_FILENAME= meshCircle.su2 + +MESH_FORMAT= SU2 +MESH_OUT_FILENAME= mesh_out.su2 + +SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_ADJ_FILENAME= solution_adj.dat + +OUTPUT_FORMAT= PARAVIEW +CONV_FILENAME= history + +RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_ADJ_FILENAME= restart_adj.dat + +VOLUME_FLOW_FILENAME= flow +VOLUME_ADJ_FILENAME= adjoint + +GRAD_OBJFUNC_FILENAME= of_grad.dat + +SURFACE_FLOW_FILENAME= surface_flow +SURFACE_ADJ_FILENAME= surface_adjoint + +WRT_SOL_FREQ= 1 +WRT_SOL_FREQ_DUALTIME= 1 + +WRT_CON_FREQ= 1 +WRT_CON_FREQ_DUALTIME= 1 + diff --git a/TestCases/sliding_interface/incompressible_unsteady/configOut.cfg b/TestCases/sliding_interface/incompressible_unsteady/configOut.cfg new file mode 100644 index 00000000000..bb327ff0b10 --- /dev/null +++ b/TestCases/sliding_interface/incompressible_unsteady/configOut.cfg @@ -0,0 +1,159 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% SU2 configuration file % +% Case description: Incompressible unsteady channel to test sliding interface % +% Author: Ruben Sanchez % +% Institution: Chair for Scientific Computing, TU Kaiserslautern % +% Date: January 28th, 2018 % +% File Version 6.1.0 "Falcon" % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% +% +% Physical governing equations (EULER, NAVIER_STOKES, +% WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, +% POISSON_EQUATION) +PHYSICAL_PROBLEM= NAVIER_STOKES +REGIME_TYPE= INCOMPRESSIBLE +KIND_TURB_MODEL= NONE +MATH_PROBLEM= DIRECT +RESTART_SOL= NO + +INC_NONDIM = DIMENSIONAL + +MULTIZONE_MESH = NO + +% ------------------------- UNSTEADY SIMULATION -------------------------------% + +UNSTEADY_SIMULATION= DUAL_TIME_STEPPING-2ND_ORDER +UNST_TIMESTEP= 1.0 +UNST_INT_ITER= 20 +UNST_RESTART_ITER = 2 +INNER_ITER = 1 +UNST_TIME= 100 + +% ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------% + +INC_DENSITY_MODEL= VARIABLE +INC_ENERGY_EQUATION = YES +INC_DENSITY_INIT= 1.0 +INC_VELOCITY_INIT= ( 1.0, 0.0, 0.0 ) +INC_TEMPERATURE_INIT= 200 + +% ---- IDEAL GAS, POLYTROPIC, VAN DER WAALS AND PENG ROBINSON CONSTANTS -------% + +FLUID_MODEL= INC_IDEAL_GAS +SPECIFIC_HEAT_CP= 1004.703 +MOLECULAR_WEIGHT= 28.96 + +% --------------------------- VISCOSITY MODEL ---------------------------------% + +VISCOSITY_MODEL= CONSTANT_VISCOSITY +MU_CONSTANT= 5e-3 + +% ---------------------- REFERENCE VALUE DEFINITION ---------------------------% + +REF_ORIGIN_MOMENT_X = 0.25 +REF_ORIGIN_MOMENT_Y = 0.00 +REF_ORIGIN_MOMENT_Z = 0.00 + +REF_AREA= 1.0 + +% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% + +MARKER_HEATFLUX = ( upper, -1000.0, lower, 1000.0 ) + +INC_OUTLET_TYPE = PRESSURE_OUTLET +MARKER_OUTLET= ( outlet, 0.0 ) + +MARKER_FLUID_INTERFACE= (circleOut) + +INC_INLET_TYPE= VELOCITY_INLET +SPECIFIED_INLET_PROFILE= YES +INLET_FILENAME= inlet.dat +MARKER_INLET= ( inlet, 200, 1.0, 1.0, 0.0, 0.0) + +MARKER_PLOTTING= ( NONE ) +MARKER_MONITORING= ( NONE ) + +% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% + +NUM_METHOD_GRAD= GREEN_GAUSS +CFL_NUMBER= 1000 +CFL_ADAPT= NO +CFL_ADAPT_PARAM= ( 1.5, 0.5, 15.0, 1e10) +MAX_DELTA_TIME= 1E6 +RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) +EXT_ITER= 200 + +% ------------------------ LINEAR SOLVER DEFINITION ---------------------------% + +LINEAR_SOLVER= FGMRES +LINEAR_SOLVER_PREC= ILU +LINEAR_SOLVER_ILU_FILL_IN= 0 +LINEAR_SOLVER_ERROR= 1E-8 +LINEAR_SOLVER_ITER= 10 + +% -------------------------- MULTIGRID PARAMETERS -----------------------------% + +MGLEVEL= 0 +MGCYCLE= V_CYCLE +MG_PRE_SMOOTH= ( 1, 1, 1, 1 ) +MG_POST_SMOOTH= ( 0, 0, 0, 0 ) +MG_CORRECTION_SMOOTH= ( 0, 0, 0, 0 ) +MG_DAMP_RESTRICTION= 0.8 +MG_DAMP_PROLONGATION= 0.8 + +% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% +% +CONV_NUM_METHOD_FLOW= FDS +MUSCL_FLOW= YES +SLOPE_LIMITER_FLOW= NONE +TIME_DISCRE_FLOW= EULER_IMPLICIT + +CONV_NUM_METHOD_TURB= SCALAR_UPWIND +MUSCL_TURB= NO +SLOPE_LIMITER_TURB= VENKATAKRISHNAN +TIME_DISCRE_TURB= EULER_IMPLICIT + +% --------------------------- CONVERGENCE PARAMETERS --------------------------% + +CONV_CRITERIA= RESIDUAL +RESIDUAL_REDUCTION= 12 +RESIDUAL_MINVAL= -16 +STARTCONV_ITER= 10 +CAUCHY_ELEMS= 100 +CAUCHY_EPS= 1E-6 +CAUCHY_FUNC_FLOW= DRAG + +% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% + +MESH_FILENAME= meshOut.su2 + +MESH_FORMAT= SU2 +MESH_OUT_FILENAME= mesh_out.su2 + +SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_ADJ_FILENAME= solution_adj.dat + +OUTPUT_FORMAT= PARAVIEW +CONV_FILENAME= history + +RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_ADJ_FILENAME= restart_adj.dat + +VOLUME_FLOW_FILENAME= flow +VOLUME_ADJ_FILENAME= adjoint + +GRAD_OBJFUNC_FILENAME= of_grad.dat + +SURFACE_FLOW_FILENAME= surface_flow +SURFACE_ADJ_FILENAME= surface_adjoint + +WRT_SOL_FREQ= 1 +WRT_SOL_FREQ_DUALTIME= 1 + +WRT_CON_FREQ= 1 +WRT_CON_FREQ_DUALTIME= 1 + diff --git a/TestCases/sliding_interface/pipe/pipe_NN.cfg b/TestCases/sliding_interface/pipe/pipe_NN.cfg index 44c64b28953..f5254531ac3 100644 --- a/TestCases/sliding_interface/pipe/pipe_NN.cfg +++ b/TestCases/sliding_interface/pipe/pipe_NN.cfg @@ -81,7 +81,7 @@ MARKER_ZONE_INTERFACE= ( intake_interface, inlet_interface_1, outlet_interface_1 % MARKER_FLUID_INTERFACE= ( intake_interface, inlet_interface_1, outlet_interface_1, inlet_interface_2, outlet_interface_2, inlet_interface_3, outlet_interface_3, inlet_interface_4 ) -MATCHING_MESH= NO + %KIND_INTERPOLATION= ISOPARAMETRIC % % diff --git a/TestCases/sliding_interface/pipe/pipe_WA.cfg b/TestCases/sliding_interface/pipe/pipe_WA.cfg index 3bc72523d1b..09743629389 100644 --- a/TestCases/sliding_interface/pipe/pipe_WA.cfg +++ b/TestCases/sliding_interface/pipe/pipe_WA.cfg @@ -81,7 +81,7 @@ MARKER_ZONE_INTERFACE= ( intake_interface, inlet_interface_1, outlet_interface_1 % MARKER_FLUID_INTERFACE= ( intake_interface, inlet_interface_1, outlet_interface_1, inlet_interface_2, outlet_interface_2, inlet_interface_3, outlet_interface_3, inlet_interface_4 ) % -MATCHING_MESH= NO + % KIND_INTERPOLATION= WEIGHTED_AVERAGE % diff --git a/TestCases/sliding_interface/rotating_cylinders/rot_cylinders_NN.cfg b/TestCases/sliding_interface/rotating_cylinders/rot_cylinders_NN.cfg index db565ab6e4d..49eb02a8df0 100644 --- a/TestCases/sliding_interface/rotating_cylinders/rot_cylinders_NN.cfg +++ b/TestCases/sliding_interface/rotating_cylinders/rot_cylinders_NN.cfg @@ -79,7 +79,7 @@ MARKER_RIEMANN= (inlet, STATIC_SUPERSONIC_INFLOW_PT, 95750, 288.15, 2.5, 0.0, 0. % Zone interaction boundary definition MARKER_ZONE_INTERFACE= ( domain_interface, external_interface, internal_interface, inner_interface) MARKER_FLUID_INTERFACE= ( domain_interface, external_interface, internal_interface, inner_interface) -MATCHING_MESH= NO + %KIND_INTERPOLATION= SLIDING_MESH % % Periodic boundary marker(s) (NONE = no marker) diff --git a/TestCases/sliding_interface/rotating_cylinders/rot_cylinders_WA.cfg b/TestCases/sliding_interface/rotating_cylinders/rot_cylinders_WA.cfg index 478038dd699..6f8092bad31 100644 --- a/TestCases/sliding_interface/rotating_cylinders/rot_cylinders_WA.cfg +++ b/TestCases/sliding_interface/rotating_cylinders/rot_cylinders_WA.cfg @@ -79,7 +79,7 @@ MARKER_RIEMANN= (inlet, STATIC_SUPERSONIC_INFLOW_PT, 95750, 288.15, 2.5, 0.0, 0. % Zone interaction boundary definition MARKER_ZONE_INTERFACE= ( domain_interface, external_interface, internal_interface, inner_interface) MARKER_FLUID_INTERFACE= ( domain_interface, external_interface, internal_interface, inner_interface) -MATCHING_MESH= NO + % KIND_INTERPOLATION= WEIGHTED_AVERAGE % diff --git a/TestCases/sliding_interface/single_stage/single_stage_NN.cfg b/TestCases/sliding_interface/single_stage/single_stage_NN.cfg index ba2c8a640f4..6bab2bf9e5b 100644 --- a/TestCases/sliding_interface/single_stage/single_stage_NN.cfg +++ b/TestCases/sliding_interface/single_stage/single_stage_NN.cfg @@ -92,7 +92,7 @@ MARKER_RIEMANN= (upper_inlet, STATIC_SUPERSONIC_INFLOW_PT, 95750, 288.15, 3.0, 0 MARKER_ZONE_INTERFACE= ( stator_interface, rotor_interface ) MARKER_FLUID_INTERFACE= ( stator_interface, rotor_interface ) -MATCHING_MESH= NO + KIND_INTERPOLATION= ISOPARAMETRIC %KIND_INTERPOLATION= SLIDING_MESH % diff --git a/TestCases/sliding_interface/single_stage/single_stage_WA.cfg b/TestCases/sliding_interface/single_stage/single_stage_WA.cfg index 96f83566bd7..bbfeca961c5 100644 --- a/TestCases/sliding_interface/single_stage/single_stage_WA.cfg +++ b/TestCases/sliding_interface/single_stage/single_stage_WA.cfg @@ -92,7 +92,7 @@ MARKER_RIEMANN= (upper_inlet, STATIC_SUPERSONIC_INFLOW_PT, 95750, 288.15, 3.0, 0 MARKER_ZONE_INTERFACE= ( stator_interface, rotor_interface ) MARKER_FLUID_INTERFACE= ( stator_interface, rotor_interface ) -MATCHING_MESH= NO + % KIND_INTERPOLATION= WEIGHTED_AVERAGE % diff --git a/TestCases/sliding_interface/supersonic_vortex_shedding/sup_vor_shed_NN.cfg b/TestCases/sliding_interface/supersonic_vortex_shedding/sup_vor_shed_NN.cfg index 66d60bdf664..14b6372b3bc 100644 --- a/TestCases/sliding_interface/supersonic_vortex_shedding/sup_vor_shed_NN.cfg +++ b/TestCases/sliding_interface/supersonic_vortex_shedding/sup_vor_shed_NN.cfg @@ -79,7 +79,7 @@ MARKER_RIEMANN= (inlet, STATIC_SUPERSONIC_INFLOW_PT, 95750, 288.15, 2.5, 0.0, 0. % Zone interaction boundary definition MARKER_ZONE_INTERFACE= ( external_interface, internal_interface) MARKER_FLUID_INTERFACE= ( external_interface, internal_interface) -MATCHING_MESH= NO + %KIND_INTERPOLATION= SLIDING_MESH % % diff --git a/TestCases/sliding_interface/supersonic_vortex_shedding/sup_vor_shed_WA.cfg b/TestCases/sliding_interface/supersonic_vortex_shedding/sup_vor_shed_WA.cfg index 92e552f7ae5..f7ce8589462 100644 --- a/TestCases/sliding_interface/supersonic_vortex_shedding/sup_vor_shed_WA.cfg +++ b/TestCases/sliding_interface/supersonic_vortex_shedding/sup_vor_shed_WA.cfg @@ -79,7 +79,7 @@ MARKER_RIEMANN= (inlet, STATIC_SUPERSONIC_INFLOW_PT, 95750, 288.15, 2.5, 0.0, 0. % Zone interaction boundary definition MARKER_ZONE_INTERFACE= ( external_interface, internal_interface) MARKER_FLUID_INTERFACE= ( external_interface, internal_interface) -MATCHING_MESH= NO + % KIND_INTERPOLATION= WEIGHTED_AVERAGE % diff --git a/TestCases/sliding_interface/uniform_flow/uniform_NN.cfg b/TestCases/sliding_interface/uniform_flow/uniform_NN.cfg index 70b77d1176f..a38f8e73d0c 100644 --- a/TestCases/sliding_interface/uniform_flow/uniform_NN.cfg +++ b/TestCases/sliding_interface/uniform_flow/uniform_NN.cfg @@ -81,7 +81,7 @@ MARKER_EULER= (outlet) % Zone interaction boundary definition MARKER_ZONE_INTERFACE= ( external_interface, internal_interface) MARKER_FLUID_INTERFACE= ( external_interface, internal_interface) -MATCHING_MESH= NO + %KIND_INTERPOLATION= SLIDING_MESH % % Periodic boundary marker(s) (NONE = no marker) diff --git a/TestCases/sliding_interface/uniform_flow/uniform_WA.cfg b/TestCases/sliding_interface/uniform_flow/uniform_WA.cfg index a6386b428ae..abc3adcb420 100644 --- a/TestCases/sliding_interface/uniform_flow/uniform_WA.cfg +++ b/TestCases/sliding_interface/uniform_flow/uniform_WA.cfg @@ -81,7 +81,7 @@ MARKER_EULER= (outlet) % Zone interaction boundary definition MARKER_ZONE_INTERFACE= ( external_interface, internal_interface) MARKER_FLUID_INTERFACE= ( external_interface, internal_interface) -MATCHING_MESH= NO + % KIND_INTERPOLATION= WEIGHTED_AVERAGE %