Skip to content

Commit dfdd5d3

Browse files
authored
Merge branch 'develop' into feature_precond_linsol
2 parents 045fb6f + 6780d05 commit dfdd5d3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+608
-396
lines changed

.github/workflows/code-style.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- name: Checkout
1515
uses: actions/checkout@v5
1616
- name: Setup python
17-
uses: actions/setup-python@v5
17+
uses: actions/setup-python@v6
1818
with:
1919
python-version: '3.10'
2020
check-latest: true

.github/workflows/codeql.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,20 +37,20 @@ jobs:
3737
run: ./meson.py setup build --optimization=1
3838

3939
- name: Initialize CodeQL
40-
uses: github/codeql-action/init@v3
40+
uses: github/codeql-action/init@v4
4141
with:
4242
languages: ${{ matrix.language }}
4343
queries: +security-and-quality
4444

4545
- name: Autobuild
46-
uses: github/codeql-action/autobuild@v3
46+
uses: github/codeql-action/autobuild@v4
4747
if: ${{ matrix.language == 'python' }}
4848

4949
- name: Build cpp
5050
if: ${{ matrix.language == 'cpp' }}
5151
run: ./ninja -C build
5252

5353
- name: Perform CodeQL Analysis
54-
uses: github/codeql-action/analyze@v3
54+
uses: github/codeql-action/analyze@v4
5555
with:
5656
category: "/language:${{ matrix.language }}"

.github/workflows/regression.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
- name: Compress binaries
6666
run: tar -zcvf install_bin.tgz install/*
6767
- name: Upload Binaries
68-
uses: actions/upload-artifact@v4
68+
uses: actions/upload-artifact@v5
6969
with:
7070
name: ${{ matrix.config_set }}
7171
path: install_bin.tgz
@@ -108,7 +108,7 @@ jobs:
108108
- name: Compress binaries
109109
run: tar -zcvf install_bin.tgz install/*
110110
- name: Upload Binaries
111-
uses: actions/upload-artifact@v4
111+
uses: actions/upload-artifact@v5
112112
with:
113113
name: ${{ matrix.config_set }}
114114
path: install_bin.tgz
@@ -146,7 +146,7 @@ jobs:
146146
- name: Compress binaries
147147
run: tar -zcvf install_bin.tgz install/*
148148
- name: Upload Binaries
149-
uses: actions/upload-artifact@v4
149+
uses: actions/upload-artifact@v5
150150
with:
151151
name: ${{ matrix.config_set }}
152152
path: install_bin.tgz
@@ -236,7 +236,7 @@ jobs:
236236
entrypoint: /bin/rm
237237
args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }}
238238
- name: Download All artifacts
239-
uses: actions/download-artifact@v4
239+
uses: actions/download-artifact@v5
240240
- name: Uncompress and Move Binaries
241241
run: |
242242
BIN_FOLDER="$PWD/install/bin"

.github/workflows/release-management.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
zip -r ../${{matrix.os_bin}}.zip bin/*
4545
# Uploads binaries as artifacts (just as a backup)
4646
- name: Upload Binaries
47-
uses: actions/upload-artifact@v4
47+
uses: actions/upload-artifact@v5
4848
with:
4949
name: ${{matrix.os_bin}}
5050
path: ${{matrix.os_bin}}.zip

Common/include/CConfig.hpp

Lines changed: 38 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,8 @@ class CConfig {
431431
bool UseVectorization; /*!< \brief Whether to use vectorized numerics schemes. */
432432
bool NewtonKrylov; /*!< \brief Use a coupled Newton method to solve the flow equations. */
433433
array<unsigned short,3> NK_IntParam{{20, 3, 2}}; /*!< \brief Integer parameters for NK method. */
434-
array<su2double,4> NK_DblParam{{-2.0, 0.1, -3.0, 1e-4}}; /*!< \brief Floating-point parameters for NK method. */
434+
array<su2double,5> NK_DblParam{{-2.0, 0.1, -3.0, 1e-4, 1.0}}; /*!< \brief Floating-point parameters for NK method. */
435+
su2double NK_Relaxation = 1.0;
435436

436437
unsigned short nMGLevels; /*!< \brief Number of multigrid levels (coarse levels). */
437438
unsigned short nCFL; /*!< \brief Number of CFL, one for each multigrid level. */
@@ -507,7 +508,7 @@ class CConfig {
507508
DIFFUSIVITYMODEL Kind_Diffusivity_Model; /*!< \brief Kind of the mass diffusivity Model */
508509
FREESTREAM_OPTION Kind_FreeStreamOption; /*!< \brief Kind of free stream option to choose if initializing with density or temperature */
509510
MAIN_SOLVER Kind_Solver; /*!< \brief Kind of solver: Euler, NS, Continuous adjoint, etc. */
510-
LIMITER Kind_SlopeLimit, /*!< \brief Global slope limiter. */
511+
LIMITER Kind_SlopeLimit, /*!< \brief Slope limiter (for the runtime eq. system). */
511512
Kind_SlopeLimit_Flow, /*!< \brief Slope limiter for flow equations.*/
512513
Kind_SlopeLimit_Turb, /*!< \brief Slope limiter for the turbulence equation.*/
513514
Kind_SlopeLimit_AdjTurb, /*!< \brief Slope limiter for the adjoint turbulent equation.*/
@@ -554,12 +555,12 @@ class CConfig {
554555
Kind_ConvNumScheme_AdjTurb, /*!< \brief Centered or upwind scheme for the adjoint turbulence model. */
555556
Kind_ConvNumScheme_Species, /*!< \brief Centered or upwind scheme for the species model. */
556557
Kind_ConvNumScheme_Template, /*!< \brief Centered or upwind scheme for the level set equation. */
557-
Kind_FEM, /*!< \brief Finite element scheme for the flow equations. */
558+
Kind_FEM, /*!< \brief Finite element scheme for the flow equations (for the runtime eq. system). */
558559
Kind_FEM_Flow, /*!< \brief Finite element scheme for the flow equations. */
559560
Kind_Matrix_Coloring; /*!< \brief Type of matrix coloring for sparse Jacobian computation. */
560561

561562
CENTERED
562-
Kind_Centered, /*!< \brief Centered scheme. */
563+
Kind_Centered, /*!< \brief Centered scheme (for the runtime eq. system). */
563564
Kind_Centered_Flow, /*!< \brief Centered scheme for the flow equations. */
564565
Kind_Centered_AdjFlow, /*!< \brief Centered scheme for the adjoint flow equations. */
565566
Kind_Centered_Turb, /*!< \brief Centered scheme for the turbulence model. */
@@ -576,7 +577,7 @@ class CConfig {
576577
bool Energy_Equation; /*!< \brief Solve the energy equation for incompressible flows. */
577578

578579
UPWIND
579-
Kind_Upwind, /*!< \brief Upwind scheme. */
580+
Kind_Upwind, /*!< \brief Upwind scheme (for the runtime eq. system). */
580581
Kind_Upwind_Flow, /*!< \brief Upwind scheme for the flow equations. */
581582
Kind_Upwind_AdjFlow, /*!< \brief Upwind scheme for the adjoint flow equations. */
582583
Kind_Upwind_Turb, /*!< \brief Upwind scheme for the turbulence model. */
@@ -585,13 +586,19 @@ class CConfig {
585586
Kind_Upwind_Heat, /*!< \brief Upwind scheme for the heat transfer model. */
586587
Kind_Upwind_Template; /*!< \brief Upwind scheme for the template model. */
587588

588-
bool MUSCL, /*!< \brief MUSCL scheme .*/
589+
bool MUSCL, /*!< \brief MUSCL scheme (for the runtime eq. system). */
589590
MUSCL_Flow, /*!< \brief MUSCL scheme for the flow equations.*/
590591
MUSCL_Turb, /*!< \brief MUSCL scheme for the turbulence equations.*/
591592
MUSCL_Heat, /*!< \brief MUSCL scheme for the (fvm) heat equation.*/
592593
MUSCL_AdjFlow, /*!< \brief MUSCL scheme for the adj flow equations.*/
593-
MUSCL_AdjTurb; /*!< \brief MUSCL scheme for the adj turbulence equations.*/
594-
bool MUSCL_Species; /*!< \brief MUSCL scheme for the species equations.*/
594+
MUSCL_AdjTurb, /*!< \brief MUSCL scheme for the adj turbulence equations.*/
595+
MUSCL_Species; /*!< \brief MUSCL scheme for the species equations.*/
596+
su2double MUSCL_Kappa, /*!< \brief Blending coefficient for U-MUSCL scheme (for the runtime eq. system). */
597+
MUSCL_Kappa_Flow, /*!< \brief Blending coefficient for U-MUSCL scheme for the flow equations.*/
598+
MUSCL_Kappa_Turb, /*!< \brief Blending coefficient for U-MUSCL scheme for the turbulence equations.*/
599+
MUSCL_Kappa_Heat, /*!< \brief Blending coefficient for U-MUSCL scheme for the (fvm) heat equation.*/
600+
MUSCL_Kappa_AdjFlow, /*!< \brief Blending coefficient for U-MUSCL scheme for the adj flow equations.*/
601+
MUSCL_Kappa_Species; /*!< \brief Blending coefficient for U-MUSCL scheme for the species equations.*/
595602
bool Use_Accurate_Jacobians; /*!< \brief Use numerically computed Jacobians for AUSM+up(2) and SLAU(2). */
596603
bool Use_Accurate_Turb_Jacobians; /*!< \brief Use numerically computed Jacobians for standard SA turbulence model. */
597604
bool EulerPersson; /*!< \brief Boolean to determine whether this is an Euler simulation with Persson shock capturing. */
@@ -1332,9 +1339,9 @@ class CConfig {
13321339
template <class Tenum, class Tfield>
13331340
void addEnumListOption(const string name, unsigned short& input_size, Tfield*& option_field, const map<string,Tenum>& enum_map);
13341341

1335-
void addDoubleArrayOption(const string& name, const int size, su2double* option_field);
1342+
void addDoubleArrayOption(const string& name, int size, bool allow_fewer, su2double* option_field);
13361343

1337-
void addUShortArrayOption(const string& name, const int size, unsigned short* option_field);
1344+
void addUShortArrayOption(const string& name, int size, bool allow_fewer, unsigned short* option_field);
13381345

13391346
void addDoubleListOption(const string& name, unsigned short & size, su2double * & option_field);
13401347

@@ -2456,11 +2463,12 @@ class CConfig {
24562463
* \param[in] val_kind_upwind - If upwind scheme, kind of upwind scheme (Roe, etc.).
24572464
* \param[in] val_kind_slopelimit - If upwind scheme, kind of slope limit.
24582465
* \param[in] val_muscl - Define if we apply a MUSCL scheme or not.
2466+
* \param[in] val_muscl_kappa - Define the blending coefficient for the MUSCL scheme.
24592467
* \param[in] val_kind_fem - If FEM, what kind of FEM discretization.
24602468
*/
24612469
void SetKind_ConvNumScheme(unsigned short val_kind_convnumscheme, CENTERED val_kind_centered,
24622470
UPWIND val_kind_upwind, LIMITER val_kind_slopelimit,
2463-
bool val_muscl, unsigned short val_kind_fem);
2471+
bool val_muscl, su2double val_muscl_kappa, unsigned short val_kind_fem);
24642472

24652473
/*!
24662474
* \brief Get the value of limiter coefficient.
@@ -4375,12 +4383,22 @@ class CConfig {
43754383
/*!
43764384
* \brief Get Newton-Krylov integer parameters.
43774385
*/
4378-
array<unsigned short,3> GetNewtonKrylovIntParam(void) const { return NK_IntParam; }
4386+
array<unsigned short,3> GetNewtonKrylovIntParam() const { return NK_IntParam; }
43794387

43804388
/*!
43814389
* \brief Get Newton-Krylov floating-point parameters.
43824390
*/
4383-
array<su2double,4> GetNewtonKrylovDblParam(void) const { return NK_DblParam; }
4391+
array<su2double,5> GetNewtonKrylovDblParam() const { return NK_DblParam; }
4392+
4393+
/*!
4394+
* \brief Get the Newton-Krylov relaxation.
4395+
*/
4396+
su2double GetNewtonKrylovRelaxation() const { return NK_Relaxation; }
4397+
4398+
/*!
4399+
* \brief Set the Newton-Krylov relaxation.
4400+
*/
4401+
void SetNewtonKrylovRelaxation(const su2double& relaxation) { NK_Relaxation = relaxation; }
43844402

43854403
/*!
43864404
* \brief Returns the Roe kappa (multipler of the dissipation term).
@@ -4606,54 +4624,30 @@ class CConfig {
46064624

46074625
/*!
46084626
* \brief Get if the upwind scheme used MUSCL or not.
4609-
* \note This is the information that the code will use, the method will
4610-
* change in runtime depending of the specific equation (direct, adjoint,
4611-
* linearized) that is being solved.
46124627
* \return MUSCL scheme.
46134628
*/
46144629
bool GetMUSCL_Flow(void) const { return MUSCL_Flow; }
46154630

46164631
/*!
46174632
* \brief Get if the upwind scheme used MUSCL or not.
4618-
* \note This is the information that the code will use, the method will
4619-
* change in runtime depending of the specific equation (direct, adjoint,
4620-
* linearized) that is being solved.
4621-
* \return MUSCL scheme.
4622-
*/
4623-
bool GetMUSCL_Heat(void) const { return MUSCL_Heat; }
4624-
4625-
/*!
4626-
* \brief Get if the upwind scheme used MUSCL or not.
4627-
* \note This is the information that the code will use, the method will
4628-
* change in runtime depending of the specific equation (direct, adjoint,
4629-
* linearized) that is being solved.
46304633
* \return MUSCL scheme.
46314634
*/
4632-
bool GetMUSCL_Turb(void) const { return MUSCL_Turb; }
4633-
4634-
/*!
4635-
* \brief Get if the upwind scheme used MUSCL or not.
4636-
* \return MUSCL scheme.
4637-
*/
4638-
bool GetMUSCL_Species(void) const { return MUSCL_Species; }
4635+
bool GetMUSCL_AdjFlow(void) const { return MUSCL_AdjFlow; }
46394636

46404637
/*!
4641-
* \brief Get if the upwind scheme used MUSCL or not.
4638+
* \brief Get the blending coefficient for the U-MUSCL scheme.
46424639
* \note This is the information that the code will use, the method will
46434640
* change in runtime depending of the specific equation (direct, adjoint,
46444641
* linearized) that is being solved.
4645-
* \return MUSCL scheme.
4642+
* \return Blending coefficient for the U-MUSCL scheme.
46464643
*/
4647-
bool GetMUSCL_AdjFlow(void) const { return MUSCL_AdjFlow; }
4644+
su2double GetMUSCL_Kappa(void) const { return MUSCL_Kappa; }
46484645

46494646
/*!
4650-
* \brief Get if the upwind scheme used MUSCL or not.
4651-
* \note This is the information that the code will use, the method will
4652-
* change in runtime depending of the specific equation (direct, adjoint,
4653-
* linearized) that is being solved.
4654-
* \return MUSCL scheme.
4647+
* \brief Get the blending coefficient for the MUSCL scheme.
4648+
* \return Blending coefficient for the MUSCL scheme.
46554649
*/
4656-
bool GetMUSCL_AdjTurb(void) const { return MUSCL_AdjTurb; }
4650+
su2double GetMUSCL_Kappa_Flow(void) const { return MUSCL_Kappa_Flow; }
46574651

46584652
/*!
46594653
* \brief Get whether to "Use Accurate Jacobians" for AUSM+up(2) and SLAU(2).

Common/include/option_structure.inl

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -233,18 +233,19 @@ class COptionEnumList final : public COptionBase {
233233

234234
template <class Type>
235235
class COptionArray final : public COptionBase {
236-
string name; // Identifier for the option
237-
const int size; // Number of elements
238-
Type* field; // Reference to the field
236+
string name; // Identifier for the option
237+
const int size; // Number of elements
238+
const bool allow_fewer; // Allow smaller size
239+
Type* field; // Reference to the field
239240

240241
public:
241-
COptionArray(string option_field_name, const int list_size, Type* option_field)
242-
: name(option_field_name), size(list_size), field(option_field) {}
242+
COptionArray(string option_field_name, const int list_size, const bool allow_fewer, Type* option_field)
243+
: name(std::move(option_field_name)), size(list_size), allow_fewer(allow_fewer), field(option_field) {}
243244

244245
string SetValue(const vector<string>& option_value) override {
245246
COptionBase::SetValue(option_value);
246247
// Check that the size is correct
247-
if (option_value.size() != (unsigned long)this->size) {
248+
if ((option_value.size() < size_t(size) && !allow_fewer) || option_value.size() > size_t(size)) {
248249
string newstring;
249250
newstring.append(this->name);
250251
newstring.append(": wrong number of arguments: ");
@@ -258,7 +259,7 @@ class COptionArray final : public COptionBase {
258259
newstring.append(" found");
259260
return newstring;
260261
}
261-
for (int i = 0; i < this->size; i++) {
262+
for (size_t i = 0; i < option_value.size(); i++) {
262263
istringstream is(option_value[i]);
263264
if (!(is >> field[i])) {
264265
return badValue(" array", this->name);

0 commit comments

Comments
 (0)