Documentation 6b54b78464
Loading...
Searching...
No Matches
CSpeciesFlameletSolver.hpp
Go to the documentation of this file.
1/*!
2 * \file CSpeciesFlameletSolver.hpp
3 * \brief Headers of the CSpeciesFlameletSolver class
4 * \author D. Mayer, N. Beishuizen, T. Economon, E. Bunschoten
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
28#pragma once
29
30#include "CSpeciesSolver.hpp"
31
32/*!
33 * \class CSpeciesFlameletSolver
34 * \brief Main class for defining the flamelet model solver.
35 * \author N. Beishuizen
36 * \ingroup Scalar_Transport
37 */
39 private:
40 const su2double default_flame_thickness{1.0};
41 su2double global_flame_thickness;
42 bool calc_flame_thickness{false};
43 FluidFlamelet_ParsedOptions flamelet_config_options;
44 bool include_mixture_fraction = false; /*!< \brief include mixture fraction as a controlling variable. */
45 /*!< \brief Number of points outside the manifold domain, shared across OpenMP threads so it can be
46 * accumulated atomically and reduced by the master thread alone in Preprocessing. */
47 unsigned long n_not_in_domain_local = 0;
48 /*!
49 * \brief Compute the preconditioner for low-Mach flows.
50 * \param[in] geometry - Geometrical definition of the problem.
51 * \param[in] solver_container - Container vector with all the solutions.
52 * \param[in] config - Definition of the particular problem.
53 */
54 void SetPreconditioner(CGeometry* geometry, CSolver** solver_container, CConfig* config);
55
56 /*!
57 * \brief Generic implementation of the isothermal wall also covering CHT cases,
58 * for which the wall temperature is given by GetConjugateHeatVariable.
59 */
60 void BC_Isothermal_Wall_Generic(CGeometry* geometry, CSolver** solver_container, CNumerics* conv_numerics,
61 CNumerics* visc_numerics, CConfig* config, unsigned short val_marker,
62 bool cht_mode = false);
63
64 /*!
65 * \brief Reverse look-up to retrieve enthalpy value based on temperature and other controlling variables.
66 * \param[in] fluid_model - pointer to flamelet fluid model.
67 * \param[in] val_temp - temperature value used for reverse look-up.
68 * \param[in] scalar_solution - local scalar solution.
69 * \param[in] val_enth_out - pointer to output enthalpy variable.
70 * \param[out] Converged - 0 if Newton solver converged, 1 if not.
71 */
72 unsigned long GetEnthFromTemp(CFluidModel* fluid_model, su2double const val_temp, const su2double* scalar_solution,
73 su2double* val_enth_out);
74
75 /*!
76 * \brief Find maximum progress variable value within the manifold for the current solution.
77 * \param[in] fluid_model - pointer to flamelet fluid model.
78 * \param[in] scalars - local scalar solution.
79 * \param[in] T_ignition - ignition temperature - at this temperature, the progress variable is considered burnt.
80 * \return - maximum progress variable value within manifold bounds.
81 */
82 su2double GetBurntProgressVariable(CFluidModel* fluid_model, const su2double* scalars, const su2double T_ignition);
83
84 /*!
85 * \brief Retrieve scalar source terms from manifold.
86 * \param[in] config - definition of particular problem.
87 * \param[in] fluid_model_local - pointer to flamelet fluid model.
88 * \param[in] iPoint - node ID.
89 * \param[in] scalars - local scalar solution.
90 * \param[in] table_source_names - variable names of scalar source terms.
91 * \param[in] F - flame thickness correction factor.
92 * \return - within manifold bounds (0) or outside manifold bounds (1).
93 */
94 unsigned long SetScalarSources(const CConfig* config, CFluidModel* fluid_model_local, unsigned long iPoint,
95 const vector<su2double>& scalars, const su2double F=1.0);
96
97 /*!
98 * \brief Retrieve passive look-up data from manifold.
99 * \param[in] fluid_model_local - pointer to flamelet fluid model.
100 * \param[in] iPoint - node ID.
101 * \param[in] scalars - local scalar solution.
102 * \return - within manifold bounds (0) or outside manifold bounds (1).
103 */
104 unsigned long SetScalarLookUps(CFluidModel* fluid_model_local, unsigned long iPoint,
105 const vector<su2double>& scalars);
106
107 /*!
108 * \brief Retrieve the preferential diffusion scalar values from manifold.
109 * \param[in] fluid_model_local - pointer to flamelet fluid model.
110 * \param[in] iPoint - node ID.
111 * \param[in] scalars - local scalar solution.
112 * \return - within manifold bounds (0) or outside manifold bounds (1).
113 */
114 unsigned long SetPreferentialDiffusionScalars(CFluidModel* fluid_model_local,
115 unsigned long iPoint, const vector<su2double>& scalars);
116
117 /*!
118 * \brief Calculate correction factor for flame propagation on coarse grids.
119 * \param[in] geometry - Geometrical definition of the problem.
120 * \param[in] iPoint - node ID.
121 * \return - flame thickness correction factor.
122 */
123 su2double ThickenedFlameCorrection(const CGeometry* geometry, unsigned long iPoint) const;
124
125 /*!
126 * \brief Approximate the minimum flame thickness value used for the thickened flame model.
127 * \param[in] geometry - Geometrical definition of the problem.
128 * \param[in] solver_container - Container vector with all the solutions.
129 * \return - approximate flame thickness value.
130 */
131 su2double GetOverallFlameThickness(CGeometry* geometry, CSolver** solver_container) const;
132
133 public:
134 /*!
135 * \brief Define a Flamelet Generated Manifold species solver.
136 * \param[in] geometry - Geometrical definition of the problem.
137 * \param[in] config - Definition of the particular problem.
138 * \param[in] iMesh - Index of the mesh in multigrid computations.
139 */
140 CSpeciesFlameletSolver(CGeometry* geometry, CConfig* config, const CSolver* flow_solver, unsigned short iMesh);
141
142 /*!
143 * \brief Restart residual and compute gradients.
144 * \param[in] geometry - Geometrical definition of the problem.
145 * \param[in] solver_container - Container vector with all the solutions.
146 * \param[in] config - Definition of the particular problem.
147 * \param[in] iMesh - Index of the mesh in multigrid computations.
148 * \param[in] iRKStep - Current step of the Runge-Kutta iteration.
149 * \param[in] RunTime_EqSystem - System of equations which is going to be solved.
150 * \param[in] Output - Boolean to determine whether to print output.
151 */
152 void Preprocessing(CGeometry* geometry, CSolver** solver_container, CConfig* config, unsigned short iMesh,
153 unsigned short iRKStep, unsigned short RunTime_EqSystem, bool Output) override;
154
155 /*!
156 * \brief Set the initial condition for the scalar transport problem.
157 * \param[in] geometry - Geometrical definition of the problem.
158 * \param[in] solver_container - Container with all the solutions.
159 * \param[in] config - Definition of the particular problem.
160 * \param[in] ExtIter - External iteration.
161 */
162 void SetInitialCondition(CGeometry** geometry, CSolver*** solver_container, CConfig* config,
163 unsigned long ExtIter) override;
164
165 /*!
166 * \brief Source term computation.
167 * \param[in] geometry - Geometrical definition of the problem.
168 * \param[in] solver_container - Container vector with all the solutions.
169 * \param[in] numerics - Description of the numerical method.
170 * \param[in] config - Definition of the particular problem.
171 * \param[in] iMesh - Index of the mesh in multigrid computations.
172 */
173 void Source_Residual(CGeometry* geometry, CSolver** solver_container, CNumerics** numerics_container, CConfig* config,
174 unsigned short iMesh) override;
175
176 /*!
177 * \brief Impose the Navier-Stokes wall boundary condition.
178 * \param[in] geometry - Geometrical definition of the problem.
179 * \param[in] solver_container - Container vector with all the solutions.
180 * \param[in] conv_numerics - Description of the numerical method.
181 * \param[in] visc_numerics - Description of the numerical method.
182 * \param[in] config - Definition of the particular problem.
183 * \param[in] val_marker - Surface marker where the boundary condition is applied.
184 */
185 void BC_Isothermal_Wall(CGeometry* geometry, CSolver** solver_container, CNumerics* conv_numerics,
186 CNumerics* visc_numerics, CConfig* config, unsigned short val_marker) override;
187
188 /*!
189 * \brief Impose the heat-flux wall boundary condition on the flamelet enthalpy scalar.
190 * When FLAMELET_ENTHALPY_BC= FLOW_MARKERS (default), the heat flux value from MARKER_HEATFLUX
191 * is applied as a Neumann boundary condition on the enthalpy scalar H.
192 * When FLAMELET_ENTHALPY_BC= SPECIES_MARKERS, use flux/value from MARKER_WALL_SPECIES.
193 * \param[in] geometry - Geometrical definition of the problem.
194 * \param[in] solver_container - Container vector with all the solutions.
195 * \param[in] conv_numerics - Description of the numerical method.
196 * \param[in] visc_numerics - Description of the numerical method.
197 * \param[in] config - Definition of the particular problem.
198 * \param[in] val_marker - Surface marker where the boundary condition is applied.
199 */
200 void BC_HeatFlux_Wall(CGeometry* geometry, CSolver** solver_container, CNumerics* conv_numerics,
201 CNumerics* visc_numerics, CConfig* config, unsigned short val_marker) override;
202
203 /*!
204 * \brief Impose the inlet boundary condition.
205 * \param[in] geometry - Geometrical definition of the problem.
206 * \param[in] solver_container - Container vector with all the solutions.
207 * \param[in] conv_numerics - Description of the numerical method.
208 * \param[in] visc_numerics - Description of the numerical method.
209 * \param[in] config - Definition of the particular problem.
210 * \param[in] val_marker - Surface marker where the boundary condition is applied.
211 */
212 void BC_Inlet(CGeometry* geometry, CSolver** solver_container, CNumerics* conv_numerics, CNumerics* visc_numerics,
213 CConfig* config, unsigned short val_marker) override;
214
215 /*!
216 * \brief Impose the (received) conjugate heat variables.
217 * \param[in] geometry - Geometrical definition of the problem.
218 * \param[in] solver_container - Container vector with all the solutions.
219 * \param[in] numerics - Description of the numerical method.
220 * \param[in] config - Definition of the particular problem.
221 * \param[in] val_marker - Surface marker where the boundary condition is applied.
222 */
223 void BC_ConjugateHeat_Interface(CGeometry* geometry, CSolver** solver_container, CNumerics* numerics, CConfig* config,
224 unsigned short val_marker) override;
225
226 /*!
227 * \brief Compute the spatial integration using the CScalarFlux_Flamelet edge kernel, which adds
228 * the preferential diffusion terms to the species convection and diffusion.
229 * \param[in] geometry - Geometrical definition of the problem.
230 * \param[in] solver_container - Container vector with all the solutions.
231 * \param[in] config - Definition of the particular problem.
232 * \param[in] iMesh - Index of the mesh in multigrid computations.
233 */
234 void Upwind_Residual(CGeometry* geometry, CSolver** solver_container, CNumerics** numerics_container,
235 CConfig* config, unsigned short iMesh) final;
236
237 /*!
238 * \brief Obtain the overall flame thickness value.
239 * \return flame thickness value.
240 */
241 su2double GetFlameThickness() const override {return global_flame_thickness;}
242};
Headers of the CSpeciesSolver class.
Main class for defining the problem; basically this class reads the configuration file,...
Definition CConfig.hpp:64
Main class for defining the Thermo-Physical Model.
Definition CFluidModel.hpp:47
Parent class for defining the geometry of the problem (complete geometry, multigrid agglomerated geom...
Definition CGeometry.hpp:75
Class for defining the numerical methods.
Definition CNumerics.hpp:48
Definition CSolver.hpp:71
Main class for defining the flamelet model solver.
Definition CSpeciesFlameletSolver.hpp:38
void BC_Inlet(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) override
Impose the inlet boundary condition.
Definition CSpeciesFlameletSolver.cpp:519
void BC_ConjugateHeat_Interface(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, CConfig *config, unsigned short val_marker) override
Impose the (received) conjugate heat variables.
Definition CSpeciesFlameletSolver.cpp:651
su2double GetFlameThickness() const override
Obtain the overall flame thickness value.
Definition CSpeciesFlameletSolver.hpp:241
void BC_HeatFlux_Wall(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) override
Impose the heat-flux wall boundary condition on the flamelet enthalpy scalar. When FLAMELET_ENTHALPY_...
Definition CSpeciesFlameletSolver.cpp:478
void BC_Isothermal_Wall(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) override
Impose the Navier-Stokes wall boundary condition.
Definition CSpeciesFlameletSolver.cpp:633
void Source_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics **numerics_container, CConfig *config, unsigned short iMesh) override
Source term computation.
Definition CSpeciesFlameletSolver.cpp:443
void Upwind_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics **numerics_container, CConfig *config, unsigned short iMesh) final
Compute the spatial integration using the CScalarFlux_Flamelet edge kernel, which adds the preferenti...
Definition CSpeciesFlameletSolver.cpp:723
void SetInitialCondition(CGeometry **geometry, CSolver ***solver_container, CConfig *config, unsigned long ExtIter) override
Set the initial condition for the scalar transport problem.
Definition CSpeciesFlameletSolver.cpp:209
void Preprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh, unsigned short iRKStep, unsigned short RunTime_EqSystem, bool Output) override
Restart residual and compute gradients.
Definition CSpeciesFlameletSolver.cpp:80
Main class for defining the species transport solver.
Definition CSpeciesSolver.hpp:39
passivedouble su2double
Definition code_config.hpp:181
Structure containing parsed options for flamelet fluid model.
Definition option_structure.hpp:1584