Skip to content

Commit ccd2c10

Browse files
committed
fixed chem and vib source residual computations with axisymmetric
Signed-off-by: jtneedels <jneedels@stanford.edu>
1 parent 23d3f41 commit ccd2c10

1 file changed

Lines changed: 33 additions & 30 deletions

File tree

SU2_CFD/src/solvers/CNEMOEulerSolver.cpp

Lines changed: 33 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1146,7 +1146,7 @@ void CNEMOEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_con
11461146
numerics->SetVolume(geometry->nodes->GetVolume(iPoint));
11471147
numerics->SetCoord(geometry->nodes->GetCoord(iPoint),
11481148
geometry->nodes->GetCoord(iPoint) );
1149-
1149+
}
11501150
/*--- Compute axisymmetric source terms (if needed) ---*/
11511151
if (config->GetAxisymmetric()) {
11521152

@@ -1249,8 +1249,36 @@ void CNEMOEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_con
12491249

12501250
if(!monoatomic){
12511251
if(!frozen){
1252-
/*--- Compute the non-equilibrium chemistry ---*/
1253-
auto residual = numerics->ComputeChemistry(config);
1252+
for (iPoint = 0; iPoint < nPointDomain; iPoint++) {
1253+
/*--- Compute the non-equilibrium chemistry ---*/
1254+
auto residual = numerics->ComputeChemistry(config);
1255+
1256+
/*--- Check for errors before applying source to the linear system ---*/
1257+
err = false;
1258+
for (iVar = 0; iVar < nVar; iVar++)
1259+
if (residual[iVar] != residual[iVar]) err = true;
1260+
//if (implicit)
1261+
// for (iVar = 0; iVar < nVar; iVar++)
1262+
// for (jVar = 0; jVar < nVar; jVar++)
1263+
// if (Jacobian_i[iVar][jVar] != Jacobian_i[iVar][jVar]) err = true;
1264+
1265+
/*--- Apply the chemical sources to the linear system ---*/
1266+
if (!err) {
1267+
LinSysRes.SubtractBlock(iPoint, residual);
1268+
//if (implicit)
1269+
// Jacobian.SubtractBlock(iPoint, iPoint, Jacobian_i);
1270+
} else
1271+
eChm_local++;
1272+
}
1273+
}
1274+
}
1275+
1276+
/*--- Compute vibrational energy relaxation ---*/
1277+
/// NOTE: Jacobians don't account for relaxation time derivatives
1278+
1279+
if (!monoatomic){
1280+
for (iPoint = 0; iPoint < nPointDomain; iPoint++) {
1281+
auto residual = numerics->ComputeVibRelaxation(config);
12541282

12551283
/*--- Check for errors before applying source to the linear system ---*/
12561284
err = false;
@@ -1261,41 +1289,16 @@ void CNEMOEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_con
12611289
// for (jVar = 0; jVar < nVar; jVar++)
12621290
// if (Jacobian_i[iVar][jVar] != Jacobian_i[iVar][jVar]) err = true;
12631291

1264-
/*--- Apply the chemical sources to the linear system ---*/
1292+
/*--- Apply the vibrational relaxation terms to the linear system ---*/
12651293
if (!err) {
12661294
LinSysRes.SubtractBlock(iPoint, residual);
12671295
//if (implicit)
12681296
// Jacobian.SubtractBlock(iPoint, iPoint, Jacobian_i);
12691297
} else
1270-
eChm_local++;
1298+
eVib_local++;
12711299
}
12721300
}
12731301

1274-
/*--- Compute vibrational energy relaxation ---*/
1275-
/// NOTE: Jacobians don't account for relaxation time derivatives
1276-
1277-
if (!monoatomic){
1278-
auto residual = numerics->ComputeVibRelaxation(config);
1279-
1280-
/*--- Check for errors before applying source to the linear system ---*/
1281-
err = false;
1282-
for (iVar = 0; iVar < nVar; iVar++)
1283-
if (residual[iVar] != residual[iVar]) err = true;
1284-
//if (implicit)
1285-
// for (iVar = 0; iVar < nVar; iVar++)
1286-
// for (jVar = 0; jVar < nVar; jVar++)
1287-
// if (Jacobian_i[iVar][jVar] != Jacobian_i[iVar][jVar]) err = true;
1288-
1289-
/*--- Apply the vibrational relaxation terms to the linear system ---*/
1290-
if (!err) {
1291-
LinSysRes.SubtractBlock(iPoint, residual);
1292-
//if (implicit)
1293-
// Jacobian.SubtractBlock(iPoint, iPoint, Jacobian_i);
1294-
} else
1295-
eVib_local++;
1296-
}
1297-
}
1298-
12991302
/*--- Checking for NaN ---*/
13001303
eAxi_global = eAxi_local;
13011304
eChm_global = eChm_local;

0 commit comments

Comments
 (0)