-
Notifications
You must be signed in to change notification settings - Fork 843
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
[WIP] Isothermal streamwise periodicity #1799
base: develop
Are you sure you want to change the base?
Conversation
…h BCs are working, verification study to follow
…dient validation pending
Hi Nitish, can you remove the codi and opdi changes from the PR? This happens when your local codi/opdi is not up to date, so you should update these submodules. |
@bigfooted, Thanks for your comment. I tried but it was not reflected. I see that during the merge with develop the submodule commit keys got updated. Any clues how I can do this ? |
…was failing, this should fix it.
…into feature_isothermalSWP
All tests are now passing, except CodeFactor. But I guess that was there even before I implemented anything. @bigfooted : Thanks for your commit. |
SU2_CFD/src/solvers/CIncNSSolver.cpp
Outdated
const auto AreaNormal = geometry->vertex[iMarker][iVertex]->GetNormal(); | ||
|
||
su2double GradT[MAXNDIM] = {0.0,0.0,0.0}; | ||
for (auto iDim = 0u; iDim < nDim; iDim++) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I have to revert this as GetGradient_Primitive gives a Matrix su2double which does not comply with DotProduct. I saw at other parts of the code for loop being used to construct a variable and then do DotProduct.
Do you know a better way to handle this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, slightly wrong suggestion, do this instead please:
const auto GradT = nodes->GetGradient_Primitive(iPoint)[prim_idx.Temperature()];
Common/src/CConfig.cpp
Outdated
if (Energy_Equation && Streamwise_Periodic_Temperature && nMarker_Isothermal != 0) | ||
SU2_MPI::Error("No MARKER_ISOTHERMAL marker allowed with STREAMWISE_PERIODIC_TEMPERATURE= YES, only MARKER_HEATFLUX & MARKER_SYM.", CURRENT_FUNCTION); | ||
if (Energy_Equation && Streamwise_Periodic_Temperature && nMarker_Isothermal > 0 && nMarker_HeatFlux > 0) | ||
SU2_MPI::Error("MARKER_ISOTHERMAL and MARKER_HEATFLUX are not allowed simultaneously with STREAMWISE_PERIODIC_TEMPERATURE= YES, only one of these is allowed MARKER_ISOTHERMAL, MARKER_HEATFLUX in a fluid zone.", CURRENT_FUNCTION); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you see any edge case that might pass this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks ok but @TobiKattmann should know better
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is still a relevant issue please comment on it to restart the discussion. Thank you for your contributions. |
…into feature_isothermalSWP
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CodeQL found more than 10 potential problems in the proposed changes. Check the Files changed tab for more details.
|
||
// } // points | ||
|
||
// } |
Check notice
Code scanning / CodeQL
Commented-out code Note
// if (turbulent && (config->GetnMarker_Isothermal() != 0)) | ||
// turb_b1_coeff_Local += Temp * nodes->GetAuxVarGradient(iPoint, 0, 0) * config->GetSpecific_Heat_Cp() * volume / config->GetPrandtl_Turb(); | ||
|
||
// Volume_VTemp_Local += volume * Temp * nodes->GetVelocity(iPoint, 2) * nodes->GetDensity(iPoint); |
Check notice
Code scanning / CodeQL
Commented-out code Note
|
||
// Volume_TempS_Local += volume * Temp; | ||
|
||
// Volume_Temp_Local += volume * Temp * nodes->GetThermalConductivity(iPoint); |
Check notice
Code scanning / CodeQL
Commented-out code Note
|
||
// Volume_Local += volume; | ||
|
||
// Volume_TempS_Local += volume * Temp; |
Check notice
Code scanning / CodeQL
Commented-out code Note
|
||
// const su2double Temp = nodes->GetTemperature(iPoint); | ||
|
||
// Volume_Local += volume; |
Check notice
Code scanning / CodeQL
Commented-out code Note
if (implicit) { | ||
|
||
// /*--- Jacobian is set to zero on initialization. ---*/ | ||
|
||
/*--- Compute a scalar factor ---*/ | ||
scalar_factor = SPvals.Streamwise_Periodic_IntegratedHeatFlow / (SPvals.Streamwise_Periodic_MassFlow * sqrt(norm2_translation) * Prandtl_Turb); | ||
// jacobian[nDim+1][nDim+1] = Volume * scalar_factor * dot_product; | ||
|
||
} |
Check notice
Code scanning / CodeQL
Futile conditional Note
if (implicit) { | ||
|
||
// /*--- Jacobian is set to zero on initialization. ---*/ | ||
|
||
// jacobian[nDim+1][nDim+1] -= Volume * scalar_factor * dot_product; | ||
|
||
} |
Check notice
Code scanning / CodeQL
Futile conditional Note
|
||
// /*--- Jacobian is set to zero on initialization. ---*/ | ||
|
||
// jacobian[nDim+1][nDim+1] -= Volume * scalar_factor * dot_product; |
Check notice
Code scanning / CodeQL
Commented-out code Note
|
||
/*--- Compute a scalar factor ---*/ | ||
scalar_factor = SPvals.Streamwise_Periodic_IntegratedHeatFlow / (SPvals.Streamwise_Periodic_MassFlow * sqrt(norm2_translation) * Prandtl_Turb); | ||
// jacobian[nDim+1][nDim+1] = Volume * scalar_factor * dot_product; |
Check notice
Code scanning / CodeQL
Commented-out code Note
for (unsigned short iDim = 0; iDim < nDim; iDim++) { | ||
dot_product += config->GetPeriodic_Translation(0)[iDim]* nodes->GetAuxVarGradient(iPoint, 0, iDim); | ||
} | ||
// su2double dot_product = GeometryToolbox::DotProduct(nDim, config->GetPeriodic_Translation(0), nodes->GetAuxVarGradient(iPoint, 0)); |
Check notice
Code scanning / CodeQL
Commented-out code Note
@@ -162,7 +162,7 @@ | |||
/*--- Boolean true indicates that an input is registered ---*/ | |||
direct_solver->GetNodes()->RegisterSolution(true); | |||
|
|||
direct_solver->RegisterSolutionExtra(true, config); | |||
// direct_solver->RegisterSolutionExtra(true, config); |
Check notice
Code scanning / CodeQL
Commented-out code Note
@@ -299,7 +301,7 @@ | |||
|
|||
direct_solver->GetNodes()->RegisterSolution(false); | |||
|
|||
direct_solver->RegisterSolutionExtra(false, config); | |||
// direct_solver->RegisterSolutionExtra(false, config); |
Check notice
Code scanning / CodeQL
Commented-out code Note
@@ -3510,6 +3517,9 @@ | |||
if ((config->GetStreamwise_Periodic_PressureDrop() != SPPressureDrop_) && (rank == MASTER_NODE)) | |||
cout <<"WARNING: SU2 will use the STREAMWISE_PERIODIC_PRESSURE_DROP provided in the direct solution file: " << std::setprecision(16) << SPPressureDrop_ << endl; | |||
config->SetStreamwise_Periodic_PressureDrop(SPPressureDrop_); | |||
if ((config->GetStreamwise_Periodic_LamdaL() != SPLambdaL_) && (rank == MASTER_NODE)) |
Check notice
Code scanning / CodeQL
Equality test on floating-point values Note
Proposed Changes
Implementation of Streamwise periodic Iso-thermal BCs
Related Work
This is an add-on to the already existing Streamwise periodic flow solver. As a result, there are new source terms which are accounted for in the solution.
PR Checklist
Put an X by all that apply. You can fill this out after submitting the PR. If you have any questions, don't hesitate to ask! We want to help. These are a guide for you to know what the reviewers will be looking for in your contribution.