Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix axisymmetric divergence for SST production #1784

Merged
merged 51 commits into from
Nov 12, 2022
Merged
Changes from 9 commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
0847969
fix divergence for SST production
bigfooted Oct 7, 2022
289bcb5
fix bracket placement
bigfooted Oct 7, 2022
5fee70e
add EPS, remove commented code
bigfooted Oct 7, 2022
4b3960c
Update SU2_CFD/include/numerics/turbulent/turb_sources.hpp
bigfooted Oct 7, 2022
2873ac1
Update SU2_CFD/include/numerics/turbulent/turb_sources.hpp
bigfooted Oct 7, 2022
790c3b6
remove AD preac
bigfooted Oct 7, 2022
74e4b1f
Merge branch 'fix_sst_axisymmetry' of https://github.com/su2code/SU2 …
bigfooted Oct 7, 2022
3104296
implement review suggestions
bigfooted Oct 7, 2022
274272c
fix residualaxisymmetry function name
bigfooted Oct 7, 2022
db034f9
Merge branch 'develop' into fix_sst_axisymmetry
bigfooted Oct 11, 2022
689c525
fix jacobian
bigfooted Oct 11, 2022
69fbb36
Merge branch 'fix_sst_axisymmetry' of https://github.com/su2code/SU2 …
bigfooted Oct 11, 2022
a441ce6
Merge branch 'develop' into fix_sst_axisymmetry
bigfooted Oct 12, 2022
2163cf2
Merge branch 'develop' into fix_sst_axisymmetry
bigfooted Oct 12, 2022
8052d18
add axisymmetric term to strainmag
bigfooted Oct 12, 2022
c9003eb
Merge branch 'fix_sst_axisymmetry' of https://github.com/su2code/SU2 …
bigfooted Oct 12, 2022
ac61eb3
Merge branch 'fix_sst_axisymmetry' of https://github.com/su2code/SU2 …
bigfooted Oct 12, 2022
1f9bb22
Merge branch 'develop' into fix_sst_axisymmetry
bigfooted Oct 13, 2022
20814f5
remove divergence from strain magnitude computation
bigfooted Oct 13, 2022
762fb7e
Merge branch 'temp_axi' into fix_sst_axisymmetry
bigfooted Oct 13, 2022
82827c2
Apply suggestions from code review
pcarruscag Oct 13, 2022
587952f
Merge branch 'develop' into fix_sst_axisymmetry
bigfooted Oct 18, 2022
12010d8
Merge branch 'develop' into fix_sst_axisymmetry
bigfooted Oct 19, 2022
84140d2
Merge branch 'develop' into fix_sst_axisymmetry
bigfooted Nov 1, 2022
4b4ec18
update a number of regression tests
bigfooted Nov 4, 2022
e464afc
update vandv regression
bigfooted Nov 4, 2022
0b24ee5
update vandv regression
bigfooted Nov 4, 2022
170d534
update vandv, restart from start
bigfooted Nov 4, 2022
736ed1c
update vandv, update start+restart air_nozzle case
bigfooted Nov 5, 2022
0c02d88
update vandv, update start+restart residuals
bigfooted Nov 5, 2022
025b436
update parallel_regression, restarts still need to be regenerated
bigfooted Nov 5, 2022
e173d44
remove some unused functions, try to debug AD
pcarruscag Nov 7, 2022
aa2d70d
move coord_i preaccumulation
bigfooted Nov 7, 2022
d207cda
update parallel regression
bigfooted Nov 7, 2022
4084c78
update hybrid regression
bigfooted Nov 7, 2022
25c2aa6
update parallel regression
bigfooted Nov 7, 2022
e5e7571
update hybrid regression restart
bigfooted Nov 7, 2022
d0ebabe
update hybrid regression restart
bigfooted Nov 7, 2022
29b8a6e
update regression restarts
bigfooted Nov 8, 2022
b183ba1
fix regression filenames
bigfooted Nov 9, 2022
2f65e84
Merge branch 'develop' into fix_sst_axisymmetry
bigfooted Nov 11, 2022
870f509
use the develop branch from TestCases which already has the new resta…
pcarruscag Nov 11, 2022
0d359a6
Merge branch 'develop' into fix_sst_axisymmetry
bigfooted Nov 12, 2022
1dabfd3
fix regression
bigfooted Nov 12, 2022
01dfcc8
Merge branch 'fix_sst_axisymmetry' of https://github.com/su2code/SU2 …
bigfooted Nov 12, 2022
0a27612
fix regression
bigfooted Nov 12, 2022
8953248
fix findiff result
bigfooted Nov 12, 2022
f677ac8
Apply suggestions from code review
pcarruscag Nov 12, 2022
0ec40c0
update v&v values
pcarruscag Nov 12, 2022
f9f609e
Apply suggestions from code review
pcarruscag Nov 12, 2022
70d3cbd
Update TestCases/vandv.py
pcarruscag Nov 12, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 16 additions & 13 deletions SU2_CFD/include/numerics/turbulent/turb_sources.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -610,14 +610,11 @@ class CSourcePieceWise_TurbSST final : public CNumerics {
}

/*!
* \brief Add contribution due to axisymmetric formulation to 2D residual
* \brief Add contribution from convection and diffusion due to axisymmetric formulation to 2D residual
*/
inline void ResidualAxisymmetric(su2double alfa_blended, su2double zeta) {
inline void ResidualAxisymmetricConvectionDiffusion(su2double alfa_blended, su2double zeta) {
if (Coord_i[1] < EPS) return;

AD::SetPreaccIn(Coord_i[1]);
AD::SetPreaccIn(V_i[idx.Velocity() + 1]);

const su2double yinv = 1.0 / Coord_i[1];
const su2double rhov = Density_i * V_i[idx.Velocity() + 1];
const su2double& k = ScalarVar_i[0];
Expand All @@ -627,18 +624,20 @@ class CSourcePieceWise_TurbSST final : public CNumerics {
const su2double sigma_k_i = F1_i * sigma_k_1 + (1.0 - F1_i) * sigma_k_2;
const su2double sigma_w_i = F1_i * sigma_w_1 + (1.0 - F1_i) * sigma_w_2;

/*--- Production ---*/
const su2double pk_axi = max(
0.0, 2.0 / 3.0 * rhov * k * ((2.0 * yinv * V_i[idx.Velocity() + 1] - PrimVar_Grad_i[idx.Velocity()+1][1] - PrimVar_Grad_i[idx.Velocity()][0]) / zeta - 1.0));
const su2double pw_axi = alfa_blended * zeta / k * pk_axi;

/*--- Convection-Diffusion ---*/
const su2double cdk_axi = rhov * k - (Laminar_Viscosity_i + sigma_k_i * Eddy_Viscosity_i) * ScalarVar_Grad_i[0][1];
const su2double cdw_axi = rhov * w - (Laminar_Viscosity_i + sigma_w_i * Eddy_Viscosity_i) * ScalarVar_Grad_i[1][1];

/*--- Add terms to the residuals ---*/
Residual[0] += yinv * Volume * (pk_axi - cdk_axi);
Residual[1] += yinv * Volume * (pw_axi - cdw_axi);

Residual[0] -= yinv * Volume * cdk_axi;
Residual[1] -= yinv * Volume * cdw_axi;

Jacobian_i[0][0] = yinv * Volume * rhov;
Jacobian_i[0][1] = 0.0;
Jacobian_i[1][0] = 0.0;
Jacobian_i[1][1] = yinv * Volume * rhov;

}

public:
Expand Down Expand Up @@ -716,6 +715,8 @@ class CSourcePieceWise_TurbSST final : public CNumerics {
AD::SetPreaccIn(PrimVar_Grad_i, nDim + idx.Velocity(), nDim);
AD::SetPreaccIn(Vorticity_i, 3);
AD::SetPreaccIn(V_i[idx.Density()], V_i[idx.LaminarViscosity()], V_i[idx.EddyViscosity()]);
AD::SetPreaccIn(Coord_i[1]);
AD::SetPreaccIn(V_i[idx.Velocity() + 1]);

Density_i = V_i[idx.Density()];
Laminar_Viscosity_i = V_i[idx.LaminarViscosity()];
Expand All @@ -738,6 +739,8 @@ class CSourcePieceWise_TurbSST final : public CNumerics {
su2double diverg = 0.0;
for (unsigned short iDim = 0; iDim < nDim; iDim++)
diverg += PrimVar_Grad_i[iDim + idx.Velocity()][iDim];
if (axisymmetric && Coord_i[1] > EPS) diverg += V_i[idx.Velocity() + 1] / Coord_i[1];


/*--- If using UQ methodolgy, calculate production using perturbed Reynolds stress matrix ---*/

Expand Down Expand Up @@ -818,7 +821,7 @@ class CSourcePieceWise_TurbSST final : public CNumerics {

/*--- Contribution due to 2D axisymmetric formulation ---*/

if (axisymmetric) ResidualAxisymmetric(alfa_blended, zeta);
if (axisymmetric) ResidualAxisymmetricConvectionDiffusion(alfa_blended, zeta);

/*--- Implicit part ---*/

Expand Down