Documentation 6b54b78464
Loading...
Searching...
No Matches
CMixingPlaneInterface.hpp
Go to the documentation of this file.
1/*!
2 * \file CMixingPlaneInterface.cpp
3 * \brief Declaration and inlines of the class to transfer average variables
4 * needed for MixingPlane computation from a generic zone into another one.
5 * \author S. Vitale
6 * \version 8.5.0 "Harrier"
7 *
8 * SU2 Project Website: https://su2code.github.io
9 *
10 * The SU2 Project is maintained by the SU2 Foundation
11 * (http://su2foundation.org)
12 *
13 * Copyright 2012-2026, SU2 Contributors (cf. AUTHORS.md)
14 *
15 * SU2 is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU Lesser General Public
17 * License as published by the Free Software Foundation; either
18 * version 2.1 of the License, or (at your option) any later version.
19 *
20 * SU2 is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 * Lesser General Public License for more details.
24 *
25 * You should have received a copy of the GNU Lesser General Public
26 * License along with SU2. If not, see <http://www.gnu.org/licenses/>.
27 */
28
29#pragma once
30
31#include "../CInterface.hpp"
32#include "../../../Common/include/containers/C2DContainer.hpp"
33
34/*!
35 * \brief Mixing plane interface for turbomachinery.
36 * \ingroup Interfaces
37 */
39public:
40 unsigned short nMixingVars;
41 /*!
42 * \overload
43 * \param[in] val_nVar - Number of variables that need to be transferred.
44 */
45 CMixingPlaneInterface(unsigned short val_nVar, unsigned short val_nConst);
46
47 /*!
48 * \brief Initialize quantities for spanwise sections for interpolation.
49 * \param[in] donor_config - Definition of the problem at the donor mesh.
50 * \param[in] target_config - Definition of the problem at the target mesh.
51 */
52 void SetSpanWiseLevels(const CConfig *donor_config, const CConfig *target_config) override;
53
54 /*!
55 * \brief Interpolate data and broadcast it into all processors, for nonmatching meshes.
56 * \param[in] interpolator - Object defining the interpolation.
57 * \param[in] donor_solution - Solution from the donor mesh.
58 * \param[in] target_solution - Solution from the target mesh.
59 * \param[in] donor_geometry - Geometry of the donor mesh.
60 * \param[in] target_geometry - Geometry of the target mesh.
61 * \param[in] donor_config - Definition of the problem at the donor mesh.
62 * \param[in] target_config - Definition of the problem at the target mesh.
63 */
64 void BroadcastData_MixingPlane(const CInterpolator& interpolator,
65 CSolver *donor_solution, CSolver *target_solution,
66 CGeometry *donor_geometry, CGeometry *target_geometry,
67 const CConfig *donor_config, const CConfig *target_config) override;
68
69 /*!
70 * \brief Retrieve the variable that will be sent from donor mesh to target mesh.
71 * \param[in] donor_solution - Solution from the donor mesh.
72 * \param[in] donor_geometry - Geometry of the donor mesh.
73 * \param[in] donor_config - Definition of the problem at the donor mesh.
74 * \param[in] Marker_Donor - Index of the donor marker.
75 * \param[in] Vertex_Donor - Index of the donor vertex.
76 * \param[in] Point_Donor - Index of the donor point.
77 */
78 void GetDonor_Variable(CSolver *donor_solution, CGeometry *donor_geometry, const CConfig *donor_config,
79 unsigned long Marker_Donor, unsigned long val_Span, unsigned long Point_Donor) override;
80
81 /*!
82 * \brief Set the variable that has been received from the target mesh into the target mesh.
83 * \param[in] target_solution - Solution from the target mesh.
84 * \param[in] target_geometry - Geometry of the target mesh.
85 * \param[in] target_config - Definition of the problem at the target mesh.
86 * \param[in] Marker_Target - Index of the target marker.
87 * \param[in] Vertex_Target - Index of the target vertex.
88 * \param[in] Point_Target - Index of the target point.
89 */
90 void SetTarget_Variable(CSolver *target_solution, CGeometry *target_geometry, const CConfig *target_config,
91 unsigned long Marker_Target, unsigned long val_Span, unsigned long Point_Target) override;
92
93 inline void RecoverTarget_SpanEndwall(const su2activevector &bcastVariable, unsigned long iSpan) override {
94 for (auto iVar = 0u; iVar < nMixingVars; iVar++) {
95 Target_Variable[iVar] = bcastVariable[iSpan * nMixingVars + iVar];
96 }
97 }
98
99 inline void RecoverTarget_Span(const su2activevector &bcastVariable, unsigned long iSpan, su2double donorCoeff) override {
100 for (auto iVar = 0u; iVar < nMixingVars; iVar++) {
101 Target_Variable[iVar] = (1 - donorCoeff)*bcastVariable[iSpan * nMixingVars + iVar] + donorCoeff * bcastVariable[(iSpan + 1) * nMixingVars + iVar];
102 }
103 }
104};
A templated matrix/vector-like object.
Definition C2DContainer.hpp:374
Main class for defining the problem; basically this class reads the configuration file,...
Definition CConfig.hpp:64
Parent class for defining the geometry of the problem (complete geometry, multigrid agglomerated geom...
Definition CGeometry.hpp:75
Main class for defining the physical transfer of information.
Definition CInterface.hpp:60
su2double * Target_Variable
Definition CInterface.hpp:68
Main class for defining the interpolator, it requires a child class for each particular interpolation...
Definition CInterpolator.hpp:47
Mixing plane interface for turbomachinery.
Definition CMixingPlaneInterface.hpp:38
void SetSpanWiseLevels(const CConfig *donor_config, const CConfig *target_config) override
Initialize quantities for spanwise sections for interpolation.
Definition CMixingPlaneInterface.cpp:43
void SetTarget_Variable(CSolver *target_solution, CGeometry *target_geometry, const CConfig *target_config, unsigned long Marker_Target, unsigned long val_Span, unsigned long Point_Target) override
Set the variable that has been received from the target mesh into the target mesh.
Definition CMixingPlaneInterface.cpp:180
void GetDonor_Variable(CSolver *donor_solution, CGeometry *donor_geometry, const CConfig *donor_config, unsigned long Marker_Donor, unsigned long val_Span, unsigned long Point_Donor) override
Retrieve the variable that will be sent from donor mesh to target mesh.
Definition CMixingPlaneInterface.cpp:152
void RecoverTarget_Span(const su2activevector &bcastVariable, unsigned long iSpan, su2double donorCoeff) override
Recovers the target variable at the span from the buffer of su2doubles that was broadcast for mixing ...
Definition CMixingPlaneInterface.hpp:99
void RecoverTarget_SpanEndwall(const su2activevector &bcastVariable, unsigned long iSpan) override
Recovers the target variable at the endwall from the buffer of su2doubles that was broadcast for mixi...
Definition CMixingPlaneInterface.hpp:93
void BroadcastData_MixingPlane(const CInterpolator &interpolator, CSolver *donor_solution, CSolver *target_solution, CGeometry *donor_geometry, CGeometry *target_geometry, const CConfig *donor_config, const CConfig *target_config) override
Interpolate data and broadcast it into all processors, for nonmatching meshes.
Definition CMixingPlaneInterface.cpp:59
unsigned short nMixingVars
Definition CMixingPlaneInterface.hpp:40
Definition CSolver.hpp:71
passivedouble su2double
Definition code_config.hpp:181