Documentation 6b54b78464
Loading...
Searching...
No Matches
CSlidingMesh.hpp
Go to the documentation of this file.
1/*!
2 * \file CSlidingMesh.hpp
3 * \brief Sliding mesh interpolation.
4 * \author H. Kline
5 * \version 8.5.0 "Harrier"
6 *
7 * SU2 Project Website: https://su2code.github.io
8 *
9 * The SU2 Project is maintained by the SU2 Foundation
10 * (http://su2foundation.org)
11 *
12 * Copyright 2012-2026, SU2 Contributors (cf. AUTHORS.md)
13 *
14 * SU2 is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU Lesser General Public
16 * License as published by the Free Software Foundation; either
17 * version 2.1 of the License, or (at your option) any later version.
18 *
19 * SU2 is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 * Lesser General Public License for more details.
23 *
24 * You should have received a copy of the GNU Lesser General Public
25 * License along with SU2. If not, see <http://www.gnu.org/licenses/>.
26 */
27#pragma once
28
29#include "CInterpolator.hpp"
30
31/*!
32 * \brief Sliding mesh approach.
33 * \note The algorithm is based on Rinaldi et al. "Flux-conserving treatment of non-conformal interfaces
34 * for finite-volume discritization of conservation laws" 2015, Comp. Fluids, 120, pp 126-139
35 * \ingroup Interfaces
36 */
37class CSlidingMesh final : public CInterpolator {
38 public:
39 /*!
40 * \brief Constructor of the class.
41 * \param[in] geometry - Geometrical definition of the problem.
42 * \param[in] config - Definition of the particular problem.
43 * \param[in] iZone - index of the donor zone.
44 * \param[in] jZone - index of the target zone.
45 */
46 CSlidingMesh(CGeometry**** geometry_container, const CConfig* const* config, unsigned int iZone, unsigned int jZone);
47
48 /*!
49 * \brief Set up transfer matrix defining relation between two meshes
50 * \param[in] config - Definition of the particular problem.
51 */
52 void SetTransferCoeff(CGeometry**** geometry, const CConfig* const* config) override;
53
54 private:
55 /*!
56 * \brief For 3-Dimensional grids, build the dual surface element
57 * \param[in] map - array containing the index of the boundary points connected to the node
58 * \param[in] startIndex - for each vertex specifies the corresponding index in the global
59 * array containing the indexes of all its neighbouring vertexes
60 * \param[in] nNeighbour - for each vertex specifies the number of its neighbouring vertexes (on the boundary)
61 * \param[in] coord - array containing the coordinates of all the boundary vertexes
62 * \param[in] centralNode - label of the vertex around which the dual surface element is built
63 * \param[out] element - double array where element node coordinates will be stored
64 * \return Number of points included in the element.
65 */
66 static int Build_3D_surface_element(const su2vector<unsigned long>& map, const su2vector<unsigned long>& startIndex,
67 const su2vector<unsigned long>& nNeighbor, const su2activematrix& coord,
68 unsigned long centralNode, su2double** element);
69
70 /*!
71 * \brief For 2-Dimensional grids, compute intersection length of two segments projected along a given direction
72 * \param[in] nDim - Number of dimensions
73 * \param[in] A1 - first point of segment A
74 * \param[in] A2 - second point of segment A
75 * \param[in] B1 - first point of segment B
76 * \param[in] B2 - second point of segment B
77 * \param[in] Direction - along which segments are projected
78 */
79 static su2double ComputeLineIntersectionLength(unsigned short nDim, const su2double* A1, const su2double* A2,
80 const su2double* B1, const su2double* B2, const su2double* Direction);
81
82 /*!
83 * \brief For 3-Dimensional grids, compute intersection area between two triangle projected on a given plane
84 * \param[in] A1 - first point of triangle A
85 * \param[in] A2 - second point of triangle A
86 * \param[in] A3 - third point of triangle A
87 * \param[in] B1 - first point of triangle B
88 * \param[in] B2 - second point of triangle B
89 * \param[in] B3 - third point of triangle B
90 * \param[in] Direction - vector normal to projection plane
91 */
92 static su2double Compute_Triangle_Intersection(const su2double* A1, const su2double* A2, const su2double* A3,
93 const su2double* B1, const su2double* B2, const su2double* B3,
94 const su2double* Direction);
95
96 /*!
97 * \brief For 3-Dimensional grids, compute intersection area between two triangle projected on a given plane
98 * P1 from triangle P MUST be inside triangle Q, points order doesn't matter
99 * \param[in] P1 - first point of triangle A
100 * \param[in] P2 - second point of triangle A
101 * \param[in] P3 - third point of triangle A
102 * \param[in] Q1 - first point of triangle B
103 * \param[in] Q2 - second point of triangle B
104 * \param[in] Q3 - third point of triangle B
105 */
106 static su2double ComputeIntersectionArea(const su2double* P1, const su2double* P2, const su2double* P3,
107 const su2double* Q1, const su2double* Q2, const su2double* Q3);
108
109 /*!
110 * \brief For 2-Dimensional grids, check whether, and compute, two lines are intersecting
111 * \param[in] A1 - first defining first line
112 * \param[in] A2 - second defining first line
113 * \param[in] B1 - first defining second line
114 * \param[in] B2 - second defining second line
115 * \param[out] IntersectionPoint - Container for intersection coordinates
116 */
117 static void ComputeLineIntersectionPoint(const su2double* A1, const su2double* A2, const su2double* B1,
118 const su2double* B2, su2double* IntersectionPoint);
119
120 /*!
121 * \brief For N-Dimensional grids, check whether a point is inside a triangle specified by 3 T points
122 * \param[in] Point - query point
123 * \param[in] T1 - first point of triangle T
124 * \param[in] T2 - second point of triangle T
125 * \param[in] T3 - third point of triangle T
126 */
127 static bool CheckPointInsideTriangle(const su2double* Point, const su2double* T1, const su2double* T2,
128 const su2double* T3);
129};
Base class for multiphysics interpolation.
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 interpolator, it requires a child class for each particular interpolation...
Definition CInterpolator.hpp:47
Sliding mesh approach.
Definition CSlidingMesh.hpp:37
void SetTransferCoeff(CGeometry ****geometry, const CConfig *const *config) override
Set up transfer matrix defining relation between two meshes.
Definition CSlidingMesh.cpp:39
passivedouble su2double
Definition code_config.hpp:181
@ P1
P1 Radiation model.