Documentation 6b54b78464
Loading...
Searching...
No Matches
CMeshSolver.hpp
Go to the documentation of this file.
1/*!
2 * \file CMeshSolver.hpp
3 * \brief Declaration and inlines of the class to compute the deformation of
4 * the volumetric numerical grid using the linear elasticity solver.
5 * \author Ruben Sanchez, based on CVolumetricMovement developments (F. Palacios, A. Bueno, T. Economon, S. Padron)
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 "CFEASolver.hpp"
32#include "../variables/CMeshBoundVariable.hpp"
33#include "../variables/CMeshElement.hpp"
34
35/*!
36 * \brief Mesh deformation solver (pseudo elasticity).
37 * \ingroup Elasticity_Equations
38 */
39class CMeshSolver final : public CFEASolver {
40protected:
41
44
45 bool stiffness_set; /*!< \brief Element-based stiffness is set. */
46
47 unsigned long ElemCounter; /*!< \brief Error (negative volume) counter. */
48
49 /*!
50 * \brief Minimum/Maximum distance and volume (in reference and current (deformed) coords).
51 */
55
56 vector<CMeshElement> element; /*!< \brief Vector which stores element information for each problem. */
57
58 /*!
59 * \brief Compute the min and max volume of the elements in the domain.
60 * \param[in] geometry - Geometrical definition of the problem.
61 * \param[in] config - Definition of the particular problem.
62 * \param[in] updated - Boolean, computes the volumes with the updated coordinates.
63 * \return Value of the length of the smallest edge of the grid.
64 */
65 void SetMinMaxVolume(CGeometry *geometry, CConfig *config, bool updated);
66
67 /*!
68 * \brief Compute the min and max volume of the elements in the domain.
69 * \param[in] geometry - Geometrical definition of the problem.
70 * \param[in] config - Definition of the particular problem.
71 */
72 void SetWallDistance(CGeometry *geometry, CConfig *config);
73
74 /*!
75 * \brief Update the value of the coordinates after the grid movement.
76 * \param[in] geometry - Geometrical definition of the problem.
77 * \param[in] config - Definition of the particular problem.
78 */
79 void UpdateGridCoord(CGeometry *geometry, const CConfig *config);
80
81 /*!
82 * \brief Compute the grid velocity form the displacements of the mesh.
83 * \param[in] geometry - Geometrical definition of the problem.
84 * \param[in] config - Definition of the particular problem.
85 */
86 void ComputeGridVelocity(CGeometry **geometry, const CConfig *config) const;
87
88 /*!
89 * \brief Compute the grid velocity form the velocity at deformable boundary.
90 * \param[in] geometry - Geometrical definition of the problem.
91 * \param[in] numerics - Description of the numerical method.
92 * \param[in] config - Definition of the particular problem.
93 */
94 void ComputeGridVelocity_FromBoundary(CGeometry **geometry, CNumerics **numerics, CConfig *config);
95
96 /*!
97 * \brief Check the boundary vertex that are going to be moved.
98 * \param[in] geometry - Geometrical definition of the problem.
99 * \param[in] config - Definition of the particular problem.
100 * \param[in] velocity_transfer - Boolean for deforming displacement or velocity
101 */
102 void SetBoundaryDisplacements(CGeometry *geometry, CConfig *config, bool velocity_transfer);
103
104 /*!
105 * \brief Apply forced displacement boundary conditions.
106 * \param[in] geometry - Geometrical definition of the problem.
107 * \param[in] config - Definition of the particular problem.
108 * \param[in] val_marker - Index of the marker.
109 * \param[in] velocity - Boolean for deforming displacement or velocity.
110 */
111 void BC_Deforming(CGeometry *geometry, const CConfig *config, unsigned short val_marker, bool velocity);
112
113 /*!
114 * \brief Load the geometries at the previous time states n and nM1.
115 * \param[in] geometry - Geometrical definition of the problem.
116 */
117 void RestartOldGeometry(CGeometry *geometry, const CConfig *config);
118
119public:
120 /*!
121 * \brief Constructor of the class.
122 */
123 CMeshSolver(CGeometry *geometry, CConfig *config);
124
125 /*!
126 * \brief Grid deformation using the linear elasticity equations.
127 * \param[in] geometry - Geometrical definition of the problem.
128 * \param[in] numerics - Numerics used in the solution.
129 * \param[in] config - Definition of the particular problem.
130 */
131 void DeformMesh(CGeometry **geometry,
132 CNumerics **numerics,
133 CConfig *config) override;
134
135 /*!
136 * \brief Set the stiffness of the mesh.
137 * \param[in] numerics - Numerics used in the solution.
138 * \param[in] config - Definition of the particular problem.
139 */
140 void SetMesh_Stiffness(CNumerics **numerics,
141 CConfig *config) override;
142
143 /*!
144 * \brief Get the value of the reference coordinate to set on the element structure.
145 * \param[in] indexNode - Index of the node.
146 * \param[in] iDim - Dimension required.
147 */
149 unsigned long indexNode,
150 unsigned short iDim) const override {
151 return static_cast<const CMeshBoundVariable*>(nodes)->GetMesh_Coord(indexNode,iDim);
152 }
153
154 /*!
155 * \brief Move the mesh in time.
156 */
157 void SetDualTime_Mesh(void) override;
158
159 /*!
160 * \brief Load a solution from a restart file.
161 * \param[in] geometry - Geometrical definition of the problem.
162 * \param[in] solver - Container vector with all of the solvers.
163 * \param[in] config - Definition of the particular problem.
164 * \param[in] val_iter - Current external iteration number.
165 * \param[in] val_update_geo - Flag for updating coords and grid velocity.
166 */
167 void LoadRestart(CGeometry **geometry,
168 CSolver ***solver,
169 CConfig *config,
170 int val_iter,
171 bool val_update_geo) override;
172
173 /*!
174 * \brief Get minimun volume in the mesh
175 * \return
176 */
177 inline su2double GetMinimum_Volume() const override {return MinVolume_Curr;}
178
179 /*!
180 * \brief Get maximum volume in the mesh
181 * \return
182 */
183 inline su2double GetMaximum_Volume() const override {return MaxVolume_Curr;}
184
185 /*!
186 * \brief Pitching definition for deforming mesh
187 * \param[in] geometry - Geometrical definition of the problem.
188 * \param[in] config - Definition of the particular problem.
189 * \param[in] iter - Current time iteration number
190 */
191 void Surface_Pitching(CGeometry *geometry, CConfig *config, unsigned long iter);
192
193 /*!
194 * \brief Rotating definition for deforming mesh
195 * \param[in] geometry - Geometrical definition of the problem.
196 * \param[in] config - Definition of the particular problem.
197 * \param[in] iter - Current time iteration number
198 */
199 void Surface_Rotating(CGeometry *geometry, CConfig *config, unsigned long iter);
200
201 /*!
202 * \brief Plunging definition for deforming mesh
203 * \param[in] geometry - Geometrical definition of the problem.
204 * \param[in] config - Definition of the particular problem.
205 * \param[in] iter - Current time iteration number
206 */
207 void Surface_Plunging(CGeometry *geometry, CConfig *config, unsigned long iter);
208
209 /*!
210 * \brief Translating definition for deforming mesh
211 * \param[in] geometry - Geometrical definition of the problem.
212 * \param[in] config - Definition of the particular problem.
213 * \param[in] iter - Current time iteration number
214 */
215 void Surface_Translating(CGeometry *geometry, CConfig *config, unsigned long iter);
216
217};
Finite element solver for elasticity problems.
Main class for defining the problem; basically this class reads the configuration file,...
Definition CConfig.hpp:64
Main class for defining a FEM solver for elastic structural problems.
Definition CFEASolver.hpp:38
CVariable * nodes
The highest level in the variable hierarchy this solver can safely use, CVariable is the common denom...
Definition CFEASolver.hpp:112
Parent class for defining the geometry of the problem (complete geometry, multigrid agglomerated geom...
Definition CGeometry.hpp:75
Definition CMeshBoundVariable.hpp:34
Mesh deformation solver (pseudo elasticity).
Definition CMeshSolver.hpp:39
void BC_Deforming(CGeometry *geometry, const CConfig *config, unsigned short val_marker, bool velocity)
Apply forced displacement boundary conditions.
Definition CMeshSolver.cpp:657
vector< CMeshElement > element
Vector which stores element information for each problem.
Definition CMeshSolver.hpp:56
void ComputeGridVelocity_FromBoundary(CGeometry **geometry, CNumerics **numerics, CConfig *config)
Compute the grid velocity form the velocity at deformable boundary.
Definition CMeshSolver.cpp:569
bool stiffness_set
Element-based stiffness is set.
Definition CMeshSolver.hpp:45
bool time_domain
Definition CMeshSolver.hpp:42
void SetDualTime_Mesh(void) override
Move the mesh in time.
Definition CMeshSolver.cpp:761
void SetMesh_Stiffness(CNumerics **numerics, CConfig *config) override
Set the stiffness of the mesh.
Definition CMeshSolver.cpp:416
su2double GetMinimum_Volume() const override
Get minimun volume in the mesh.
Definition CMeshSolver.hpp:177
void SetWallDistance(CGeometry *geometry, CConfig *config)
Compute the min and max volume of the elements in the domain.
Definition CMeshSolver.cpp:286
su2double MinDistance
Definition CMeshSolver.hpp:54
su2double MaxVolume_Curr
Definition CMeshSolver.hpp:53
void UpdateGridCoord(CGeometry *geometry, const CConfig *config)
Update the value of the coordinates after the grid movement.
Definition CMeshSolver.cpp:542
void ComputeGridVelocity(CGeometry **geometry, const CConfig *config) const
Compute the grid velocity form the displacements of the mesh.
Definition CMeshSolver.cpp:619
void Surface_Rotating(CGeometry *geometry, CConfig *config, unsigned long iter)
Rotating definition for deforming mesh.
Definition CMeshSolver.cpp:1103
void DeformMesh(CGeometry **geometry, CNumerics **numerics, CConfig *config) override
Grid deformation using the linear elasticity equations.
Definition CMeshSolver.cpp:474
void Surface_Plunging(CGeometry *geometry, CConfig *config, unsigned long iter)
Plunging definition for deforming mesh.
Definition CMeshSolver.cpp:1285
void Surface_Translating(CGeometry *geometry, CConfig *config, unsigned long iter)
Translating definition for deforming mesh.
Definition CMeshSolver.cpp:1413
void LoadRestart(CGeometry **geometry, CSolver ***solver, CConfig *config, int val_iter, bool val_update_geo) override
Load a solution from a restart file.
Definition CMeshSolver.cpp:768
su2double MaxVolume
Definition CMeshSolver.hpp:53
void SetBoundaryDisplacements(CGeometry *geometry, CConfig *config, bool velocity_transfer)
Check the boundary vertex that are going to be moved.
Definition CMeshSolver.cpp:674
bool multizone
Definition CMeshSolver.hpp:43
su2double MinVolume_Curr
Definition CMeshSolver.hpp:52
su2double GetMaximum_Volume() const override
Get maximum volume in the mesh.
Definition CMeshSolver.hpp:183
void Surface_Pitching(CGeometry *geometry, CConfig *config, unsigned long iter)
Pitching definition for deforming mesh.
Definition CMeshSolver.cpp:969
void RestartOldGeometry(CGeometry *geometry, const CConfig *config)
Load the geometries at the previous time states n and nM1.
Definition CMeshSolver.cpp:871
su2double MinVolume
Minimum/Maximum distance and volume (in reference and current (deformed) coords).
Definition CMeshSolver.hpp:52
su2double MaxDistance
Definition CMeshSolver.hpp:54
su2double Get_ValCoord(const CGeometry *, unsigned long indexNode, unsigned short iDim) const override
Get the value of the reference coordinate to set on the element structure.
Definition CMeshSolver.hpp:148
void SetMinMaxVolume(CGeometry *geometry, CConfig *config, bool updated)
Compute the min and max volume of the elements in the domain.
Definition CMeshSolver.cpp:173
unsigned long ElemCounter
Error (negative volume) counter.
Definition CMeshSolver.hpp:47
su2double MaxVolume_Ref
Definition CMeshSolver.hpp:53
su2double MinVolume_Ref
Definition CMeshSolver.hpp:52
Class for defining the numerical methods.
Definition CNumerics.hpp:48
Definition CSolver.hpp:71
passivedouble su2double
Definition code_config.hpp:181