Skip to content

Commit 5282d62

Browse files
authored
Merge branch 'develop' into feature_SST_RoughBCs
2 parents 36055fe + bf255b7 commit 5282d62

124 files changed

Lines changed: 2898 additions & 762 deletions

File tree

Some content is hidden

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

.github/workflows/regression.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ jobs:
127127
- config_set: BaseNoMPI-asan
128128
flags: '--buildtype=debugoptimized -Denable-openblas=true -Dwith-mpi=disabled -Denable-mlpcpp=true --warnlevel=3 --werror'
129129
- config_set: ReverseNoMPI-asan
130-
flags: '--buildtype=debugoptimized -Denable-autodiff=true -Denable-normal=false -Dwith-mpi=disabled --warnlevel=3 --werror'
130+
flags: '--buildtype=debugoptimized --optimization=1 -Denable-autodiff=true -Denable-normal=false -Dwith-mpi=disabled --warnlevel=3 --werror'
131131
runs-on: ${{ inputs.runner || 'ubuntu-latest' }}
132132
steps:
133133
- name: Cache Object Files

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,6 @@
3030
[submodule "externals/FADO"]
3131
path = externals/FADO
3232
url = https://github.com/pcarruscag/FADO.git
33+
[submodule "externals/eigen"]
34+
path = externals/eigen
35+
url = https://gitlab.com/libeigen/eigen.git

AUTHORS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ Eduardo Molina
7171
Edwin van der Weide
7272
Eitan Aberman
7373
Ethan Alan Hereth
74+
Ezgi Orbay Akcengiz
7475
Florian Dittmann
7576
Filip Hahs
7677
Francesco Poli

Common/include/CConfig.hpp

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,8 @@ class CConfig {
199199
nMarker_Inlet, /*!< \brief Number of inlet flow markers. */
200200
nMarker_Inlet_Species, /*!< \brief Number of inlet species markers. */
201201
nSpecies_per_Inlet, /*!< \brief Number of species defined per inlet markers. */
202+
nMarker_Wall_Species, /*!< \brief Number of wall species markers. */
203+
nSpecies_per_Wall, /*!< \brief Number of species defined per wall markers. */
202204
nMarker_Inlet_Turb, /*!< \brief Number of inlet turbulent markers. */
203205
nTurb_Properties, /*!< \brief Number of turbulent properties per inlet markers. */
204206
nMarker_Riemann, /*!< \brief Number of Riemann flow markers. */
@@ -255,6 +257,7 @@ class CConfig {
255257
*Marker_ActDiskBemOutlet_Axis, /*!< \brief Actuator disk BEM outlet markers passed to MARKER_ACTDISK_BEM_AXIS. */
256258
*Marker_Inlet, /*!< \brief Inlet flow markers. */
257259
*Marker_Inlet_Species, /*!< \brief Inlet species markers. */
260+
*Marker_Wall_Species, /*!< \brief Wall species markers. */
258261
*Marker_Inlet_Turb, /*!< \brief Inlet turbulent markers. */
259262
*Marker_Riemann, /*!< \brief Riemann markers. */
260263
*Marker_Giles, /*!< \brief Giles markers. */
@@ -294,6 +297,8 @@ class CConfig {
294297
su2double **Inlet_Velocity; /*!< \brief Specified flow velocity vectors for supersonic inlet boundaries. */
295298
su2double **Inlet_SpeciesVal; /*!< \brief Specified species vector for inlet boundaries. */
296299
su2double **Inlet_TurbVal; /*!< \brief Specified turbulent intensity and viscosity ratio for inlet boundaries. */
300+
WALL_SPECIES_TYPE **Kind_Wall_Species; /*!< \brief Species boundary condition type for wall boundaries (FLUX or VALUE) per species. */
301+
su2double **Wall_SpeciesVal; /*!< \brief Specified species flux or value for wall boundaries per species. */
297302
su2double *EngineInflow_Target; /*!< \brief Specified fan face targets for nacelle boundaries. */
298303
su2double *Inflow_Mach; /*!< \brief Specified fan face mach for nacelle boundaries. */
299304
su2double *Inflow_Pressure; /*!< \brief Specified fan face pressure for nacelle boundaries. */
@@ -430,7 +435,7 @@ class CConfig {
430435
unsigned short nQuasiNewtonSamples; /*!< \brief Number of samples used in quasi-Newton solution methods. */
431436
bool UseVectorization; /*!< \brief Whether to use vectorized numerics schemes. */
432437
bool NewtonKrylov; /*!< \brief Use a coupled Newton method to solve the flow equations. */
433-
array<unsigned short,3> NK_IntParam{{20, 3, 2}}; /*!< \brief Integer parameters for NK method. */
438+
array<unsigned short,4> NK_IntParam{{20, 3, 2, 0}}; /*!< \brief Integer parameters for NK method. */
434439
array<su2double,5> NK_DblParam{{-2.0, 0.1, -3.0, 1e-4, 1.0}}; /*!< \brief Floating-point parameters for NK method. */
435440
su2double NK_Relaxation = 1.0;
436441

@@ -515,6 +520,7 @@ class CConfig {
515520
Kind_SlopeLimit_AdjFlow, /*!< \brief Slope limiter for the adjoint equation.*/
516521
Kind_SlopeLimit_Heat, /*!< \brief Slope limiter for the adjoint equation.*/
517522
Kind_SlopeLimit_Species; /*!< \brief Slope limiter for the species equation.*/
523+
LINEAR_SOLVER_INNER Kind_Linear_Solver_Inner; /*!< \brief Inner solver used in nested Krylov schemes. */
518524
unsigned short Kind_FluidModel, /*!< \brief Kind of the Fluid Model: Ideal, van der Waals, etc. */
519525
Kind_InitOption, /*!< \brief Kind of Init option to choose if initializing with Reynolds number or with thermodynamic conditions */
520526
Kind_GridMovement, /*!< \brief Kind of the static mesh movement. */
@@ -641,6 +647,7 @@ class CConfig {
641647
unsigned long Linear_Solver_Iter; /*!< \brief Max iterations of the linear solver for the implicit formulation. */
642648
unsigned long Deform_Linear_Solver_Iter; /*!< \brief Max iterations of the linear solver for the implicit formulation. */
643649
unsigned long Linear_Solver_Restart_Frequency; /*!< \brief Restart frequency of the linear solver for the implicit formulation. */
650+
unsigned long Linear_Solver_Restart_Deflation; /*!< \brief Number of vectors used for deflated restarts. */
644651
unsigned long Linear_Solver_Prec_Threads; /*!< \brief Number of threads per rank for ILU and LU_SGS preconditioners. */
645652
unsigned short Linear_Solver_ILU_n; /*!< \brief ILU fill=in level. */
646653
su2double SemiSpan; /*!< \brief Wing Semi span. */
@@ -920,6 +927,7 @@ class CConfig {
920927
Initial_BCThrust, /*!< \brief Ratio of turbulent to laminar viscosity at the actuator disk. */
921928
Pressure_FreeStream, /*!< \brief Total pressure of the fluid. */
922929
Pressure_Thermodynamic, /*!< \brief Thermodynamic pressure of the fluid. */
930+
Standard_Ref_Temperature, /*!< \brief Standard reference temperature for multicomponent flows. */
923931
Temperature_FreeStream, /*!< \brief Total temperature of the fluid. */
924932
Temperature_ve_FreeStream; /*!< \brief Total vibrational-electronic temperature of the fluid. */
925933
unsigned short wallModel_MaxIter; /*!< \brief maximum number of iterations for the Newton method for the wall model */
@@ -1393,6 +1401,11 @@ class CConfig {
13931401
void addGilesOption(const string name, unsigned short & nMarker_Giles, string * & Marker_Giles, unsigned short* & option_field, const map<string, Tenum> & enum_map,
13941402
su2double* & var1, su2double* & var2, su2double** & FlowDir, su2double* & relaxfactor1, su2double* & relaxfactor2);
13951403

1404+
template <class Tenum>
1405+
void addWallSpeciesOption(const string name, unsigned short & nMarker_Wall_Species, string * & Marker_Wall_Species,
1406+
WALL_SPECIES_TYPE** & option_field, const map<string, Tenum> & enum_map,
1407+
su2double** & value, unsigned short & nSpecies_per_Wall);
1408+
13961409
void addExhaustOption(const string& name, unsigned short & nMarker_Exhaust, string * & Marker_Exhaust,
13971410
su2double* & Ttotal, su2double* & Ptotal);
13981411

@@ -1960,6 +1973,12 @@ class CConfig {
19601973
*/
19611974
su2double GetPressure_Thermodynamic(void) const { return Pressure_Thermodynamic; }
19621975

1976+
/*!
1977+
* \brief Get the value of the standard reference temperature for multicomponent flows.
1978+
* \return Standard reference temperature, Non-dimensionalized if it is needed for Non-Dimensional problems.
1979+
*/
1980+
su2double GetStandard_RefTemperatureND(void) const { return Standard_Ref_Temperature / Temperature_Ref; }
1981+
19631982
/*!
19641983
* \brief Get the value of the non-dimensionalized thermodynamic pressure.
19651984
* \return Non-dimensionalized thermodynamic pressure.
@@ -4283,6 +4302,10 @@ class CConfig {
42834302
*/
42844303
unsigned short GetKind_Linear_Solver(void) const { return Kind_Linear_Solver; }
42854304

4305+
/*!
4306+
* \brief Get the inner linear solver used in nested Krylov linear solvers.
4307+
*/
4308+
LINEAR_SOLVER_INNER GetKind_Linear_Solver_Inner(void) const { return Kind_Linear_Solver_Inner; }
42864309

42874310
/*!
42884311
* \brief Get the kind of preconditioner for the implicit solver.
@@ -4332,6 +4355,11 @@ class CConfig {
43324355
*/
43334356
unsigned long GetLinear_Solver_Restart_Frequency(void) const { return Linear_Solver_Restart_Frequency; }
43344357

4358+
/*!
4359+
* \brief Get the number of vectors used for deflated restarts.
4360+
*/
4361+
unsigned long GetLinear_Solver_Restart_Deflation(void) const { return Linear_Solver_Restart_Deflation; }
4362+
43354363
/*!
43364364
* \brief Get the relaxation factor for iterative linear smoothers.
43374365
* \return Relaxation factor.
@@ -4385,7 +4413,7 @@ class CConfig {
43854413
/*!
43864414
* \brief Get Newton-Krylov integer parameters.
43874415
*/
4388-
array<unsigned short,3> GetNewtonKrylovIntParam() const { return NK_IntParam; }
4416+
array<unsigned short,4> GetNewtonKrylovIntParam() const { return NK_IntParam; }
43894417

43904418
/*!
43914419
* \brief Get Newton-Krylov floating-point parameters.
@@ -7133,6 +7161,22 @@ class CConfig {
71337161
*/
71347162
const su2double* GetInlet_SpeciesVal(const string& val_index) const;
71357163

7164+
/*!
7165+
* \brief Get the species value at a wall boundary for a specific species
7166+
* \param[in] val_marker - Marker tag corresponding to the wall boundary.
7167+
* \param[in] iSpecies - Species index.
7168+
* \return The wall species value (flux or Dirichlet value).
7169+
*/
7170+
su2double GetWall_SpeciesVal(const string& val_marker, unsigned short iSpecies) const;
7171+
7172+
/*!
7173+
* \brief Get the species boundary condition type at a wall boundary for a specific species
7174+
* \param[in] val_marker - Marker tag corresponding to the wall boundary.
7175+
* \param[in] iSpecies - Species index.
7176+
* \return The wall species type (FLUX or VALUE).
7177+
*/
7178+
WALL_SPECIES_TYPE GetWall_SpeciesType(const string& val_marker, unsigned short iSpecies) const;
7179+
71367180
/*!
71377181
* \brief Get the turbulent properties values at an inlet boundary
71387182
* \param[in] val_index - Index corresponding to the inlet boundary.

Common/include/geometry/CGeometry.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*!
1+
/*!
22
* \file CGeometry.hpp
33
* \brief Headers of the main subroutines for creating the geometrical structure.
44
* The subroutines and functions are in the <i>CGeometry.cpp</i> file.
@@ -51,6 +51,7 @@ extern "C" {
5151
#include <climits>
5252
#include <memory>
5353
#include <unordered_map>
54+
#include <cstdint>
5455

5556
#include "primal_grid/CPrimalGrid.hpp"
5657
#include "dual_grid/CDualGrid.hpp"

Common/include/geometry/primal_grid/CPrimalGrid.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@
2828

2929
#pragma once
3030

31+
#include <cstdint>
3132
#include <iostream>
3233
#include <vector>
3334
#include <limits>
3435
#include <cstdlib>
35-
#include <limits>
3636
#include <memory>
3737

3838
#include "../../option_structure.hpp"

Common/include/linear_algebra/CPreconditioner.hpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828

2929
#pragma once
3030

31+
#include <functional>
3132
#include "../CConfig.hpp"
3233
#include "../geometry/CGeometry.hpp"
3334
#include "CSysVector.hpp"
@@ -305,6 +306,25 @@ class CPastixPreconditioner final : public CPreconditioner<ScalarType> {
305306
inline void Build() override { sparse_matrix.BuildPastixPreconditioner(geometry, config, kind_fact); }
306307
};
307308

309+
/*!
310+
* \class CAbstractPreconditioner
311+
* \brief Applies a std::function as the preconditioning operation.
312+
* \note This can be used to treat almost anything as a preconditioner.
313+
*/
314+
template <class ScalarType>
315+
class CAbstractPreconditioner final : public CPreconditioner<ScalarType> {
316+
private:
317+
std::function<void(const CSysVector<ScalarType>&, CSysVector<ScalarType>&)> impl;
318+
319+
public:
320+
CAbstractPreconditioner() = delete;
321+
322+
template <class F>
323+
explicit CAbstractPreconditioner(const F& function) : impl(function) {}
324+
325+
inline void operator()(const CSysVector<ScalarType>& u, CSysVector<ScalarType>& v) const override { impl(u, v); }
326+
};
327+
308328
template <class ScalarType>
309329
CPreconditioner<ScalarType>* CPreconditioner<ScalarType>::Create(ENUM_LINEAR_SOLVER_PREC kind,
310330
CSysMatrix<ScalarType>& jacobian, CGeometry* geometry,

0 commit comments

Comments
 (0)