Skip to content

Commit

Permalink
Used plus sign for regModel inputShift
Browse files Browse the repository at this point in the history
  • Loading branch information
friedenhe authored Jan 22, 2024
1 parent 5f22bd3 commit 205c9c3
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/adjoint/DARegression/DARegression.C
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ void DARegression::calcInput(List<List<scalar>>& inputFields)
volScalarField magS = mag(symm(gradU));
forAll(inputFields[idxI], cellI)
{
inputFields[idxI][cellI] = (magOmega[cellI] / (magS[cellI] + 1e-16) - inputShift_[idxI]) * inputScale_[idxI];
inputFields[idxI][cellI] = (magOmega[cellI] / (magS[cellI] + 1e-16) + inputShift_[idxI]) * inputScale_[idxI];
}
}
else if (inputName == "PoD")
Expand All @@ -93,7 +93,7 @@ void DARegression::calcInput(List<List<scalar>>& inputFields)
daModel_.getTurbProdOverDestruct(inputFields[idxI]);
forAll(inputFields[idxI], cellI)
{
inputFields[idxI][cellI] = (inputFields[idxI][cellI] - inputShift_[idxI]) * inputScale_[idxI];
inputFields[idxI][cellI] = (inputFields[idxI][cellI] + inputShift_[idxI]) * inputScale_[idxI];
}
}
else if (inputName == "chiSA")
Expand All @@ -104,7 +104,7 @@ void DARegression::calcInput(List<List<scalar>>& inputFields)
volScalarField nu = daModel_.getDATurbulenceModel().nu();
forAll(inputFields[idxI], cellI)
{
inputFields[idxI][cellI] = (nuTilda[cellI] / nu[cellI] - inputShift_[idxI]) * inputScale_[idxI];
inputFields[idxI][cellI] = (nuTilda[cellI] / nu[cellI] + inputShift_[idxI]) * inputScale_[idxI];
}
#endif
}
Expand All @@ -122,7 +122,7 @@ void DARegression::calcInput(List<List<scalar>>& inputFields)
volScalarField pGradAlongStream = (U & pGrad) / pG_denominator;
forAll(inputFields[idxI], cellI)
{
inputFields[idxI][cellI] = (pGradAlongStream[cellI] - inputShift_[idxI]) * inputScale_[idxI];
inputFields[idxI][cellI] = (pGradAlongStream[cellI] + inputShift_[idxI]) * inputScale_[idxI];
}
}
else if (inputName == "PSoSS")
Expand All @@ -141,7 +141,7 @@ void DARegression::calcInput(List<List<scalar>>& inputFields)
diagUGrad[1] = gradU[cellI].yy();
diagUGrad[2] = gradU[cellI].zz();
val = mag(pGrad[cellI]) / (mag(pGrad[cellI]) + mag(3.0 * cmptAv(U[cellI] & diagUGrad)) + 1e-16);
inputFields[idxI][cellI] = (val - inputShift_[idxI]) * inputScale_[idxI];
inputFields[idxI][cellI] = (val + inputShift_[idxI]) * inputScale_[idxI];
}
}
else if (inputName == "SCurv")
Expand All @@ -155,7 +155,7 @@ void DARegression::calcInput(List<List<scalar>>& inputFields)
forAll(inputFields[idxI], cellI)
{
val = mag(U[cellI] & gradU[cellI]) / (mag(U[cellI] & U[cellI]) + mag(U[cellI] & gradU[cellI]) + 1e-16);
inputFields[idxI][cellI] = (val - inputShift_[idxI]) * inputScale_[idxI];
inputFields[idxI][cellI] = (val + inputShift_[idxI]) * inputScale_[idxI];
}
}
else if (inputName == "UOrth")
Expand All @@ -169,7 +169,7 @@ void DARegression::calcInput(List<List<scalar>>& inputFields)
forAll(inputFields[idxI], cellI)
{
val = mag(U[cellI] & gradU[cellI] & U[cellI]) / (mag(U[cellI]) * mag(gradU[cellI] & U[cellI]) + mag(U[cellI] & gradU[cellI] & U[cellI]) + 1e-16);
inputFields[idxI][cellI] = (val - inputShift_[idxI]) * inputScale_[idxI];
inputFields[idxI][cellI] = (val + inputShift_[idxI]) * inputScale_[idxI];
}
}
else if (inputName == "KoU2")
Expand All @@ -181,7 +181,7 @@ void DARegression::calcInput(List<List<scalar>>& inputFields)
forAll(inputFields[idxI], cellI)
{
val = k[cellI] / (0.5 * (U[cellI] & U[cellI]) + 1e-16);
inputFields[idxI][cellI] = (val - inputShift_[idxI]) * inputScale_[idxI];
inputFields[idxI][cellI] = (val + inputShift_[idxI]) * inputScale_[idxI];
}
}
else if (inputName == "ReWall")
Expand All @@ -194,7 +194,7 @@ void DARegression::calcInput(List<List<scalar>>& inputFields)
forAll(inputFields[idxI], cellI)
{
val = sqrt(k[cellI]) * y[cellI] / (50.0 * nu[cellI]);
inputFields[idxI][cellI] = (val - inputShift_[idxI]) * inputScale_[idxI];
inputFields[idxI][cellI] = (val + inputShift_[idxI]) * inputScale_[idxI];
}
}
else if (inputName == "CoP")
Expand All @@ -203,7 +203,7 @@ void DARegression::calcInput(List<List<scalar>>& inputFields)
daModel_.getTurbConvOverProd(inputFields[idxI]);
forAll(inputFields[idxI], cellI)
{
inputFields[idxI][cellI] = (inputFields[idxI][cellI] - inputShift_[idxI]) * inputScale_[idxI];
inputFields[idxI][cellI] = (inputFields[idxI][cellI] + inputShift_[idxI]) * inputScale_[idxI];
}
}
else if (inputName == "TauoK")
Expand All @@ -217,7 +217,7 @@ void DARegression::calcInput(List<List<scalar>>& inputFields)
forAll(inputFields[idxI], cellI)
{
val = mag(tau[cellI]) / (k[cellI] + 1e-16);
inputFields[idxI][cellI] = (val - inputShift_[idxI]) * inputScale_[idxI];
inputFields[idxI][cellI] = (val + inputShift_[idxI]) * inputScale_[idxI];
}
}
else
Expand Down

0 comments on commit 205c9c3

Please sign in to comment.