Documentation 6b54b78464
Loading...
Searching...
No Matches
CScalarSolver.hpp
Go to the documentation of this file.
1/*!
2 * \file CScalarSolver.hpp
3 * \brief Headers of the CScalarSolver class
4 * \version 8.5.0 "Harrier"
5 *
6 * SU2 Project Website: https://su2code.github.io
7 *
8 * The SU2 Project is maintained by the SU2 Foundation
9 * (http://su2foundation.org)
10 *
11 * Copyright 2012-2026, SU2 Contributors (cf. AUTHORS.md)
12 *
13 * SU2 is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU Lesser General Public
15 * License as published by the Free Software Foundation; either
16 * version 2.1 of the License, or (at your option) any later version.
17 *
18 * SU2 is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 * Lesser General Public License for more details.
22 *
23 * You should have received a copy of the GNU Lesser General Public
24 * License along with SU2. If not, see <http://www.gnu.org/licenses/>.
25 */
26
27#pragma once
28
29#include <vector>
30
31#include "../../../Common/include/parallelization/omp_structure.hpp"
32#include "../../../Common/include/toolboxes/geometry_toolbox.hpp"
33#include "../numerics/scalar/scalar_edge_flux.hpp"
34#include "../variables/CScalarVariable.hpp"
35#include "../variables/CEulerVariable.hpp"
36#include "../variables/CFlowVariable.hpp"
37#include "../variables/CGhostFlowVariable.hpp"
38#include "../variables/CIncEulerVariable.hpp"
39#include "../variables/CPrimitiveIndices.hpp"
40#include "CSolver.hpp"
41
42/*!
43 * \brief Carries a type through a value, so a runtime branch can hand a compile-time type to a
44 * generic lambda (its parameter deduces as CTypeTag<T>, and the lambda recovers T as
45 * decltype(tag)::type). Standing in for a C++20 template lambda, which this project's
46 * C++17 baseline does not have.
47 */
48template <class T>
49struct CTypeTag {
50 using type = T;
51};
52
53/*!
54 * \brief Main class for defining a scalar solver.
55 * \tparam VariableType - Class of variable used by the solver inheriting from this template.
56 * \ingroup Scalar_Transport
57 */
58template <class VariableType>
59class CScalarSolver : public CSolver {
60 protected:
61 enum : size_t { MAXNDIM = 3 }; /*!< \brief Max number of space dimensions, used in some static arrays. */
62 static constexpr size_t MAXNVAR = VariableType::MAXNVAR; /*!< \brief Max number of variables, for static arrays. */
63 enum : size_t { MAXNVARFLOW = 12 }; /*!< \brief Max number of flow variables, used in some static arrays. */
64
65 enum : size_t { OMP_MAX_SIZE = 512 }; /*!< \brief Max chunk size for light point loops. */
66 enum : size_t { OMP_MIN_SIZE = 32 }; /*!< \brief Min chunk size for edge loops (max is color group size). */
67
68 unsigned long omp_chunk_size; /*!< \brief Chunk size used in light point loops. */
69
70 su2double lowerlimit[MAXNVAR]; /*!< \brief contains lower limits for scalar variables. */
71 su2double upperlimit[MAXNVAR]; /*!< \brief contains upper limits for scalar variables. */
72
73 su2double Solution_Inf[MAXNVAR]; /*!< \brief Far-field solution. */
74
75 const bool Conservative; /*!< \brief Transported Variable is conservative. Solution has to be multiplied with rho. */
76 const bool BoundedScalar; /*!< \brief Whether the derived solver uses the bounded-scalar convective scheme. */
77
78 const CPrimitiveIndices<unsigned short> prim_idx; /*!< \brief Indices of the primitive flow variables. */
79
80 vector<su2matrix<su2double*> > SlidingState; // vector of matrix of pointers... inner dim alloc'd elsewhere (welcome, to the twilight zone)
81 vector<vector<int> > SlidingStateNodes;
82
83 /*--- Shallow copy of grid coloring for OpenMP parallelization. ---*/
84
85#ifdef HAVE_OMP
86 vector<GridColor<> > EdgeColoring; /*!< \brief Edge colors. */
87 bool ReducerStrategy = false; /*!< \brief If the reducer strategy is in use. */
88#else
89 array<DummyGridColor<>, 1> EdgeColoring;
90 /*--- Never use the reducer strategy if compiling for MPI-only. ---*/
91 static constexpr bool ReducerStrategy = false;
92#endif
93
94 /*--- Edge fluxes for reducer strategy (see the notes in CEulerSolver.hpp). ---*/
95 CSysVector<su2double> EdgeFluxes; /*!< \brief Flux across each edge. */
96 CSysVector<su2double> EdgeFluxesDiff; /*!< \brief Flux difference between ij and ji for non-conservative discretisation. */
97
98 /*--- Ghost states of the marker currently being processed by a boundary, indexed by vertex
99 * and sized to the largest marker; same container types as the interior ones, so the flux
100 * kernels read a boundary through the same accessors as an interior edge. Boundary loops run
101 * one marker at a time, parallel over its vertices, so the buffers are written and consumed
102 * before the next marker reaches them (see BoundaryFluxResidual). ---*/
103 unique_ptr<VariableType> ghostNodes; /*!< \brief Allocated by the derived solver, whose VariableType constructor it alone knows how to call. */
104 unique_ptr<CGhostFlowVariable> ghostFlowNodes; /*!< \brief Sized from the flow solver, see the constructor. */
105 su2activematrix ghostNormal; /*!< \brief Outward normals, sign flipped from the vertex normals. */
106 su2activematrix ghostCoord; /*!< \brief Reflected coordinates, read by the diffusion sites. */
107 su2vector<uint8_t> ghostSkip; /*!< \brief Whether a vertex contributes no flux, set by the fill pass. */
108
109 /*!
110 * \brief The highest level in the variable hierarchy this solver can safely use.
111 */
112 VariableType* nodes = nullptr;
113
114 /*!
115 * \brief Return nodes to allow CSolver::base_nodes to be set.
116 */
117 inline CVariable* GetBaseClassPointerToNodes() final { return nodes; }
118
119 /*!
120 * \brief Generic implementation of the fluid interface boundary condition for scalar solvers.
121 * \tparam SolverSpecificNumericsFunc - lambda that implements solver specific contributions to viscous numerics.
122 * \note The functor has to implement (iPoint)
123 * \param[in] geometry - Geometrical definition of the problem.
124 * \param[in] solver_container - Container vector with all the solutions.
125 * \param[in] conv_numerics - Description of the numerical method.
126 * \param[in] visc_numerics - Description of the numerical method.
127 * \param[in] config - Definition of the particular problem.
128 */
129 template <class SolverSpecificNumericsFunc>
130 void BC_Fluid_Interface_impl(const SolverSpecificNumericsFunc& SolverSpecificNumerics, CGeometry *geometry,
131 CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics,
132 CConfig *config) {
133 if (solver_container[FLOW_SOL] == nullptr) return;
134
135 const auto nPrimVar = solver_container[FLOW_SOL]->GetnPrimVar();
136 su2activevector PrimVar_j(nPrimVar);
137 su2double solution_j[MAXNVAR] = {0.0};
138
139 for (auto iMarker = 0u; iMarker < config->GetnMarker_All(); iMarker++) {
140
141 if (config->GetMarker_All_KindBC(iMarker) != FLUID_INTERFACE) continue;
142
144 for (auto iVertex = 0u; iVertex < geometry->nVertex[iMarker]; iVertex++) {
145
146 const auto iPoint = geometry->vertex[iMarker][iVertex]->GetNode();
147
148 if (!geometry->nodes->GetDomain(iPoint)) continue;
149
150 const auto Point_Normal = geometry->vertex[iMarker][iVertex]->GetNormal_Neighbor();
151 const auto nDonorVertex = GetnSlidingStates(iMarker,iVertex);
152
153 su2double Normal[MAXNDIM] = {0.0};
154 for (auto iDim = 0u; iDim < nDim; iDim++)
155 Normal[iDim] = -geometry->vertex[iMarker][iVertex]->GetNormal()[iDim];
156
157 su2double* PrimVar_i = solver_container[FLOW_SOL]->GetNodes()->GetPrimitive(iPoint);
158
159 auto* Jacobian_i = Jacobian.GetBlock(iPoint, iPoint);
160
161 /*--- Loop over the nDonorVertexes and compute the averaged flux ---*/
162
163 for (auto jVertex = 0; jVertex < nDonorVertex; jVertex++) {
164
165 for (auto iVar = 0u; iVar < nPrimVar; iVar++)
166 PrimVar_j[iVar] = solver_container[FLOW_SOL]->GetSlidingState(iMarker, iVertex, iVar, jVertex);
167
168 /*--- Get the weight computed in the interpolator class for the j-th donor vertex ---*/
169
170 const su2double weight = solver_container[FLOW_SOL]->GetSlidingState(iMarker, iVertex, nPrimVar, jVertex);
171
172 /*--- Set primitive variables ---*/
173
174 conv_numerics->SetPrimitive( PrimVar_i, PrimVar_j.data() );
175
176 /*--- Set the scalar variable states ---*/
177
178 for (auto iVar = 0u; iVar < nVar; ++iVar)
179 solution_j[iVar] = GetSlidingState(iMarker, iVertex, iVar, jVertex);
180
181 conv_numerics->SetScalarVar(nodes->GetSolution(iPoint), solution_j);
182
183 /*--- Set the normal vector ---*/
184
185 conv_numerics->SetNormal(Normal);
186
187 if (dynamic_grid)
188 conv_numerics->SetGridVel(geometry->nodes->GetGridVel(iPoint), geometry->nodes->GetGridVel(iPoint));
189
190 if (conv_numerics->GetBoundedScalar()) {
191 const su2double* velocity = &PrimVar_j[prim_idx.Velocity()];
192 const su2double density = solver_container[FLOW_SOL]->GetNodes()->GetDensity(iPoint);
193 conv_numerics->SetMassFlux(BoundedScalarBCFlux(iPoint, true, density, velocity, Normal));
194 }
195
196 auto residual = conv_numerics->ComputeResidual(config);
197
198 /*--- Accumulate the residuals to compute the average ---*/
199
200 for (auto iVar = 0u; iVar < nVar; iVar++) {
201 LinSysRes(iPoint,iVar) += weight*residual[iVar];
202 for (auto jVar = 0u; jVar < nVar; jVar++)
203 Jacobian_i[iVar*nVar+jVar] += SU2_TYPE::GetValue(weight*residual.jacobian_i[iVar][jVar]);
204 }
205 }
206
207 /*--- Set the normal vector and the coordinates ---*/
208
209 visc_numerics->SetNormal(Normal);
210 su2double Coord_Reflected[MAXNDIM];
211 GeometryToolbox::PointPointReflect(nDim, geometry->nodes->GetCoord(Point_Normal),
212 geometry->nodes->GetCoord(iPoint), Coord_Reflected);
213 visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), Coord_Reflected);
214
215 /*--- Primitive variables ---*/
216
217 visc_numerics->SetPrimitive(PrimVar_i, PrimVar_j.data());
218
219 /*--- Scalar variables and their gradients ---*/
220
221 visc_numerics->SetScalarVar(nodes->GetSolution(iPoint), solution_j);
222 visc_numerics->SetScalarVarGradient(nodes->GetGradient(iPoint), nodes->GetGradient(iPoint));
223
224 /*--- Allow derived solvers to set more variables in numerics. ---*/
225
226 SolverSpecificNumerics(iPoint);
227
228 /*--- Compute and update residual ---*/
229
230 auto residual = visc_numerics->ComputeResidual(config);
231
232 LinSysRes.SubtractBlock(iPoint, residual);
233
234 /*--- Jacobian contribution for implicit integration ---*/
235
236 Jacobian.SubtractBlock2Diag(iPoint, residual.jacobian_i);
237
238 }
240 }
241 }
242
243 /*!
244 * \brief Applies a convective flux correction to negate the effects of flow divergence at a BC node.
245 * \note This function should be used for nodes that are part of a boundary marker, it computes a mass flux
246 * from density and velocity at the node, and the outward-pointing normal (-1 * normal of vertex).
247 * \return The mass flux.
248 */
249 inline su2double BoundedScalarBCFlux(unsigned long iPoint, bool implicit, const su2double& density,
250 const su2double* velocity, const su2double* normal) {
251 const su2double edgeMassFlux = density * GeometryToolbox::DotProduct(nDim, velocity, normal);
252 LinSysRes.AddBlock(iPoint, nodes->GetSolution(iPoint), -edgeMassFlux);
253 if (implicit) Jacobian.AddVal2Diag(iPoint, -edgeMassFlux);
254 return edgeMassFlux;
255 }
256
257 /*!
258 * \brief Move solution to previous time levels (for restarts).
259 */
260 void PushSolutionBackInTime(unsigned long TimeIter, bool restart, CSolver*** solver_container,
261 CGeometry** geometry, CConfig* config);
262
263 /*!
264 * \brief Gradient and Limiter computation.
265 * \param[in] geometry - Geometrical definition of the problem.
266 * \param[in] config - Definition of the particular problem.
267 * \param[in] Output - boolean to determine whether the residual+jacobian should be zeroed.
268 */
269 void CommonPreprocessing(CGeometry *geometry, const CConfig *config, const bool Output);
270
271 /*!
272 * \brief Sum the edge fluxes for each cell to populate the residual vector, only used on coarse grids.
273 * \param[in] geometry - Geometrical definition of the problem.
274 */
275 void SumEdgeFluxes(const CGeometry* geometry);
276
277 /*!
278 * \brief Generic interior edge loop for a scalar model expressed through the CUpwScalarBase
279 * CRTP chain (numerics/scalar/scalar_edge_flux.hpp), driving both the convective and
280 * the diffusive term of every edge with a single kernel, under either update strategy.
281 * \tparam Scheme - A model instantiated from CUpwScalarBase, e.g. CScalarFlux_SA<...>.
282 * \param[in] opt - Loop invariant flags built by the caller from the current CConfig state.
283 */
284 template <class Scheme>
285 void EdgeFluxResidual(const CGeometry* geometry, CSolver** solver_container, const CConfig* config,
286 const ScalarFluxOptions& opt);
287
288 /*!
289 * \brief Write the four flow primitives the flux kernels read into one row of ghostFlowNodes.
290 * \param[in] iVertex - Vertex of the marker currently being processed.
291 * \param[in] V - Row of flow primitives to copy from (e.g. GetCharacPrimVar's or a sliding state's).
292 */
293 inline void SetGhostPrimitives(unsigned long iVertex, const su2double* V) {
294 auto* ghostV = ghostFlowNodes->GetPrimitive(iVertex);
295 ghostV[prim_idx.Density()] = V[prim_idx.Density()];
296 for (auto iDim = 0u; iDim < nDim; ++iDim) ghostV[prim_idx.Velocity() + iDim] = V[prim_idx.Velocity() + iDim];
299 /*--- NEMO's primitive layout has no single thermal conductivity or specific heat, so its
300 * CIndices returns a sentinel for these two; only heat reads them, and NEMO rejects any
301 * scalar transport at configuration. ---*/
302 if (prim_idx.ThermalConductivity() != std::numeric_limits<unsigned short>::max()) {
304 ghostV[prim_idx.CpTotal()] = V[prim_idx.CpTotal()];
305 }
306 }
307
308 /*!
309 * \brief Generic boundary flux pass, run after a boundary's fill pass has written the ghost
310 * row, the outward normal and (for the diffusion sites) the ghost gradient of every
311 * vertex of the marker. The ghost point has no row, so only the contribution to the
312 * interior point is assembled.
313 * \tparam Scheme - Same model the interior loop uses, instantiated with muscl false.
314 */
315 template <class Scheme>
316 void BoundaryFluxResidual(const CGeometry* geometry, CSolver** solver_container, const CConfig* config,
317 const ScalarFluxOptions& opt, unsigned short val_marker);
318
319 /*!
320 * \brief Generic fluid interface (sliding mesh) flux pass, shared by every model. The convective
321 * term is a per-donor weighted average, computed in the same pass that fills the ghost row
322 * of each donor; the diffusive term is computed once per vertex, after the donor loop,
323 * from the ghost state the last donor left behind. This does not fit the
324 * fill-pass-then-BoundaryFluxResidual shape the other boundaries use, so it drives the
325 * kernel directly.
326 * \tparam Scheme - Same model the interior loop uses, instantiated with muscl false.
327 * \param[in] fillGhostExtras - Functor (iVertex, iPoint) writing the auxiliary ghost fields the
328 * model's diffusion coefficients read, e.g. SST's blending function or the species
329 * mass diffusivities. Called once per vertex, before the diffusive flux.
330 */
331 template <class Scheme, class GhostFunc>
332 void FluidInterfaceFluxResidual(const CGeometry* geometry, CSolver** solver_container, const CConfig* config,
333 const ScalarFluxOptions& optConv, const ScalarFluxOptions& optVisc,
334 const GhostFunc& fillGhostExtras);
335
336 /*!
337 * \brief Write the outward normal of one vertex into the ghost row and mark the vertex as
338 * contributing a flux.
339 * \note Vertex normals point into the domain, the flux convention needs them outward.
340 */
341 inline void SetGhostGeometry(const CGeometry* geometry, unsigned short val_marker, unsigned long iVertex) {
342 for (auto iDim = 0u; iDim < nDim; ++iDim)
343 ghostNormal(iVertex, iDim) = -geometry->vertex[val_marker][iVertex]->GetNormal(iDim);
344 ghostSkip[iVertex] = false;
345 }
346
347 /*!
348 * \brief Write what the diffusion term of a boundary reads beyond the ghost solution: the
349 * coordinate of the interior point reflected about the boundary, and the interior
350 * gradient mirrored into the ghost row.
351 * \param[in] iPoint - Interior point of the vertex.
352 * \param[in] jPoint - Point the interior one is reflected about, the vertex's normal neighbor.
353 */
354 inline void SetGhostDiffusionState(const CGeometry* geometry, unsigned long iVertex, unsigned long iPoint,
355 unsigned long jPoint) {
356 su2double Coord_Reflected[MAXNDIM];
357 GeometryToolbox::PointPointReflect(nDim, geometry->nodes->GetCoord(jPoint), geometry->nodes->GetCoord(iPoint),
358 Coord_Reflected);
359 for (auto iDim = 0u; iDim < nDim; ++iDim) ghostCoord(iVertex, iDim) = Coord_Reflected[iDim];
360
361 auto ghostGrad = ghostNodes->GetGradient(iVertex);
362 const auto interiorGrad = nodes->GetGradient(iPoint);
363 for (auto iVar = 0u; iVar < nVar; ++iVar)
364 for (auto iDim = 0u; iDim < nDim; ++iDim) ghostGrad(iVar, iDim) = interiorGrad(iVar, iDim);
365 }
366
367 /*!
368 * \brief Resolve the compile-time parameters of a scalar flux kernel, the flow indices, the
369 * dimension and the equation count, from the runtime state, and call f with a CTypeTag of
370 * the resulting scheme type: f is a generic lambda,
371 * `[&](auto tag){ using Scheme = typename decltype(tag)::type; ... }`.
372 * \tparam Model - Model class template, e.g. CScalarFlux_SST, taking the four parameters of
373 * CUpwScalarBase: value type, flow indices, dimension and equation count.
374 * \tparam nVarList - Equation counts to instantiate. Dynamic matches any count, a static one is
375 * taken when it equals the solver's nVar; the counts are tried in the order given.
376 * \note NEMO is not one of the index branches: transported scalars are rejected for it at
377 * configuration.
378 */
379 template <template <class, class, int, size_t> class Model, size_t... nVarList, class F>
380 void DispatchScheme(const CConfig* config, F&& f) {
382 DispatchDim<Model, CIncEulerVariable::CIndices<unsigned short>, nVarList...>(std::forward<F>(f));
383 } else {
384 DispatchDim<Model, CEulerVariable::CIndices<unsigned short>, nVarList...>(std::forward<F>(f));
385 }
386 }
387
388 private:
389 template <template <class, class, int, size_t> class Model, class Indices, size_t... nVarList, class F>
390 void DispatchDim(F&& f) {
391 if (nDim == 2) {
392 DispatchEqnCount<Model, Indices, 2, nVarList...>(std::forward<F>(f));
393 } else {
394 DispatchEqnCount<Model, Indices, 3, nVarList...>(std::forward<F>(f));
395 }
396 }
397
398 /*--- Recursion over the candidate equation counts, ending on the empty list. ---*/
399 template <template <class, class, int, size_t> class Model, class Indices, int nDim_, class F>
400 void DispatchEqnCount(F&&) {
401 SU2_MPI::Error("The equation count of this model has no instantiation.", CURRENT_FUNCTION);
402 }
403
404 template <template <class, class, int, size_t> class Model, class Indices, int nDim_, size_t nVar_,
405 size_t... others, class F>
406 void DispatchEqnCount(F&& f) {
407 if (nVar_ == Dynamic || nVar_ == nVar) {
408 f(CTypeTag<Model<su2double, Indices, nDim_, nVar_>>{});
409 } else {
410 DispatchEqnCount<Model, Indices, nDim_, others...>(std::forward<F>(f));
411 }
412 }
413
414 /*!
415 * \brief Compute a suitable under-relaxation parameter to limit the change in the solution variables over
416 * a nonlinear iteration for stability. Default value 1.0 set in ctor of CScalarVariable.
417 * \param[in] config - Definition of the particular problem.
418 */
419 virtual void ComputeUnderRelaxationFactor(CSolver** solver_container, const CConfig* config) {}
420
421 public:
422 /*!
423 * \brief Destructor of the class.
424 */
425 ~CScalarSolver() override;
426
427 /*!
428 * \brief Constructor of the class.
429 * \param[in] geometry - Geometrical definition of the problem.
430 * \param[in] config - Definition of the particular problem.
431 * \param[in] flow_solver - Flow solver the boundary ghost states mirror, null for a solver that
432 * has no flow to read (the heat equation on a solid zone).
433 */
434 CScalarSolver(CGeometry* geometry, CConfig* config, const CSolver* flow_solver, bool conservative,
435 bool bounded_scalar, LINEAR_SOLVER_MODE linear_solver_mode = LINEAR_SOLVER_MODE::STANDARD);
436
437 /*!
438 * \brief Impose the Far Field boundary condition.
439 * \param[in] geometry - Geometrical definition of the problem.
440 * \param[in] solver_container - Container vector with all the solutions.
441 * \param[in] conv_numerics - Description of the numerical method.
442 * \param[in] visc_numerics - Description of the numerical method.
443 * \param[in] config - Definition of the particular problem.
444 * \param[in] val_marker - Surface marker where the boundary condition is applied.
445 */
446 void BC_Far_Field(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics,
447 CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) override;
448
449 /*!
450 * \brief Impose the Symmetry Plane boundary condition.
451 * \param[in] geometry - Geometrical definition of the problem.
452 * \param[in] solver_container - Container vector with all the solutions.
453 * \param[in] conv_numerics - Description of the numerical method.
454 * \param[in] visc_numerics - Description of the numerical method.
455 * \param[in] config - Definition of the particular problem.
456 * \param[in] val_marker - Surface marker where the boundary condition is applied.
457 */
458 inline void BC_Sym_Plane(CGeometry* geometry, CSolver** solver_container, CNumerics* conv_numerics,
459 CNumerics* visc_numerics, CConfig* config, unsigned short val_marker) override {
460 /*--- Convective and viscous fluxes across symmetry plane are equal to zero. ---*/
461 }
462
463 /*!
464 * \brief Impose via the residual the Euler wall boundary condition.
465 * \param[in] geometry - Geometrical definition of the problem.
466 * \param[in] solver_container - Container vector with all the solutions.
467 * \param[in] conv_numerics - Description of the numerical method.
468 * \param[in] visc_numerics - Description of the numerical method.
469 * \param[in] config - Definition of the particular problem.
470 * \param[in] val_marker - Surface marker where the boundary condition is applied.
471 */
472 inline void BC_Euler_Wall(CGeometry* geometry, CSolver** solver_container, CNumerics* conv_numerics,
473 CNumerics* visc_numerics, CConfig* config, unsigned short val_marker) final {
474 /*--- Convective fluxes across euler wall are equal to zero. ---*/
475 }
476
477 /*!
478 * \brief Impose the boundary condition using characteristic recostruction.
479 * \param[in] geometry - Geometrical definition of the problem.
480 * \param[in] solver_container - Container vector with all the solutions.
481 * \param[in] numerics - Description of the numerical method.
482 * \param[in] config - Definition of the particular problem.
483 * \param[in] val_marker - Surface marker where the boundary condition is applied.
484 */
485 void BC_Riemann(CGeometry *geometry,
486 CSolver **solver_container,
487 CNumerics *conv_numerics,
488 CNumerics *visc_numerics,
489 CConfig *config,
490 unsigned short val_marker) final;
491
492
493 /*!
494 * \brief Impose the supersonic inlet boundary condition (same as inlet, see BC_Inlet).
495 */
496 void BC_Supersonic_Inlet(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics,
497 CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) final {
498 BC_Inlet(geometry, solver_container, conv_numerics, visc_numerics, config, val_marker);
499 }
500
501 /*!
502 * \brief Impose the supersonic outlet boundary condition (same as outlet, see BC_Outlet).
503 */
504 void BC_Supersonic_Outlet(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics,
505 CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) final {
506 BC_Outlet(geometry, solver_container, conv_numerics, visc_numerics, config, val_marker);
507 }
508
509 /*!
510 * \brief Impose a periodic boundary condition by summing contributions from the complete control volume.
511 * \param[in] geometry - Geometrical definition of the problem.
512 * \param[in] solver_container - Container vector with all the solutions.
513 * \param[in] numerics - Description of the numerical method.
514 * \param[in] config - Definition of the particular problem.
515 */
516 void BC_Periodic(CGeometry* geometry, CSolver** solver_container, CNumerics* numerics, CConfig* config) final;
517
518 /*!
519 * \brief Impose the fluid interface boundary condition using transfer data.
520 * \param[in] geometry - Geometrical definition of the problem.
521 * \param[in] solver_container - Container vector with all the solutions.
522 * \param[in] conv_numerics - Description of the numerical method.
523 * \param[in] visc_numerics - Description of the numerical method.
524 * \param[in] config - Definition of the particular problem.
525 */
526 void BC_Fluid_Interface(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics,
527 CNumerics *visc_numerics, CConfig *config) override {
528 /*--- By default instantiate the generic implementation w/o extra variables, derived solvers can override. ---*/
529 BC_Fluid_Interface_impl([](unsigned long){}, geometry, solver_container, conv_numerics, visc_numerics, config);
530 }
531
532 /*!
533 * \brief Set the solution using the Freestream values.
534 * \param[in] config - Definition of the particular problem.
535 */
536 inline void SetFreeStream_Solution(const CConfig* config) final {
538 for (unsigned long iPoint = 0; iPoint < nPoint; iPoint++) {
539 nodes->SetSolution(iPoint, Solution_Inf);
540 }
542 }
543
544 /*!
545 * \brief This base implementation simply copies the time step of the flow solver.
546 * \param[in] geometry - Geometrical definition of the problem.
547 * \param[in] solver_container - Container vector with all the solutions.
548 * \param[in] config - Definition of the particular problem.
549 * \param[in] iMesh - Index of the mesh in multigrid computations.
550 * \param[in] Iteration - Index of the current iteration.
551 */
552 void SetTime_Step(CGeometry *geometry, CSolver **solver_container, CConfig *config,
553 unsigned short iMesh, unsigned long Iteration) override;
554
555 /*!
556 * \brief Prepare an implicit iteration.
557 * \param[in] geometry - Geometrical definition of the problem.
558 * \param[in] solver_container - Container vector with all the solutions.
559 * \param[in] config - Definition of the particular problem.
560 */
561 void PrepareImplicitIteration(CGeometry* geometry, CSolver** solver_container, CConfig* config) final;
562
563 /*!
564 * \brief Complete an implicit iteration.
565 * \param[in] geometry - Geometrical definition of the problem.
566 * \param[in] solver_container - Container vector with all the solutions.
567 * \param[in] config - Definition of the particular problem.
568 */
569 void CompleteImplicitIteration(CGeometry* geometry, CSolver** solver_container, CConfig* config) final;
570
571 /*!
572 * \brief Update the solution using the explicit Euler scheme.
573 * \param[in] geometry - Geometrical definition of the problem.
574 * \param[in] solver_container - Container vector with all the solutions.
575 * \param[in] config - Definition of the particular problem.
576 */
577 void ExplicitEuler_Iteration(CGeometry* geometry, CSolver** solver_container, CConfig* config) final;
578
579 /*!
580 * \brief Update the solution using an implicit solver.
581 * \param[in] geometry - Geometrical definition of the problem.
582 * \param[in] solver_container - Container vector with all the solutions.
583 * \param[in] config - Definition of the particular problem.
584 */
585 void ImplicitEuler_Iteration(CGeometry* geometry, CSolver** solver_container, CConfig* config) override;
586
587 /*!
588 * \brief Set the total residual adding the term that comes from the Dual Time-Stepping Strategy.
589 * \param[in] geometry - Geometric definition of the problem.
590 * \param[in] solver_container - Container vector with all the solutions.
591 * \param[in] config - Definition of the particular problem.
592 * \param[in] iRKStep - Current step of the Runge-Kutta iteration.
593 * \param[in] iMesh - Index of the mesh in multigrid computations.
594 * \param[in] RunTime_EqSystem - System of equations which is going to be solved.
595 */
596 void SetResidual_DualTime(CGeometry* geometry, CSolver** solver_container, CConfig* config, unsigned short iRKStep,
597 unsigned short iMesh, unsigned short RunTime_EqSystem) override;
598
599 /*!
600 * \brief Load a solution from a restart file.
601 * \param[in] geometry - Geometrical definition of the problem.
602 * \param[in] solver - Container vector with all of the solvers.
603 * \param[in] config - Definition of the particular problem.
604 * \param[in] val_iter - Current external iteration number.
605 * \param[in] val_update_geo - Flag for updating coords and grid velocity.
606 */
607 void LoadRestart(CGeometry** geometry, CSolver*** solver, CConfig* config, int val_iter,
608 bool val_update_geo) override = 0;
609
610 /*!
611 * \brief Scalar solvers support OpenMP+MPI.
612 */
613 inline bool GetHasHybridParallel() const override { return true; }
614
615 /*!
616 * \brief Get the outer state for fluid interface nodes.
617 * \param[in] val_marker - marker index
618 * \param[in] val_vertex - vertex index
619 * \param[in] val_state - requested state component
620 * \param[in] donor_index- index of the donor node to get
621 */
622 inline su2double GetSlidingState(unsigned short val_marker,
623 unsigned long val_vertex,
624 unsigned short val_state,
625 unsigned long donor_index) const final {
626 return SlidingState[val_marker][val_vertex][val_state][donor_index];
627 }
628
629 /*!
630 * \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].
631 * \param[in] val_marker - marker index
632 * \param[in] val_vertex - vertex index
633 */
634 inline void SetSlidingStateStructure(unsigned short val_marker, unsigned long val_vertex) final {
635 int iVar;
636
637 for( iVar = 0; iVar < nVar+1; iVar++){
638 if( SlidingState[val_marker][val_vertex][iVar] != nullptr )
639 delete [] SlidingState[val_marker][val_vertex][iVar];
640 }
641
642 for( iVar = 0; iVar < nVar+1; iVar++)
643 SlidingState[val_marker][val_vertex][iVar] = new su2double[ GetnSlidingStates(val_marker, val_vertex) ];
644 }
645
646 /*!
647 * \brief Set the outer state for fluid interface nodes.
648 * \param[in] val_marker - marker index
649 * \param[in] val_vertex - vertex index
650 * \param[in] val_state - requested state component
651 * \param[in] donor_index - index of the donor node to set
652 * \param[in] component - set value
653 */
654 inline void SetSlidingState(unsigned short val_marker,
655 unsigned long val_vertex,
656 unsigned short val_state,
657 unsigned long donor_index,
658 su2double component) final {
659 SlidingState[val_marker][val_vertex][val_state][donor_index] = component;
660 }
661
662 /*!
663 * \brief Set the number of outer state for fluid interface nodes.
664 * \param[in] val_marker - marker index
665 * \param[in] val_vertex - vertex index
666 * \param[in] value - number of outer states
667 */
668 inline void SetnSlidingStates(unsigned short val_marker,
669 unsigned long val_vertex,
670 int value) final { SlidingStateNodes[val_marker][val_vertex] = value; }
671
672 /*!
673 * \brief Get the number of outer state for fluid interface nodes.
674 * \param[in] val_marker - marker index
675 * \param[in] val_vertex - vertex index
676 */
677 inline int GetnSlidingStates(unsigned short val_marker, unsigned long val_vertex) const final {
678 return SlidingStateNodes[val_marker][val_vertex];
679 }
680
681};
Headers of the CSolver class which is inherited by all of the other solvers.
A templated matrix/vector-like object.
Definition C2DContainer.hpp:374
static void Error(const std::string &ErrorMsg, const std::string &FunctionName)
Definition mpi_structure.cpp:131
Main class for defining the problem; basically this class reads the configuration file,...
Definition CConfig.hpp:64
unsigned short GetnMarker_All(void) const
Get the total number of boundary markers of the local process including send/receive domains.
Definition CConfig.hpp:3183
unsigned short GetMarker_All_KindBC(unsigned short val_marker) const
Get the kind of boundary for each marker.
Definition CConfig.hpp:3556
ENUM_REGIME GetKind_Regime(void) const
Governing equations of the flow (it can be different from the run time equation).
Definition CConfig.hpp:4026
Parent class for defining the geometry of the problem (complete geometry, multigrid agglomerated geom...
Definition CGeometry.hpp:75
CPoint * nodes
Node vector (dual grid information).
Definition CGeometry.hpp:253
CVertex *** vertex
Boundary Vertex vector (dual grid information).
Definition CGeometry.hpp:255
unsigned long * nVertex
Number of vertex for each marker.
Definition CGeometry.hpp:258
Class for defining the numerical methods.
Definition CNumerics.hpp:48
void SetPrimitive(const su2double *val_v_i, const su2double *val_v_j)
Set the value of the primitive variables.
Definition CNumerics.hpp:301
bool GetBoundedScalar() const
Obtain information on bounded scalar problem.
Definition CNumerics.hpp:1864
void SetGridVel(const su2double *val_gridvel_i, const su2double *val_gridvel_j)
Set the velocity of the computational grid.
Definition CNumerics.hpp:987
void SetCoord(const su2double *val_coord_i, const su2double *val_coord_j)
Set coordinates of the points.
Definition CNumerics.hpp:977
void SetScalarVar(const su2double *val_scalarvar_i, const su2double *val_scalarvar_j)
Set the value of the scalar variable.
Definition CNumerics.hpp:370
void SetScalarVarGradient(CMatrixView< const su2double > val_scalarvar_grad_i, CMatrixView< const su2double > val_scalarvar_grad_j)
Set the gradient of the scalar variables.
Definition CNumerics.hpp:390
void SetNormal(const su2double *val_normal)
Set the value of the normal vector to the face between two points.
Definition CNumerics.hpp:1086
virtual void ComputeResidual(su2double *val_residual, CConfig *config)
Compute the numerical residual.
Definition CNumerics.hpp:1543
void SetMassFlux(const su2double val_MassFlux)
SetMassFlux.
Definition CNumerics.hpp:1858
bool GetDomain(unsigned long iPoint) const
For parallel computation, its indicates if a point must be computed or not.
Definition CPoint.hpp:423
su2double GetCoord(unsigned long iPoint, unsigned long iDim) const
Get the coordinates dor the control volume.
Definition CPoint.hpp:158
su2double * GetGridVel(unsigned long iPoint)
Get the value of the grid velocity at the point.
Definition CPoint.hpp:816
Main class for defining a scalar solver.
Definition CScalarSolver.hpp:59
~CScalarSolver() override
Destructor of the class.
Definition CScalarSolver.inl:109
@ OMP_MAX_SIZE
Definition CScalarSolver.hpp:65
void SumEdgeFluxes(const CGeometry *geometry)
Sum the edge fluxes for each cell to populate the residual vector, only used on coarse grids.
Definition CScalarSolver.inl:154
const CPrimitiveIndices< unsigned short > prim_idx
Indices of the primitive flow variables.
Definition CScalarSolver.hpp:78
void BC_Supersonic_Outlet(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) final
Impose the supersonic outlet boundary condition (same as outlet, see BC_Outlet).
Definition CScalarSolver.hpp:504
void SetGhostPrimitives(unsigned long iVertex, const su2double *V)
Write the four flow primitives the flux kernels read into one row of ghostFlowNodes.
Definition CScalarSolver.hpp:293
vector< vector< int > > SlidingStateNodes
Definition CScalarSolver.hpp:81
VariableType * nodes
The highest level in the variable hierarchy this solver can safely use.
Definition CScalarSolver.hpp:112
void SetResidual_DualTime(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iRKStep, unsigned short iMesh, unsigned short RunTime_EqSystem) override
Set the total residual adding the term that comes from the Dual Time-Stepping Strategy.
Definition CScalarSolver.inl:631
void SetnSlidingStates(unsigned short val_marker, unsigned long val_vertex, int value) final
Set the number of outer state for fluid interface nodes.
Definition CScalarSolver.hpp:668
void BoundaryFluxResidual(const CGeometry *geometry, CSolver **solver_container, const CConfig *config, const ScalarFluxOptions &opt, unsigned short val_marker)
Generic boundary flux pass, run after a boundary's fill pass has written the ghost row,...
Definition CScalarSolver.inl:259
void SetSlidingStateStructure(unsigned short val_marker, unsigned long val_vertex) final
Allocates the final pointer of SlidingState depending on how many donor vertex donate to it....
Definition CScalarSolver.hpp:634
su2activematrix ghostNormal
Outward normals, sign flipped from the vertex normals.
Definition CScalarSolver.hpp:105
array< DummyGridColor<>, 1 > EdgeColoring
Definition CScalarSolver.hpp:89
CSysVector< su2double > EdgeFluxes
Flux across each edge.
Definition CScalarSolver.hpp:95
void SetSlidingState(unsigned short val_marker, unsigned long val_vertex, unsigned short val_state, unsigned long donor_index, su2double component) final
Set the outer state for fluid interface nodes.
Definition CScalarSolver.hpp:654
void BC_Sym_Plane(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) override
Impose the Symmetry Plane boundary condition.
Definition CScalarSolver.hpp:458
void SetGhostGeometry(const CGeometry *geometry, unsigned short val_marker, unsigned long iVertex)
Write the outward normal of one vertex into the ghost row and mark the vertex as contributing a flux.
Definition CScalarSolver.hpp:341
@ MAXNDIM
Definition CScalarSolver.hpp:61
su2double Solution_Inf[MAXNVAR]
Far-field solution.
Definition CScalarSolver.hpp:73
unique_ptr< CGhostFlowVariable > ghostFlowNodes
Sized from the flow solver, see the constructor.
Definition CScalarSolver.hpp:104
void EdgeFluxResidual(const CGeometry *geometry, CSolver **solver_container, const CConfig *config, const ScalarFluxOptions &opt)
Generic interior edge loop for a scalar model expressed through the CUpwScalarBase CRTP chain (numeri...
Definition CScalarSolver.inl:176
void BC_Euler_Wall(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) final
Impose via the residual the Euler wall boundary condition.
Definition CScalarSolver.hpp:472
void PushSolutionBackInTime(unsigned long TimeIter, bool restart, CSolver ***solver_container, CGeometry **geometry, CConfig *config)
Move solution to previous time levels (for restarts).
Definition CScalarSolver.inl:870
void BC_Periodic(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, CConfig *config) final
Impose a periodic boundary condition by summing contributions from the complete control volume.
Definition CScalarSolver.inl:389
su2double upperlimit[MAXNVAR]
contains upper limits for scalar variables.
Definition CScalarSolver.hpp:71
void BC_Riemann(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) final
Impose the boundary condition using characteristic recostruction.
Definition CScalarSolver.inl:372
void PrepareImplicitIteration(CGeometry *geometry, CSolver **solver_container, CConfig *config) final
Prepare an implicit iteration.
Definition CScalarSolver.inl:481
const bool Conservative
Transported Variable is conservative. Solution has to be multiplied with rho.
Definition CScalarSolver.hpp:75
void BC_Fluid_Interface_impl(const SolverSpecificNumericsFunc &SolverSpecificNumerics, CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config)
Generic implementation of the fluid interface boundary condition for scalar solvers.
Definition CScalarSolver.hpp:130
void SetFreeStream_Solution(const CConfig *config) final
Set the solution using the Freestream values.
Definition CScalarSolver.hpp:536
su2double BoundedScalarBCFlux(unsigned long iPoint, bool implicit, const su2double &density, const su2double *velocity, const su2double *normal)
Applies a convective flux correction to negate the effects of flow divergence at a BC node.
Definition CScalarSolver.hpp:249
static constexpr size_t MAXNVAR
Max number of variables, for static arrays.
Definition CScalarSolver.hpp:62
su2double lowerlimit[MAXNVAR]
contains lower limits for scalar variables.
Definition CScalarSolver.hpp:70
const bool BoundedScalar
Whether the derived solver uses the bounded-scalar convective scheme.
Definition CScalarSolver.hpp:76
CSysVector< su2double > EdgeFluxesDiff
Flux difference between ij and ji for non-conservative discretisation.
Definition CScalarSolver.hpp:96
void CompleteImplicitIteration(CGeometry *geometry, CSolver **solver_container, CConfig *config) final
Complete an implicit iteration.
Definition CScalarSolver.inl:525
su2vector< uint8_t > ghostSkip
Whether a vertex contributes no flux, set by the fill pass.
Definition CScalarSolver.hpp:107
void CommonPreprocessing(CGeometry *geometry, const CConfig *config, const bool Output)
Gradient and Limiter computation.
Definition CScalarSolver.inl:114
void ExplicitEuler_Iteration(CGeometry *geometry, CSolver **solver_container, CConfig *config) final
Update the solution using the explicit Euler scheme.
Definition CScalarSolver.inl:601
@ OMP_MIN_SIZE
Definition CScalarSolver.hpp:66
int GetnSlidingStates(unsigned short val_marker, unsigned long val_vertex) const final
Get the number of outer state for fluid interface nodes.
Definition CScalarSolver.hpp:677
void SetGhostDiffusionState(const CGeometry *geometry, unsigned long iVertex, unsigned long iPoint, unsigned long jPoint)
Write what the diffusion term of a boundary reads beyond the ghost solution: the coordinate of the in...
Definition CScalarSolver.hpp:354
void FluidInterfaceFluxResidual(const CGeometry *geometry, CSolver **solver_container, const CConfig *config, const ScalarFluxOptions &optConv, const ScalarFluxOptions &optVisc, const GhostFunc &fillGhostExtras)
Generic fluid interface (sliding mesh) flux pass, shared by every model. The convective term is a per...
Definition CScalarSolver.inl:300
void ImplicitEuler_Iteration(CGeometry *geometry, CSolver **solver_container, CConfig *config) override
Update the solution using an implicit solver.
Definition CScalarSolver.inl:574
su2activematrix ghostCoord
Reflected coordinates, read by the diffusion sites.
Definition CScalarSolver.hpp:106
su2double GetSlidingState(unsigned short val_marker, unsigned long val_vertex, unsigned short val_state, unsigned long donor_index) const final
Get the outer state for fluid interface nodes.
Definition CScalarSolver.hpp:622
void BC_Fluid_Interface(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config) override
Impose the fluid interface boundary condition using transfer data.
Definition CScalarSolver.hpp:526
void DispatchScheme(const CConfig *config, F &&f)
Resolve the compile-time parameters of a scalar flux kernel, the flow indices, the dimension and the ...
Definition CScalarSolver.hpp:380
unique_ptr< VariableType > ghostNodes
Allocated by the derived solver, whose VariableType constructor it alone knows how to call.
Definition CScalarSolver.hpp:103
static constexpr bool ReducerStrategy
Definition CScalarSolver.hpp:91
unsigned long omp_chunk_size
Chunk size used in light point loops.
Definition CScalarSolver.hpp:68
vector< su2matrix< su2double * > > SlidingState
Definition CScalarSolver.hpp:80
void BC_Far_Field(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) override
Impose the Far Field boundary condition.
Definition CScalarSolver.inl:405
bool GetHasHybridParallel() const override
Scalar solvers support OpenMP+MPI.
Definition CScalarSolver.hpp:613
void BC_Supersonic_Inlet(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) final
Impose the supersonic inlet boundary condition (same as inlet, see BC_Inlet).
Definition CScalarSolver.hpp:496
void LoadRestart(CGeometry **geometry, CSolver ***solver, CConfig *config, int val_iter, bool val_update_geo) override=0
Load a solution from a restart file.
CVariable * GetBaseClassPointerToNodes() final
Return nodes to allow CSolver::base_nodes to be set.
Definition CScalarSolver.hpp:117
void SetTime_Step(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh, unsigned long Iteration) override
This base implementation simply copies the time step of the flow solver.
Definition CScalarSolver.inl:466
@ MAXNVARFLOW
Definition CScalarSolver.hpp:63
Definition CSolver.hpp:71
CSysMatrix< su2mixedfloat > Jacobian
Complete sparse Jacobian structure for implicit computations.
Definition CSolver.hpp:201
virtual su2double GetSlidingState(unsigned short val_marker, unsigned long val_vertex, unsigned short val_state, unsigned long donor_index) const
Get the outer state for fluid interface nodes.
Definition CSolver.hpp:1365
unsigned short nDim
Number of dimensions of the problem.
Definition CSolver.hpp:90
su2double ** Jacobian_i
Auxiliary matrices for storing point to point Jacobians at point i.
Definition CSolver.hpp:128
unsigned long nPoint
Number of points of the computational grid.
Definition CSolver.hpp:91
unsigned short nVar
Number of variables of the problem.
Definition CSolver.hpp:85
CSysVector< su2double > LinSysRes
vector to store iterative residual of implicit linear system.
Definition CSolver.hpp:200
unsigned short GetnPrimVar(void) const
Get the number of variables of the problem.
Definition CSolver.hpp:421
virtual void BC_Inlet(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker)
A virtual member.
Definition CSolver.hpp:1163
unsigned short nPrimVar
Number of primitive variables of the problem.
Definition CSolver.hpp:86
virtual void BC_Outlet(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker)
A virtual member.
Definition CSolver.hpp:1258
bool dynamic_grid
Flag that determines whether the grid is dynamic (moving or deforming + grid velocities).
Definition CSolver.hpp:153
CVariable * GetNodes()
Allow outside access to the nodes of the solver, containing conservatives, primitives,...
Definition CSolver.hpp:229
void SubtractBlock2Diag(unsigned long block_i, const OtherType &val_block)
Short-hand to AddBlock2Diag with alpha = -1, i.e. subtracts from the current diagonal.
Definition CSysMatrix.hpp:1226
const ScalarType * GetBlock(unsigned long block_i, unsigned long block_j) const
Get a pointer to the start of block "ij".
Definition CSysMatrix.hpp:760
void AddVal2Diag(unsigned long block_i, OtherType val_matrix)
Adds the specified value to the diagonal of the (i, i) subblock of the matrix-by-blocks structure.
Definition CSysMatrix.hpp:1237
Class for holding and manipulating vectors needed by linear solvers.
Definition CSysVector.hpp:195
void SubtractBlock(unsigned long iPoint, const VectorType &block)
Subtract "block" from the vector, see AddBlock.
Definition CSysVector.hpp:639
void AddBlock(unsigned long iPoint, const VectorType &block, ScalarType alpha=1)
Add "block" to the vector, see SetBlock.
Definition CSysVector.hpp:631
Main class for defining the variables.
Definition CVariable.hpp:50
virtual const MatrixType & GetPrimitive() const
Get the primitive variables for all points.
Definition CVariable.hpp:1319
virtual su2double GetDensity(unsigned long iPoint) const
A virtual member.
Definition CVariable.hpp:1009
void GetNormal(su2double *val_normal) const override
Copy the the normal vector of a face.
Definition CVertex.hpp:94
unsigned long GetNode() const
Get the node of the vertex.
Definition CVertex.hpp:70
unsigned long GetNormal_Neighbor() const
Get the value of the closest neighbor.
Definition CVertex.hpp:322
Scalar_t * data() noexcept
Definition C2DContainer.hpp:222
passivedouble su2double
Definition code_config.hpp:181
T DotProduct(Int nDim, const T *a, const T *b)
Definition geometry_toolbox.hpp:65
void PointPointReflect(Int nDim, const T *a, const T *b, T *d)
Reflect a at b: c = 2*b - a.
Definition geometry_toolbox.hpp:59
#define CURRENT_FUNCTION
Definition mpi_structure.hpp:59
passivedouble GetValue(const su2double &data)
Get the (primitive) value of the datatype (needs to be specialized for active types).
Definition datatype_structure.hpp:113
constexpr size_t Dynamic
Equation count of a model whose value is only known at runtime.
Definition util.hpp:152
#define END_SU2_OMP_FOR
Definition omp_structure.hpp:158
#define SU2_OMP_FOR_STAT(CHUNK)
Definition omp_structure.hpp:151
@ INCOMPRESSIBLE
Definition of incompressible solver.
@ V
Menter k-w SST model with vorticity production terms.
@ FLOW_SOL
Position of the mean flow solution in the solver container array.
Definition option_structure.hpp:577
@ FLUID_INTERFACE
Domain interface definition.
Definition option_structure.hpp:1841
LINEAR_SOLVER_MODE
Type of operation for the linear system solver, changes the source of solver options.
Definition option_structure.hpp:3027
@ STANDARD
Operate in standard mode.
Abstract wrapper for the CIndices classes of CEulerVariable, CIncEulerVariable, etc....
Definition CPrimitiveIndices.hpp:45
IndexType Density() const
Definition CPrimitiveIndices.hpp:79
IndexType EddyViscosity() const
Definition CPrimitiveIndices.hpp:83
IndexType LaminarViscosity() const
Definition CPrimitiveIndices.hpp:82
IndexType ThermalConductivity() const
Definition CPrimitiveIndices.hpp:84
IndexType CpTotal() const
Definition CPrimitiveIndices.hpp:85
IndexType Velocity() const
Definition CPrimitiveIndices.hpp:77
Carries a type through a value, so a runtime branch can hand a compile-time type to a generic lambda ...
Definition CScalarSolver.hpp:49
T type
Definition CScalarSolver.hpp:50
Loop invariant flags for a scalar edge flux, built once outside the edge loop so the compiler can uns...
Definition scalar_edge_flux.hpp:55