Skip to content

Commit ef2dc5f

Browse files
author
Cristopher-Morales
committed
changing boolean names
1 parent c469d32 commit ef2dc5f

File tree

9 files changed

+35
-36
lines changed

9 files changed

+35
-36
lines changed

SU2_CFD/include/numerics/CNumerics.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ class CNumerics {
192192

193193
bool nemo; /*!< \brief Flag for NEMO problems */
194194

195-
bool multicomponent_energy = false; /*!< \brief Flag for multicomponent and reacting flow */
195+
bool energy_multicomponent = false; /*!< \brief Flag for multicomponent and reacting flow */
196196

197197
bool bounded_scalar = false; /*!< \brief Flag for bounded scalar problem */
198198

SU2_CFD/src/numerics/CNumerics.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ CNumerics::CNumerics(unsigned short val_nDim, unsigned short val_nVar,
5454
Prandtl_Lam = config->GetPrandtl_Lam();
5555
Prandtl_Turb = config->GetPrandtl_Turb();
5656
Gas_Constant = config->GetGas_ConstantND();
57-
multicomponent_energy =
58-
(config->GetKind_Species_Model() == SPECIES_MODEL::SPECIES_TRANSPORT) && (config->GetEnergy_Equation());
57+
energy_multicomponent = ((config->GetKind_FluidModel() == FLUID_MIXTURE) && (config->GetEnergy_Equation()));
5958

6059
tau = new su2double* [nDim];
6160
for (iDim = 0; iDim < nDim; iDim++)
@@ -280,7 +279,7 @@ void CNumerics::GetInviscidIncProjJac(const su2double *val_density, const su2dou
280279
val_Proj_Jac_Tensor[2][2] = val_scale*((*val_density)*(proj_vel + val_normal[1]*val_velocity[1]));
281280
val_Proj_Jac_Tensor[2][3] = val_scale*((*val_dRhodT)*val_velocity[1]*proj_vel);
282281

283-
if (multicomponent_energy) {
282+
if (energy_multicomponent) {
284283
val_Proj_Jac_Tensor[3][0] = val_scale * ((*val_temperature) * proj_vel / (*val_betainc2));
285284
val_Proj_Jac_Tensor[3][1] = val_scale * ((*val_temperature) * val_normal[0] * (*val_density));
286285
val_Proj_Jac_Tensor[3][2] = val_scale * ((*val_temperature) * val_normal[1] * (*val_density));
@@ -321,7 +320,7 @@ void CNumerics::GetInviscidIncProjJac(const su2double *val_density, const su2dou
321320
val_Proj_Jac_Tensor[3][3] = val_scale*((*val_density)*(proj_vel + val_normal[2]*val_velocity[2]));
322321
val_Proj_Jac_Tensor[3][4] = val_scale*((*val_dRhodT)*val_velocity[2]*proj_vel);
323322

324-
if (multicomponent_energy) {
323+
if (energy_multicomponent) {
325324
val_Proj_Jac_Tensor[4][0] = val_scale * ((*val_temperature) * proj_vel / (*val_betainc2));
326325
val_Proj_Jac_Tensor[4][1] = val_scale * ((*val_temperature) * val_normal[0] * (*val_density));
327326
val_Proj_Jac_Tensor[4][2] = val_scale * ((*val_temperature) * val_normal[1] * (*val_density));
@@ -349,7 +348,7 @@ void CNumerics::GetPreconditioner(const su2double *val_density, const su2double
349348
val_Precon[0][0] = 1.0/(*val_betainc2);
350349
for (iDim = 0; iDim < nDim; iDim++)
351350
val_Precon[iDim+1][0] = val_velocity[iDim]/(*val_betainc2);
352-
if (multicomponent_energy){
351+
if (energy_multicomponent){
353352
val_Precon[nDim+1][0] = (*val_temperature)/(*val_betainc2);
354353
}else{
355354
val_Precon[nDim+1][0] = (*val_cp)*(*val_temperature)/(*val_betainc2);
@@ -367,7 +366,7 @@ void CNumerics::GetPreconditioner(const su2double *val_density, const su2double
367366
val_Precon[0][nDim+1] = (*val_drhodt);
368367
for (iDim = 0; iDim < nDim; iDim++)
369368
val_Precon[iDim+1][nDim+1] = val_velocity[iDim]*(*val_drhodt);
370-
if (multicomponent_energy){
369+
if (energy_multicomponent){
371370
val_Precon[nDim+1][nDim+1] = (*val_drhodt)*(*val_temperature) + (*val_density);
372371
}else{
373372
val_Precon[nDim+1][nDim+1] = (*val_cp)*((*val_drhodt)*(*val_temperature) + (*val_density));

SU2_CFD/src/numerics/flow/convection/fds.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ CNumerics::ResidualType<> CUpwFDSInc_Flow::ComputeResidual(const CConfig *config
118118
DensityInc_i = V_i[nDim+2]; DensityInc_j = V_j[nDim+2];
119119
BetaInc2_i = V_i[nDim+3]; BetaInc2_j = V_j[nDim+3];
120120
Cp_i = V_i[nDim+7]; Cp_j = V_j[nDim+7];
121-
if (multicomponent_energy) {
121+
if (energy_multicomponent) {
122122
Enthalpy_i = V_i[nDim + 9];
123123
Enthalpy_j = V_j[nDim + 9];
124124
} else {
@@ -163,7 +163,7 @@ CNumerics::ResidualType<> CUpwFDSInc_Flow::ComputeResidual(const CConfig *config
163163

164164
MeandRhodT = 0.0; dRhodT_i = 0.0; dRhodT_j = 0.0;
165165
if (variable_density) {
166-
if (multicomponent_energy) {
166+
if (energy_multicomponent) {
167167
MeandRhodT = -MeanDensity / (MeanCp * MeanTemperature);
168168
dRhodT_i = -DensityInc_i / (Cp_i * Temperature_i);
169169
dRhodT_j = -DensityInc_j / (Cp_j * Temperature_j);
@@ -204,7 +204,7 @@ CNumerics::ResidualType<> CUpwFDSInc_Flow::ComputeResidual(const CConfig *config
204204
Lambda[iVar] = fabs(Lambda[iVar]);
205205

206206
/*--- Build the preconditioning matrix using mean values ---*/
207-
if (multicomponent_energy) {
207+
if (energy_multicomponent) {
208208
GetPreconditioner(&MeanDensity, MeanVelocity, &MeanBetaInc2, &MeanCp, &MeanEnthalpy, &MeandRhodT, Precon);
209209
} else {
210210
GetPreconditioner(&MeanDensity, MeanVelocity, &MeanBetaInc2, &MeanCp, &MeanTemperature, &MeandRhodT, Precon);
@@ -221,7 +221,7 @@ CNumerics::ResidualType<> CUpwFDSInc_Flow::ComputeResidual(const CConfig *config
221221
Diff_V[0] = Pressure_j - Pressure_i;
222222
for (iDim = 0; iDim < nDim; iDim++)
223223
Diff_V[iDim+1] = Velocity_j[iDim] - Velocity_i[iDim];
224-
if (multicomponent_energy){
224+
if (energy_multicomponent){
225225
Diff_V[nDim+1] = Enthalpy_j - Enthalpy_i;
226226
}else{
227227
Diff_V[nDim+1] = Temperature_j - Temperature_i;
@@ -230,7 +230,7 @@ CNumerics::ResidualType<> CUpwFDSInc_Flow::ComputeResidual(const CConfig *config
230230
/*--- Build the inviscid Jacobian w.r.t. the primitive variables ---*/
231231

232232
if (implicit) {
233-
if (multicomponent_energy) {
233+
if (energy_multicomponent) {
234234
GetInviscidIncProjJac(&DensityInc_i, Velocity_i, &BetaInc2_i, &Cp_i, &Enthalpy_i, &dRhodT_i, Normal, 0.5,
235235
Jacobian_i);
236236
GetInviscidIncProjJac(&DensityInc_j, Velocity_j, &BetaInc2_j, &Cp_j, &Enthalpy_j, &dRhodT_j, Normal, 0.5,
@@ -286,7 +286,7 @@ CNumerics::ResidualType<> CUpwFDSInc_Flow::ComputeResidual(const CConfig *config
286286
Jacobian_i[iDim+1][iDim+1] -= 0.5*ProjVelocity*DensityInc_i;
287287
Jacobian_j[iDim+1][iDim+1] -= 0.5*ProjVelocity*DensityInc_j;
288288
}
289-
if (multicomponent_energy){
289+
if (energy_multicomponent){
290290
Jacobian_i[nDim+1][nDim+1] -= 0.5*ProjVelocity*DensityInc_i;
291291
Jacobian_j[nDim+1][nDim+1] -= 0.5*ProjVelocity*DensityInc_j;
292292
} else {

SU2_CFD/src/numerics/flow/flow_diffusion.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ CNumerics::ResidualType<> CAvgGradInc_Flow::ComputeResidual(const CConfig* confi
583583
Laminar_Viscosity_i = V_i[nDim+4]; Laminar_Viscosity_j = V_j[nDim+4];
584584
Eddy_Viscosity_i = V_i[nDim+5]; Eddy_Viscosity_j = V_j[nDim+5];
585585
Thermal_Conductivity_i = V_i[nDim+6]; Thermal_Conductivity_j = V_j[nDim+6];
586-
if (multicomponent_energy) {
586+
if (energy_multicomponent) {
587587
Cp_i = V_i[nDim + 7];
588588
Cp_j = V_j[nDim + 7];
589589
}
@@ -594,7 +594,7 @@ CNumerics::ResidualType<> CAvgGradInc_Flow::ComputeResidual(const CConfig* confi
594594
Mean_Eddy_Viscosity = 0.5*(Eddy_Viscosity_i + Eddy_Viscosity_j);
595595
Mean_turb_ke = 0.5*(turb_ke_i + turb_ke_j);
596596
Mean_Thermal_Conductivity = 0.5*(Thermal_Conductivity_i + Thermal_Conductivity_j);
597-
if (multicomponent_energy) {
597+
if (energy_multicomponent) {
598598
Mean_Heat_Capacity = 0.5 * (Cp_i + Cp_j);
599599
}
600600

@@ -630,7 +630,7 @@ CNumerics::ResidualType<> CAvgGradInc_Flow::ComputeResidual(const CConfig* confi
630630
if (config->GetSAParsedOptions().qcr2000) AddQCR(nDim, &Mean_GradPrimVar[1], tau);
631631
if (Mean_TauWall > 0) AddTauWall(UnitNormal, Mean_TauWall);
632632

633-
if (multicomponent_energy) {
633+
if (energy_multicomponent) {
634634
Mean_HeatFluxDiffusion = HeatFluxDiffusion;
635635
Mean_JacHeatFluxDiffusion = Jac_HeatFluxDiffusion;
636636
}
@@ -661,7 +661,7 @@ CNumerics::ResidualType<> CAvgGradInc_Flow::ComputeResidual(const CConfig* confi
661661
proj_vector_ij += (Coord_j[iDim]-Coord_i[iDim])*Normal[iDim];
662662
}
663663
proj_vector_ij = proj_vector_ij/dist_ij_2;
664-
if (multicomponent_energy){
664+
if (energy_multicomponent){
665665
Jacobian_i[nDim + 1][nDim + 1] =
666666
-(Mean_Thermal_Conductivity * proj_vector_ij + Mean_JacHeatFluxDiffusion) / Mean_Heat_Capacity;
667667
Jacobian_j[nDim + 1][nDim + 1] =
@@ -741,7 +741,7 @@ void CAvgGradInc_Flow::GetViscousIncProjFlux(const su2double* const *val_gradpri
741741
for (unsigned short iDim = 0; iDim < nDim; iDim++)
742742
Proj_Flux_Tensor[iVar] += Flux_Tensor[iVar][iDim] * val_normal[iDim];
743743
}
744-
if (multicomponent_energy) {
744+
if (energy_multicomponent) {
745745
Proj_Flux_Tensor[nVar - 1] += val_heatDiffusion;
746746
}
747747
}

SU2_CFD/src/numerics/flow/flow_sources.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ CNumerics::ResidualType<> CSourceIncAxisymmetric_Flow::ComputeResidual(const CCo
337337
residual[3] -= Volume * yinv * Thermal_Conductivity_i * PrimVar_Grad_i[nDim + 1][1];
338338
if (multicomponent && energy) {
339339
residual[3] -= Volume * yinv * HeatFluxDiffusion;
340-
if (implicit) jacobian[3][3] -= Volume * yinv * Jac_HeatFluxDiffusion;
340+
if (implicit) jacobian[3][3] -= Volume * yinv * Jac_HeatFluxDiffusion / Cp_i;
341341
}
342342
}
343343

SU2_CFD/src/output/CFlowIncOutput.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ CFlowIncOutput::CFlowIncOutput(CConfig *config, unsigned short nDim) : CFlowOutp
3737

3838
heat = config->GetEnergy_Equation();
3939

40-
multicomponent = config->GetKind_Species_Model()==SPECIES_MODEL::SPECIES_TRANSPORT;
40+
multicomponent = (config->GetKind_FluidModel() == FLUID_MIXTURE);
4141

4242
weakly_coupled_heat = config->GetWeakly_Coupled_Heat();
4343
flamelet = (config->GetKind_Species_Model() == SPECIES_MODEL::FLAMELET);

SU2_CFD/src/solvers/CIncEulerSolver.cpp

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ CIncEulerSolver::CIncEulerSolver(CGeometry *geometry, CConfig *config, unsigned
5757
bool time_stepping = config->GetTime_Marching() == TIME_MARCHING::TIME_STEPPING;
5858
bool adjoint = (config->GetContinuous_Adjoint()) || (config->GetDiscrete_Adjoint());
5959
const bool centered = config->GetKind_ConvNumScheme_Flow() == SPACE_CENTERED;
60-
bool Energy_Multicomponent = (config->GetKind_Species_Model()==SPECIES_MODEL::SPECIES_TRANSPORT) && config->GetEnergy_Equation();
60+
const bool energy_multicomponent = ((config->GetKind_FluidModel() == FLUID_MIXTURE) && config->GetEnergy_Equation());
6161

6262
/* A grid is defined as dynamic if there's rigid grid movement or grid deformation AND the problem is time domain */
6363
dynamic_grid = config->GetDynamic_Grid();
@@ -179,7 +179,7 @@ CIncEulerSolver::CIncEulerSolver(CGeometry *geometry, CConfig *config, unsigned
179179
Pressure_Inf = config->GetPressure_FreeStreamND();
180180
Velocity_Inf = config->GetVelocity_FreeStreamND();
181181
Temperature_Inf = config->GetTemperature_FreeStreamND();
182-
if (Energy_Multicomponent){
182+
if (energy_multicomponent){
183183
CFluidModel *auxFluidModel = new CFluidScalar(config->GetPressure_Thermodynamic(), config);
184184
const su2double *scalar_init = config->GetSpecies_Init();
185185
auxFluidModel->SetTDState_T(Temperature_Inf,scalar_init); // compute total enthalpy from temperature
@@ -215,7 +215,7 @@ CIncEulerSolver::CIncEulerSolver(CGeometry *geometry, CConfig *config, unsigned
215215
/*--- Initialize the solution to the far-field state everywhere. ---*/
216216

217217
if (navier_stokes) {
218-
if (Energy_Multicomponent){
218+
if (energy_multicomponent){
219219
nodes = new CIncNSVariable(Pressure_Inf, Velocity_Inf, Enthalpy_Inf, nPoint, nDim, nVar, config);
220220
}else{
221221
nodes = new CIncNSVariable(Pressure_Inf, Velocity_Inf, Temperature_Inf, nPoint, nDim, nVar, config);
@@ -1238,7 +1238,8 @@ void CIncEulerSolver::Upwind_Residual(CGeometry *geometry, CSolver **solver_cont
12381238
const bool limiter = (config->GetKind_SlopeLimit_Flow() != LIMITER::NONE);
12391239
const bool van_albada = (config->GetKind_SlopeLimit_Flow() == LIMITER::VAN_ALBADA_EDGE);
12401240
const bool bounded_scalar = config->GetBounded_Scalar();
1241-
const bool energy_multicomponent = (config->GetEnergy_Equation()) && (config->GetKind_FluidModel() == FLUID_MIXTURE);
1241+
const bool energy_multicomponent =
1242+
((config->GetEnergy_Equation()) && (config->GetKind_FluidModel() == FLUID_MIXTURE));
12421243

12431244
/*--- For hybrid parallel AD, pause preaccumulation if there is shared reading of
12441245
* variables, otherwise switch to the faster adjoint evaluation mode. ---*/
@@ -1446,7 +1447,7 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont
14461447
const bool energy = config->GetEnergy_Equation();
14471448
const bool streamwise_periodic = (config->GetKind_Streamwise_Periodic() != ENUM_STREAMWISE_PERIODIC::NONE);
14481449
const bool streamwise_periodic_temperature = config->GetStreamwise_Periodic_Temperature();
1449-
const bool multicomponent = (config->GetKind_FluidModel()==FLUID_MIXTURE);
1450+
const bool multicomponent = (config->GetKind_FluidModel() == FLUID_MIXTURE);
14501451

14511452
AD::StartNoSharedReading();
14521453

@@ -2063,7 +2064,7 @@ void CIncEulerSolver::SetPreconditioner(const CConfig *config, unsigned long iPo
20632064
bool variable_density = (config->GetVariable_Density_Model());
20642065
bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT);
20652066
bool energy = config->GetEnergy_Equation();
2066-
bool multicomponent = config->GetKind_Species_Model()==SPECIES_MODEL::SPECIES_TRANSPORT;
2067+
bool multicomponent = (config->GetKind_FluidModel() == FLUID_MIXTURE);
20672068

20682069
/*--- Access the primitive variables at this node. ---*/
20692070

@@ -2336,7 +2337,7 @@ void CIncEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container,
23362337

23372338
const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT);
23382339
const bool viscous = config->GetViscous();
2339-
bool Energy_Multicomponent = (config->GetKind_Species_Model()==SPECIES_MODEL::SPECIES_TRANSPORT) && config->GetEnergy_Equation();
2340+
const bool energy_multicomponent = ((config->GetKind_FluidModel() == FLUID_MIXTURE) && (config->GetEnergy_Equation()));
23402341

23412342
string Marker_Tag = config->GetMarker_All_TagBound(val_marker);
23422343

@@ -2501,7 +2502,7 @@ void CIncEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container,
25012502
}
25022503

25032504
/*-- Enthalpy is needed for energy equation in multicomponent and reacting flows. ---*/
2504-
if (Energy_Multicomponent) {
2505+
if (energy_multicomponent) {
25052506
CFluidModel* auxFluidModel = solver_container[FLOW_SOL]->GetFluidModel();
25062507
const su2double* scalar_inlet = config->GetInlet_SpeciesVal(config->GetMarker_All_TagBound(val_marker));
25072508
auxFluidModel->SetTDState_T(V_inlet[prim_idx.Temperature()],
@@ -2546,7 +2547,7 @@ void CIncEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container,
25462547

25472548
/*--- Viscous contribution, commented out because serious convergence problems ---*/
25482549

2549-
if (!viscous || Energy_Multicomponent) continue;
2550+
if (!viscous || energy_multicomponent) continue;
25502551

25512552
/*--- Set transport properties at the inlet ---*/
25522553

@@ -2598,7 +2599,7 @@ void CIncEulerSolver::BC_Outlet(CGeometry *geometry, CSolver **solver_container,
25982599

25992600
const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT);
26002601
const bool viscous = config->GetViscous();
2601-
bool Energy_Multicomponent = (config->GetKind_Species_Model()==SPECIES_MODEL::SPECIES_TRANSPORT) && config->GetEnergy_Equation();
2602+
const bool energy_multicomponent = ((config->GetKind_FluidModel() == FLUID_MIXTURE) && (config->GetEnergy_Equation()));
26022603
string Marker_Tag = config->GetMarker_All_TagBound(val_marker);
26032604

26042605
su2double Normal[MAXNDIM] = {0.0};
@@ -2722,7 +2723,7 @@ void CIncEulerSolver::BC_Outlet(CGeometry *geometry, CSolver **solver_container,
27222723
V_outlet[prim_idx.CpTotal()] = nodes->GetSpecificHeatCp(iPoint);
27232724

27242725
/*-- Enthalpy is needed for energy equation in multicomponent and reacting flows. ---*/
2725-
if (Energy_Multicomponent) {
2726+
if (energy_multicomponent) {
27262727
CFluidModel* auxFluidModel = solver_container[FLOW_SOL]->GetFluidModel();;
27272728
const su2double* scalar_outlet = solver_container[SPECIES_SOL]->GetNodes()->GetSolution(iPoint);
27282729
auxFluidModel->SetTDState_T(nodes->GetTemperature(iPoint),
@@ -2754,7 +2755,7 @@ void CIncEulerSolver::BC_Outlet(CGeometry *geometry, CSolver **solver_container,
27542755

27552756
/*--- Viscous contribution, commented out because serious convergence problems ---*/
27562757

2757-
if (!viscous || Energy_Multicomponent) continue;
2758+
if (!viscous || energy_multicomponent) continue;
27582759

27592760
/*--- Set transport properties at the outlet. ---*/
27602761

SU2_CFD/src/solvers/CIncNSSolver.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,12 +300,11 @@ void CIncNSSolver::Compute_Streamwise_Periodic_Recovered_Values(CConfig *config,
300300

301301
void CIncNSSolver::Viscous_Residual(unsigned long iEdge, CGeometry *geometry, CSolver **solver_container,
302302
CNumerics *numerics, CConfig *config) {
303-
const bool speciesEnergy =
304-
(config->GetKind_Species_Model() == SPECIES_MODEL::SPECIES_TRANSPORT) && config->GetEnergy_Equation();
303+
const bool energy_multicomponent = ((config->GetKind_FluidModel() == FLUID_MIXTURE) && config->GetEnergy_Equation());
305304
const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT);
306305

307306
/*--- Contribution to heat flux due to enthalpy diffusion for multicomponent and reacting flows ---*/
308-
if (speciesEnergy) {
307+
if (energy_multicomponent) {
309308
CVariable* speciesNodes = solver_container[SPECIES_SOL]->GetNodes();
310309
/*--- Points in edge ---*/
311310

SU2_CFD/src/variables/CIncNSVariable.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ CIncNSVariable::CIncNSVariable(su2double pressure, const su2double *velocity, su
4646
AuxVar.resize(nPoint,nAuxVar) = su2double(0.0);
4747
Grad_AuxVar.resize(nPoint,nAuxVar,nDim);
4848
}
49-
if ((config->GetKind_Species_Model() == SPECIES_MODEL::SPECIES_TRANSPORT) && config->GetEnergy_Equation()) {
49+
if ((config->GetKind_FluidModel() == FLUID_MIXTURE) && config->GetEnergy_Equation()) {
5050
Energy_Multicomponent = true;
5151
if (config->GetMUSCL_Flow()) {
5252
nAuxVar = 2;

0 commit comments

Comments
 (0)