Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
93d8408
Flamelet: controlling variable roles from their names
bigfooted Oct 31, 2026
a7b87cf
Flamelet: transport of progress variable and mixture fraction variance
bigfooted Oct 31, 2026
f68c403
Flamelet: bound the scalar variances, density factor in the auxiliary…
bigfooted Nov 2, 2026
749a9c3
Flamelet: normalized variance in the manifold, combined variance sour…
bigfooted Nov 2, 2026
35813bf
Merge branch 'develop' into feature_flamelet_assumed_shape
bigfooted Nov 2, 2026
d88647f
Couple passive periodic points to their masters in the implicit system
bigfooted Nov 15, 2026
8548a03
Large wall distance instead of zero when there are no viscous walls
bigfooted Nov 14, 2026
8bd6c74
Implicit progress variable source Jacobian for flamelet solver
bigfooted Nov 19, 2026
b1387fa
Update flamelet regression values for the implicit PV source Jacobian
bigfooted Nov 19, 2026
3b900fb
Merge branch 'develop' into fix_periodic_jacobian
bigfooted Nov 21, 2026
899ab14
update monitor for unsteady plotting
bigfooted Nov 21, 2026
479c107
Couple only fully fitting periodic points; fix quantized accumulation
bigfooted Nov 21, 2026
11efe51
Update the transonic_stator discrete adjoint values
bigfooted Nov 21, 2026
d0a897a
Run the regression tests on the TestCases develop branch
bigfooted Nov 21, 2026
eae8575
Flamelet: option to read the chemical variance source from the manifold
bigfooted Nov 23, 2026
bba15c0
Flamelet: implicit treatment of the chemical sink of a scalar variance
bigfooted Nov 23, 2026
8741253
Simplify the periodic Jacobian coupling
bigfooted Nov 25, 2026
1eb9c59
Address review: passive Jacobian blocks, loop names, nPoint
bigfooted Nov 25, 2026
712436e
Merge branch 'develop' into fix_periodic_jacobian
bigfooted Nov 25, 2026
24c8fbc
Flamelet LUT: extrapolate linearly beyond the outer table levels
bigfooted Nov 26, 2026
9cace00
Flamelet: block Jacobian of the preferential diffusion terms
bigfooted Nov 26, 2026
c8e246d
Flamelet: keep the burnt state of the flame front initialization insi…
bigfooted Nov 26, 2026
5cbf7a2
Merge branch 'develop' into fix_unsteady_flamelet
EvertBunschoten Nov 26, 2026
140bb03
Flamelet table range, reduced and implicit PV sources, local time ste…
bigfooted Nov 26, 2026
11eab1d
Flamelet: always treat a decreasing progress variable source implicitly
bigfooted Nov 26, 2026
17e47b2
Flamelet: preferential diffusion from the excess over unity Lewis num…
bigfooted Nov 26, 2026
882c7b2
Merge branch 'develop' into fix_periodic_jacobian
bigfooted Nov 27, 2026
b2cd7c9
Move the progress variable source Jacobian into CFluidFlamelet
bigfooted Nov 27, 2026
f09b174
Build the periodic coupling table once
bigfooted Nov 27, 2026
86f9c48
Record the periodic volume when recording the mesh coordinates
bigfooted Nov 27, 2026
e916946
Merge remote-tracking branch 'origin/fix_periodic_jacobian' into fix_…
bigfooted Nov 27, 2026
99fff93
Merge remote-tracking branch 'origin/fix_unsteady_flamelet' into fix_…
bigfooted Nov 28, 2026
cf9ced6
Add a discrete-adjoint regression test for the Morse swirling jet
bigfooted Nov 28, 2026
30ce565
Flamelet: move the progress variable source Jacobian into CFluidFlamelet
bigfooted Nov 28, 2026
41173a6
Flamelet: stop the burnt progress variable march at the table maximum
bigfooted Nov 28, 2026
f0c3e8f
Merge remote-tracking branch 'origin/develop' into fix_periodic_jacobian
bigfooted Nov 28, 2026
51bdfbf
Show the residual on passive periodic points
bigfooted Nov 28, 2026
c39fe94
Merge branch 'develop' into fix_periodic_jacobian
bigfooted Nov 28, 2026
ac6529d
Fix forward-mode AD build of quantized block accumulation
bigfooted Nov 29, 2026
6c4114c
Merge branch 'develop' into feature_flamelet_assumed_shape
bigfooted Nov 29, 2026
6f49596
Merge branch 'develop' into fix_periodic_jacobian
bigfooted Nov 29, 2026
6dabf0c
Merge branch 'develop' into fix_unsteady_flamelet
bigfooted Nov 29, 2026
3866f4e
Fix forward-mode AD build of the periodic Jacobian coupling
bigfooted Nov 29, 2026
0a03542
Update regression values after merging develop
bigfooted Nov 29, 2026
0e34254
Apply black formatting to the monitor script and its tests
bigfooted Nov 29, 2026
2fdac90
Flamelet LUT: extrapolate linearly beyond the outer table levels
bigfooted Nov 26, 2026
9f36808
Flamelet: block Jacobian of the preferential diffusion terms
bigfooted Nov 26, 2026
c91ac9b
Flamelet: keep the burnt state of the flame front initialization insi…
bigfooted Nov 26, 2026
2215935
Update flamelet regression values for the preferential diffusion Jaco…
bigfooted Nov 29, 2026
f6caf6e
Flamelet: table-range fixes, cached progress variable bounds, zero-va…
bigfooted Nov 29, 2026
07285b2
Merge branch 'fix_unsteady_flamelet' into feature_flamelet_assumed_shape
bigfooted Nov 29, 2026
24128c6
Merge branch 'fix_periodic_jacobian' into feature_flamelet_assumed_shape
bigfooted Nov 29, 2026
ff86d5d
Fix the reverse mode AD build of the scalar time step and the varianc…
bigfooted Nov 29, 2026
c23943b
Update flamelet regression values after the table-range and preferent…
bigfooted Nov 29, 2026
40e048d
Merge remote-tracking branch 'origin/develop' into feature_flamelet_a…
bigfooted Dec 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Common/include/CConfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,7 @@ class CConfig {
CFLRedCoeff_AdjFlow, /*!< \brief CFL reduction coefficient for the adjoint problem. */
CFLRedCoeff_AdjTurb, /*!< \brief CFL reduction coefficient for the adjoint turbulent problem. */
CFLRedCoeff_Species, /*!< \brief CFL reduction coefficient on the species problem. */
Scalar_TimeStep_Ratio, /*!< \brief Maximum ratio of the scalar to the flow time step. */
CFLFineGrid, /*!< \brief CFL of the finest grid. */
Max_DeltaTime, /*!< \brief Max delta time. */
Unst_CFL; /*!< \brief Unsteady CFL number. */
Expand Down Expand Up @@ -895,6 +896,7 @@ class CConfig {
su2double Gamma, /*!< \brief Ratio of specific heats of the gas. */
Bulk_Modulus, /*!< \brief Value of the bulk modulus for incompressible flows. */
Beta_Factor, /*!< \brief Value of the epsilon^2 multiplier for Beta for the incompressible preconditioner. */
Beta_Local_Floor, /*!< \brief Lower bound of the local velocity^2 in Beta, as a fraction of the domain maximum. */
Gas_Constant, /*!< \brief Specific gas constant. */
Gas_ConstantND, /*!< \brief Non-dimensional specific gas constant. */
*Molecular_Weight; /*!< \brief Molecular weight of an incompressible ideal gas (g/mol). */
Expand Down Expand Up @@ -1780,6 +1782,12 @@ class CConfig {
*/
su2double GetBeta_Factor(void) const { return Beta_Factor; }

/*!
* \brief Lower bound of the local velocity^2 in the incompressible preconditioner, as a fraction of the maximum.
* \return 1 gives a uniform Beta from the maximum velocity in the domain.
*/
su2double GetBeta_Local_Floor(void) const { return Beta_Local_Floor; }

/*!
* \brief Get the value of specific gas constant.
* \return Value of the constant: Gamma
Expand Down Expand Up @@ -7456,6 +7464,12 @@ class CConfig {
*/
su2double GetCFLRedCoeff_Species() const { return CFLRedCoeff_Species; }

/*!
* \brief Maximum ratio of the scalar to the flow time step.
* \return 1 to use the flow time step, larger values to use the local scalar time step up to this ratio.
*/
su2double GetScalar_TimeStep_Ratio() const { return Scalar_TimeStep_Ratio; }

/*!
* \brief Get the flow direction unit vector at an inlet boundary.
* \param[in] val_index - Index corresponding to the inlet boundary.
Expand Down
42 changes: 42 additions & 0 deletions Common/include/containers/CLookUpTable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ class CLookUpTable {
*/
su2vector<su2vector<unsigned long>> hull;

/*! \brief Values of the second controlling variable at which the boundary of each table level has a vertex. */
su2vector<std::vector<su2double>> range_CV2;

/*! \brief First controlling variable on the lower and upper boundary at both ends of each range_CV2 interval. */
su2vector<std::vector<std::array<su2double, 4>>> range_CV1;

/*! \brief
* Trapezoidal map objects for the table levels.
*/
Expand Down Expand Up @@ -143,6 +149,19 @@ class CLookUpTable {
*/
void IdentifyUniqueEdges();

/*!
* \brief Tabulate the range of the first controlling variable covered by each table level, from its boundary edges.
* \note The range at a value of the second controlling variable spans the outermost boundary edges, so a level
* is assumed to cover a single interval there, without holes or notches.
*/
void ComputeRangeCV1();

/*!
* \brief Range of the first controlling variable covered by a table level at a value of the second.
* \returns false if the level has no extent in the second controlling variable.
*/
bool GetRangeCV1OnLevel(su2double val_CV2, unsigned long i_level, su2double& val_min, su2double& val_max) const;

/*!
* \brief Read the lookup table from file and store the data.
* \param[in] file_name_lut - the filename of the lookup table.
Expand Down Expand Up @@ -272,6 +291,15 @@ class CLookUpTable {
const su2double val_CV1, const su2double val_CV2,
const su2double val_CV3);

/*!
* \brief Interpolate linearly in the third controlling variable between two table levels, or extrapolate
* when val_CV3 lies outside them.
* \returns whether the query point lies inside the data on both levels.
*/
bool InterpolateBetweenLevels(const std::vector<unsigned long>& idx_var, std::vector<su2double>& val_vars,
const su2double val_CV1, const su2double val_CV2, const su2double val_CV3,
std::pair<unsigned long, unsigned long> levels);

/*!
* \brief Find the triangle within which the query point (val_CV1, val_CV2) is located.
* \param[in] val_CV1 - First controlling variable value.
Expand All @@ -296,6 +324,13 @@ class CLookUpTable {
public:
CLookUpTable(const std::string& file_name_lut, std::string name_CV1_in, std::string name_CV2_in);

/*!
* \brief Range of the first controlling variable inside the table at the given second and third controlling variable.
* \note For a 3D table, the range is common to both table levels the lookup interpolates between.
* \returns false if a level has no extent in the second controlling variable.
*/
bool GetRangeCV1(su2double val_CV2, su2double val_CV3, su2double& val_min, su2double& val_max);

/*!
* \brief Print information to screen.
*/
Expand Down Expand Up @@ -386,6 +421,13 @@ class CLookUpTable {
return limits_table_x[i_level];
}

/*!
* \brief Range of a controlling variable over all table levels.
* \param[in] i_cv - 0 and 1 for the axes of the levels, 2 for the variable of the levels.
* \returns Pair of minimum and maximum value.
*/
std::pair<su2double, su2double> GetRangeCV(unsigned short i_cv) const;

/*!
* \brief Check whether requested set of variables are included in the table.
*/
Expand Down
32 changes: 25 additions & 7 deletions Common/include/option_structure.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1525,14 +1525,23 @@ static const MapType<std::string, SPECIES_MODEL> Species_Model_Map = {
};

/*!
* \brief Progress variable and enthalpy are the first and second entries in the lookup table.
* \note The order matters.
* \brief Names of the flamelet controlling variables in CONTROLLING_VARIABLE_NAMES; the name sets the role.
*/
namespace FLAMELET_CV_NAME {
constexpr const char* PROGVAR = "ProgressVariable";
constexpr const char* ENTHALPY = "EnthalpyTot";
constexpr const char* MIXFRAC = "MixtureFraction";
constexpr const char* PROGVAR_VAR = "ProgressVariableVariance";
constexpr const char* MIXFRAC_VAR = "MixtureFractionVariance";
}

/*!
* \brief Manifold variables giving the range of the progress variable, the support of its PDF.
*/
enum FLAMELET_SCALAR_VARIABLES {
I_PROGVAR,
I_ENTH,
I_MIXFRAC,
};
namespace FLAMELET_PROGVAR_BOUNDS {
constexpr const char* MIN = "ProgressVariableMin";
constexpr const char* MAX = "ProgressVariableMax";
}

/*!
* \brief the source terms for the flamelet method. At the moment only progress variable
Expand All @@ -1549,6 +1558,7 @@ enum FLAMELET_LOOKUP_OPS {
PREFDIF, /*!< \brief Preferential diffusion scalars. */
SOURCES, /*!< \brief Scalar source terms (controlling variables, passive species).*/
LOOKUP, /*!< \brief Passive look-up variables specified in config. */
PROGVAR_BOUNDS, /*!< \brief Minimum and maximum of the progress variable. */
};

/*!
Expand Down Expand Up @@ -1607,6 +1617,13 @@ struct FluidFlamelet_ParsedOptions {
unsigned short n_user_scalars = 0; /*!< \brief Number of user defined (auxiliary) scalar transport equations. */
unsigned short n_user_sources = 0; /*!< \brief Number of source terms for user defined (auxiliary) scalar transport equations. */
unsigned short n_control_vars = 0; /*!< \brief Number of controlling variables (independent variables) for the LUT. */
int idx_progvar = -1; /*!< \brief Scalar index of the progress variable, -1 if absent. */
int idx_enth = -1; /*!< \brief Scalar index of the total enthalpy. */
int idx_mixfrac = -1; /*!< \brief Scalar index of the mixture fraction, -1 if absent. */
int idx_progvar_var = -1; /*!< \brief Scalar index of the progress variable variance, -1 if absent. */
int idx_mixfrac_var = -1; /*!< \brief Scalar index of the mixture fraction variance, -1 if absent. */
su2double variance_dissipation_coeff = 2.0; /*!< \brief C_d in the variance dissipation C_d rho (eps/k) var. */
bool tabulated_variance_source = false; /*!< \brief The variance source column holds the chemical variance source itself. */

std::string *controlling_variable_names; /*!< \brief Names of the independent, transported scalars. */
std::string* cv_source_names; /*!< \brief Names of the source terms of the independent, transported scalars. */
Expand All @@ -1621,6 +1638,7 @@ struct FluidFlamelet_ParsedOptions {
su2double* spark_reaction_rates; /*!< \brief Source terms for flamelet spark ignition option. */
unsigned short nspark; /*!< \brief Number of source terms for spark initialization. */
bool preferential_diffusion = false; /*!< \brief Preferential diffusion physics for flamelet solver.*/
bool preferential_diffusion_excess = false; /*!< \brief The manifold holds the excess of beta over unity Lewis numbers. */
bool thickenedflame_correction{true}; /*!< \brief Thickened flame correction. */
su2double Flame_T_ignition = 5000; /*!< \brief Ignition temperature for the flame, used for initialization. */

Expand Down
64 changes: 64 additions & 0 deletions Common/src/CConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1452,6 +1452,8 @@ void CConfig::SetConfig_Options() {
addDoubleOption("BULK_MODULUS", Bulk_Modulus, 1.42E5);
/* DESCRIPTION: Epsilon^2 multipier in Beta calculation for incompressible preconditioner. */
addDoubleOption("BETA_FACTOR", Beta_Factor, 4.1);
/*!\brief BETA_LOCAL_FLOOR \n DESCRIPTION: Lower bound of the local velocity^2 in Beta, as a fraction of the maximum velocity^2. 1 gives a uniform Beta. \ingroup Config*/
addDoubleOption("BETA_LOCAL_FLOOR", Beta_Local_Floor, 1.0);
/*!\brief MACH_NUMBER \n DESCRIPTION: Mach number (non-dimensional, based on the free-stream values). 0.0 by default \ingroup Config*/
addDoubleOption("MACH_NUMBER", Mach, 0.0);
/*!\brief INIT_OPTION \n DESCRIPTION: Init option to choose between Reynolds or thermodynamics quantities for initializing the solution \n OPTIONS: see \link InitOption_Map \endlink \n DEFAULT REYNOLDS \ingroup Config*/
Expand Down Expand Up @@ -1534,6 +1536,11 @@ void CConfig::SetConfig_Options() {
/*!\brief FLAME_INIT_IGNITION \n DESCRIPTION: Ignition temperature for the flame initialization \ingroup Config*/
addDoubleOption("FLAME_INIT_IGNITION", flamelet_ParsedOptions.Flame_T_ignition, 5000.0);

/*!\brief FLAMELET_VARIANCE_DISSIPATION_COEFF \n DESCRIPTION: Coefficient C_d of the scalar variance dissipation C_d rho (eps/k) var \ingroup Config*/
addDoubleOption("FLAMELET_VARIANCE_DISSIPATION_COEFF", flamelet_ParsedOptions.variance_dissipation_coeff, 2.0);
/*!\brief FLAMELET_TABULATED_VARIANCE_SOURCE \n DESCRIPTION: The variance source column of the manifold is the chemical variance source 2 (mean(phi S) - mean(phi) mean(S)) instead of mean(phi S) \ingroup Config*/
addBoolOption("FLAMELET_TABULATED_VARIANCE_SOURCE", flamelet_ParsedOptions.tabulated_variance_source, false);

/*--- Options related to mass diffusivity and thereby the species solver. ---*/

/*!\brief DIFFUSIVITY_MODEL\n DESCRIPTION: mass diffusivity model \n DEFAULT constant disffusivity \ingroup Config*/
Expand Down Expand Up @@ -1956,6 +1963,9 @@ void CConfig::SetConfig_Options() {
addDoubleOption("CFL_REDUCTION_ADJTURB", CFLRedCoeff_AdjTurb, 1.0);
/*!\brief CFL_REDUCTION_SPECIES \n DESCRIPTION: Reduction factor of the CFL coefficient in the species problem \n DEFAULT: 1.0 */
addDoubleOption("CFL_REDUCTION_SPECIES", CFLRedCoeff_Species, 1.0);
/*!\brief SCALAR_TIME_STEP_RATIO \n DESCRIPTION: Maximum ratio of the scalar to the flow time step. Above 1, scalars use their local convective
* and diffusive time step, capped at this ratio times the flow time step. \n DEFAULT: 1.0 */
addDoubleOption("SCALAR_TIME_STEP_RATIO", Scalar_TimeStep_Ratio, 1.0);
/* DESCRIPTION: External iteration offset due to restart */
addUnsignedLongOption("EXT_ITER_OFFSET", ExtIter_OffSet, 0);
// these options share nRKStep as their size, which is not a good idea in general
Expand Down Expand Up @@ -2421,6 +2431,9 @@ void CConfig::SetConfig_Options() {

/* DESCRIPTION: Enable preferential diffusion for FGM simulations. \n DEFAULT: false */
addBoolOption("PREFERENTIAL_DIFFUSION", flamelet_ParsedOptions.preferential_diffusion, false);
/* DESCRIPTION: Preferential diffusion from the *_Excess manifold columns, beta minus its value at unity Lewis numbers,
* added to the ordinary diffusion. \n DEFAULT: false */
addBoolOption("PREFERENTIAL_DIFFUSION_EXCESS", flamelet_ParsedOptions.preferential_diffusion_excess, false);

/*!\brief CONV_FILENAME \n DESCRIPTION: Output file convergence history (w/o extension) \n DEFAULT: history \ingroup Config*/
addStringOption("CONV_FILENAME", Conv_FileName, string("history"));
Expand Down Expand Up @@ -6285,6 +6298,57 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i
/*--- We can have additional user defined transported scalars ---*/
flamelet_ParsedOptions.n_scalars = flamelet_ParsedOptions.n_control_vars + flamelet_ParsedOptions.n_user_scalars;

/*--- The name of each controlling variable sets its role. ---*/
auto& opts = flamelet_ParsedOptions;
for (int iCV = 0; iCV < opts.n_control_vars; iCV++) {
const string& name = opts.controlling_variable_names[iCV];
int* idx = nullptr;
if (name == FLAMELET_CV_NAME::PROGVAR) idx = &opts.idx_progvar;
else if (name == FLAMELET_CV_NAME::ENTHALPY) idx = &opts.idx_enth;
else if (name == FLAMELET_CV_NAME::MIXFRAC) idx = &opts.idx_mixfrac;
else if (name == FLAMELET_CV_NAME::PROGVAR_VAR) idx = &opts.idx_progvar_var;
else if (name == FLAMELET_CV_NAME::MIXFRAC_VAR) idx = &opts.idx_mixfrac_var;
else
SU2_MPI::Error("Unknown controlling variable " + name + ", expected " + FLAMELET_CV_NAME::PROGVAR + ", " +
FLAMELET_CV_NAME::ENTHALPY + ", " + FLAMELET_CV_NAME::MIXFRAC + ", " +
FLAMELET_CV_NAME::PROGVAR_VAR + " or " + FLAMELET_CV_NAME::MIXFRAC_VAR + ".",
CURRENT_FUNCTION);
if (*idx >= 0)
SU2_MPI::Error("Controlling variable " + name + " is listed twice.",
CURRENT_FUNCTION);
*idx = iCV;
}
if (opts.idx_enth < 0)
SU2_MPI::Error(string("CONTROLLING_VARIABLE_NAMES must include ") + FLAMELET_CV_NAME::ENTHALPY + ".",
CURRENT_FUNCTION);
if (opts.idx_progvar < 0 && opts.idx_mixfrac < 0)
SU2_MPI::Error(string("CONTROLLING_VARIABLE_NAMES must include ") + FLAMELET_CV_NAME::PROGVAR + " or " +
FLAMELET_CV_NAME::MIXFRAC + ".", CURRENT_FUNCTION);

/*--- The thickened flame correction is off where it does not apply, and an error where it was asked for. ---*/
auto disable_thickened_flame = [&](const string& reason) {
if (OptionIsSet("THICKENED_FLAME_CORRECTION") && opts.thickenedflame_correction)
SU2_MPI::Error("THICKENED_FLAME_CORRECTION= YES is not available " + reason + ".", CURRENT_FUNCTION);
opts.thickenedflame_correction = false;
};
if (opts.idx_progvar < 0)
disable_thickened_flame(string("without ") + FLAMELET_CV_NAME::PROGVAR);

/*--- A variance needs its mean and the turbulence time scale omega of the SST model. ---*/
if ((opts.idx_progvar_var >= 0) && (opts.idx_progvar < 0))
SU2_MPI::Error(string(FLAMELET_CV_NAME::PROGVAR_VAR) + " requires " + FLAMELET_CV_NAME::PROGVAR + ".",
CURRENT_FUNCTION);
if ((opts.idx_mixfrac_var >= 0) && (opts.idx_mixfrac < 0))
SU2_MPI::Error(string(FLAMELET_CV_NAME::MIXFRAC_VAR) + " requires " + FLAMELET_CV_NAME::MIXFRAC + ".",
CURRENT_FUNCTION);
if ((opts.idx_progvar_var >= 0) || (opts.idx_mixfrac_var >= 0)) {
if (Kind_Turb_Model != TURB_MODEL::SST)
SU2_MPI::Error("Scalar variance transport requires KIND_TURB_MODEL= SST.", CURRENT_FUNCTION);
if (opts.preferential_diffusion)
SU2_MPI::Error("PREFERENTIAL_DIFFUSION is not available with scalar variance transport.", CURRENT_FUNCTION);
disable_thickened_flame("with scalar variance transport");
}

/*--- Check that spark ignition has required parameters defined ---*/
if (flamelet_ParsedOptions.ignition_method == FLAMELET_INIT_TYPE::SPARK) {
/*--- Check if SPARK_INIT was explicitly set in config file ---*/
Expand Down
Loading
Loading