Skip to content

Commit 3357529

Browse files
committed
implement review changes
1 parent dff9fbe commit 3357529

File tree

6 files changed

+53
-53
lines changed

6 files changed

+53
-53
lines changed

Common/include/CConfig.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ class CConfig {
297297
su2double **Inlet_Velocity; /*!< \brief Specified flow velocity vectors for supersonic inlet boundaries. */
298298
su2double **Inlet_SpeciesVal; /*!< \brief Specified species vector for inlet boundaries. */
299299
su2double **Inlet_TurbVal; /*!< \brief Specified turbulent intensity and viscosity ratio for inlet boundaries. */
300-
unsigned short **Kind_Wall_Species; /*!< \brief Species boundary condition type for wall boundaries (FLUX or VALUE) per species. */
300+
WALL_SPECIES_TYPE **Kind_Wall_Species; /*!< \brief Species boundary condition type for wall boundaries (FLUX or VALUE) per species. */
301301
su2double **Wall_SpeciesVal; /*!< \brief Specified species flux or value for wall boundaries per species. */
302302
su2double *EngineInflow_Target; /*!< \brief Specified fan face targets for nacelle boundaries. */
303303
su2double *Inflow_Mach; /*!< \brief Specified fan face mach for nacelle boundaries. */
@@ -1399,7 +1399,7 @@ class CConfig {
13991399

14001400
template <class Tenum>
14011401
void addWallSpeciesOption(const string name, unsigned short & nMarker_Wall_Species, string * & Marker_Wall_Species,
1402-
unsigned short** & option_field, const map<string, Tenum> & enum_map,
1402+
WALL_SPECIES_TYPE** & option_field, const map<string, Tenum> & enum_map,
14031403
su2double** & value, unsigned short & nSpecies_per_Wall);
14041404

14051405
void addExhaustOption(const string& name, unsigned short & nMarker_Exhaust, string * & Marker_Exhaust,

Common/include/option_structure.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1839,12 +1839,12 @@ static const MapType<std::string, RIEMANN_TYPE> Giles_Map = {
18391839
* \brief Types of wall species boundary conditions.
18401840
*/
18411841
enum class WALL_SPECIES_TYPE {
1842-
WALL_SPECIES_FLUX = 1, /*!< \brief Neumann flux boundary condition for wall species. */
1843-
WALL_SPECIES_VALUE = 2 /*!< \brief Dirichlet value boundary condition for wall species. */
1842+
WALL_SPECIES_FLUX, /*!< \brief Neumann flux boundary condition for wall species. */
1843+
WALL_SPECIES_VALUE /*!< \brief Dirichlet value boundary condition for wall species. */
18441844
};
18451845
static const MapType<std::string, WALL_SPECIES_TYPE> Wall_Map = {
1846-
MakePair("FLUX", WALL_SPECIES_FLUX)
1847-
MakePair("VALUE", WALL_SPECIES_VALUE)
1846+
MakePair("FLUX", WALL_SPECIES_TYPE::WALL_SPECIES_FLUX)
1847+
MakePair("VALUE", WALL_SPECIES_TYPE::WALL_SPECIES_VALUE)
18481848
};
18491849

18501850
/*!

Common/include/option_structure.inl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1309,13 +1309,13 @@ class COptionWallSpecies : public COptionBase {
13091309
string name; // identifier for the option
13101310
unsigned short& size;
13111311
string*& marker;
1312-
unsigned short**& field; // Reference to the field name (now 2D: marker x species)
1312+
WALL_SPECIES_TYPE**& field; // Reference to the field name (now 2D: marker x species)
13131313
su2double**& value; // Now 2D: marker x species
13141314
unsigned short& nSpecies_per_Wall;
13151315

13161316
public:
13171317
COptionWallSpecies(string option_field_name, unsigned short& nMarker_Wall_Species, string*& Marker_Wall_Species,
1318-
unsigned short**& option_field, const map<string, Tenum> m, su2double**& value,
1318+
WALL_SPECIES_TYPE**& option_field, const map<string, Tenum> m, su2double**& value,
13191319
unsigned short& nSpecies_per_Wall)
13201320
: size(nMarker_Wall_Species),
13211321
marker(Marker_Wall_Species),
@@ -1416,11 +1416,11 @@ class COptionWallSpecies : public COptionBase {
14161416
// Allocate arrays
14171417
this->size = marker_indices.size();
14181418
this->marker = new string[this->size];
1419-
this->field = new unsigned short*[this->size];
1419+
this->field = new WALL_SPECIES_TYPE*[this->size];
14201420
this->value = new su2double*[this->size];
14211421

14221422
for (unsigned short i = 0; i < this->size; i++) {
1423-
this->field[i] = new unsigned short[this->nSpecies_per_Wall];
1423+
this->field[i] = new WALL_SPECIES_TYPE[this->nSpecies_per_Wall];
14241424
this->value[i] = new su2double[this->nSpecies_per_Wall];
14251425
}
14261426

Common/src/CConfig.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ void CConfig::addRiemannOption(const string name, unsigned short & nMarker_Riema
515515

516516
template <class Tenum>
517517
void CConfig::addWallSpeciesOption(const string name, unsigned short & nMarker_Wall_Species, string * & Marker_Wall_Species,
518-
unsigned short** & option_field, const map<string, Tenum> & enum_map,
518+
WALL_SPECIES_TYPE** & option_field, const map<string, Tenum> & enum_map,
519519
su2double** & value, unsigned short & nSpecies_per_Wall) {
520520
assert(option_map.find(name) == option_map.end());
521521
all_options.insert(pair<string, bool>(name, true));

SU2_CFD/include/solvers/CSpeciesSolver.hpp

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,9 @@ class CSpeciesSolver : public CScalarSolver<CSpeciesVariable> {
157157
* \param[in] config - Definition of the particular problem.
158158
* \param[in] val_marker - Surface marker where the boundary condition is applied.
159159
*/
160-
void BC_Isothermal_Wall(CGeometry* geometry, CSolver** solver_container, CNumerics* conv_numerics,
161-
CNumerics* visc_numerics, CConfig* config, unsigned short val_marker) override;
160+
void BC_Isothermal_Wall(CGeometry* geometry, CSolver** solver_container,
161+
CNumerics* conv_numerics, CNumerics* visc_numerics,
162+
CConfig* config, unsigned short val_marker) override;
162163

163164
/*!
164165
* \brief Impose the heat flux Neumann wall boundary condition (flux).
@@ -169,21 +170,19 @@ class CSpeciesSolver : public CScalarSolver<CSpeciesVariable> {
169170
* \param[in] config - Definition of the particular problem.
170171
* \param[in] val_marker - Surface marker where the boundary condition is applied.
171172
*/
172-
void BC_HeatFlux_Wall(CGeometry* geometry, CSolver** solver_container, CNumerics* conv_numerics,
173-
CNumerics* visc_numerics, CConfig* config, unsigned short val_marker) override;
173+
void BC_HeatFlux_Wall(CGeometry* geometry, CSolver** solver_container,
174+
CNumerics* conv_numerics, CNumerics* visc_numerics,
175+
CConfig* config, unsigned short val_marker) override;
174176

175177
/*!
176178
* \brief Generic wall boundary condition implementation.
177179
* \param[in] geometry - Geometrical definition of the problem.
178180
* \param[in] solver_container - Container vector with all the solutions.
179-
* \param[in] conv_numerics - Description of the numerical method.
180-
* \param[in] visc_numerics - Description of the numerical method.
181181
* \param[in] config - Definition of the particular problem.
182182
* \param[in] val_marker - Surface marker where the boundary condition is applied.
183-
* \param[in] cht_mode - Flag for conjugate heat transfer mode (default: false).
184183
*/
185-
void BC_Wall_Generic(CGeometry* geometry, CSolver** solver_container, CNumerics* conv_numerics,
186-
CNumerics* visc_numerics, CConfig* config, unsigned short val_marker, bool cht_mode = false);
184+
void BC_Wall_Generic(CGeometry* geometry, CSolver** solver_container,
185+
CConfig* config, unsigned short val_marker);
187186

188187
/*--- Note that BC_Sym_Plane, BC_HeatFlux_Wall, BC_Isothermal_Wall are all treated as zero-flux BC for the
189188
* mass-factions, which can be fulfilled by no additional residual contribution on these nodes.

SU2_CFD/src/solvers/CSpeciesSolver.cpp

Lines changed: 34 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -420,15 +420,15 @@ void CSpeciesSolver::BC_Inlet(CGeometry* geometry, CSolver** solver_container, C
420420

421421

422422
void CSpeciesSolver::BC_Isothermal_Wall(CGeometry* geometry, CSolver** solver_container,
423-
CNumerics* conv_numerics, CNumerics* visc_numerics, CConfig* config,
424-
unsigned short val_marker) {
425-
BC_Wall_Generic(geometry, solver_container, conv_numerics, visc_numerics, config, val_marker);
423+
CNumerics* conv_numerics, CNumerics* visc_numerics,
424+
CConfig* config, unsigned short val_marker) {
425+
BC_Wall_Generic(geometry, solver_container, config, val_marker);
426426
}
427427

428428
void CSpeciesSolver::BC_HeatFlux_Wall(CGeometry* geometry, CSolver** solver_container,
429-
CNumerics* conv_numerics, CNumerics* visc_numerics, CConfig* config,
430-
unsigned short val_marker) {
431-
BC_Wall_Generic(geometry, solver_container, conv_numerics, visc_numerics, config, val_marker, false);
429+
CNumerics* conv_numerics, CNumerics* visc_numerics,
430+
CConfig* config, unsigned short val_marker) {
431+
BC_Wall_Generic(geometry, solver_container, config, val_marker);
432432
}
433433

434434
void CSpeciesSolver::BC_Wall_Generic(CGeometry* geometry, CSolver** solver_container,
@@ -438,48 +438,49 @@ void CSpeciesSolver::BC_Wall_Generic(CGeometry* geometry, CSolver** solver_conta
438438

439439
string Marker_Tag = config->GetMarker_All_TagBound(val_marker);
440440

441-
SU2_OMP_FOR_DYN(OMP_MIN_SIZE)
442-
for (auto iVertex = 0u; iVertex < geometry->nVertex[val_marker]; iVertex++) {
441+
for (auto iVar = 0u; iVar < nVar; iVar++) {
443442

444-
const auto iPoint = geometry->vertex[val_marker][iVertex]->GetNode();
443+
// Get wall species boundary condition type and value for this marker and species
444+
const su2double WallSpeciesValue = config->GetWall_SpeciesVal(Marker_Tag, iVar);
445+
const WALL_SPECIES_TYPE wallspeciestype = config->GetWall_SpeciesType(Marker_Tag, iVar);
445446

446-
if (!geometry->nodes->GetDomain(iPoint)) continue;
447+
SU2_OMP_FOR_DYN(OMP_MIN_SIZE)
448+
for (auto iVertex = 0u; iVertex < geometry->nVertex[val_marker]; iVertex++) {
447449

448-
const auto Normal = geometry->vertex[val_marker][iVertex]->GetNormal();
450+
const auto iPoint = geometry->vertex[val_marker][iVertex]->GetNode();
449451

450-
su2double Area = GeometryToolbox::Norm(nDim, Normal);
452+
if (!geometry->nodes->GetDomain(iPoint)) continue;
451453

452-
for (auto iVar = 0u; iVar < nVar; iVar++) {
454+
const auto Normal = geometry->vertex[val_marker][iVertex]->GetNormal();
453455

454-
// Get wall species boundary condition type and value for this marker and species
455-
su2double WallSpeciesValue = config->GetWall_SpeciesVal(Marker_Tag, iVar);
456-
unsigned short wallspeciestype = config->GetWall_SpeciesType(Marker_Tag, iVar);
456+
su2double Area = GeometryToolbox::Norm(nDim, Normal);
457457

458458
su2double WallSpecies = WallSpeciesValue;
459459

460460
/*--- Get the scalar values from the python wrapper. ---*/
461461
if (py_custom) {
462-
WallSpecies = GetCustomBoundaryScalar(val_marker, iVertex, iVar);
462+
WallSpecies = CustomBoundaryScalar[val_marker](iVertex,iVar);
463463
}
464464

465-
switch(wallspeciestype) {
466-
case WALL_SPECIES_TYPE::WALL_SPECIES_FLUX:
467-
//Flux Boundary condition
468-
LinSysRes(iPoint, iVar) -= WallSpecies * Area;
469-
break;
470-
case WALL_SPECIES_TYPE::WALL_SPECIES_VALUE:
471-
//Dirichlet Strong Boundary Condition
472-
nodes->SetSolution(iPoint, iVar, WallSpecies);
473-
nodes->SetSolution_Old(iPoint, iVar, WallSpecies);
474-
LinSysRes(iPoint, iVar) = 0.0;
475-
if (implicit) {
476-
unsigned long total_index = iPoint * nVar + iVar;
477-
Jacobian.DeleteValsRowi(total_index);
478-
}
479-
break;
465+
switch(wallspeciestype) {
466+
case WALL_SPECIES_TYPE::WALL_SPECIES_FLUX:
467+
//Flux Boundary condition
468+
LinSysRes(iPoint, iVar) -= WallSpecies * Area;
469+
break;
470+
case WALL_SPECIES_TYPE::WALL_SPECIES_VALUE:
471+
//Dirichlet Strong Boundary Condition
472+
nodes->SetSolution(iPoint, iVar, WallSpecies);
473+
nodes->SetSolution_Old(iPoint, iVar, WallSpecies);
474+
LinSysRes(iPoint, iVar) = 0.0;
475+
if (implicit) {
476+
unsigned long total_index = iPoint * nVar + iVar;
477+
Jacobian.DeleteValsRowi(total_index);
478+
}
479+
break;
480+
}
480481
}
482+
END_SU2_OMP_FOR
481483
}
482-
END_SU2_OMP_FOR
483484
}
484485

485486

0 commit comments

Comments
 (0)