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

Cleanup wall functions and add user controls #1360

Merged
merged 125 commits into from
Oct 20, 2021
Merged
Show file tree
Hide file tree
Changes from 121 commits
Commits
Show all changes
125 commits
Select commit Hold shift + click to select a range
e5e5d19
fixed wall functions for SA and SST
bigfooted Feb 21, 2021
6be5670
cleaning up wall model implementation
bigfooted Feb 22, 2021
a62a0b8
cleaning up wall model implementation
bigfooted Feb 22, 2021
ecc7d3f
cleaning up wall model implementation
bigfooted Feb 22, 2021
f643214
Merge branch 'develop' into fix_wallfunctions
bigfooted Feb 22, 2021
3705941
Update SU2_CFD/include/solvers/CFVMFlowSolverBase.inl
bigfooted Feb 24, 2021
25fd773
merge develop back in
bigfooted Feb 24, 2021
cc1798f
cleanup based on code review
bigfooted Mar 2, 2021
e17af6d
Merge branch 'fix_wallfunctions' of /~https://github.com/su2code/SU2 in…
bigfooted Mar 2, 2021
76a14b2
Merge branch 'develop' into fix_wallfunctions
pcarruscag Mar 2, 2021
dbde0f7
Update SU2_CFD/include/solvers/CFVMFlowSolverBase.inl
bigfooted Mar 3, 2021
8e4c4b8
Update SU2_CFD/include/solvers/CFVMFlowSolverBase.inl
bigfooted Mar 3, 2021
f7972ae
Update SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp
bigfooted Mar 3, 2021
b15e5f9
Update SU2_CFD/include/solvers/CFVMFlowSolverBase.inl
bigfooted Mar 3, 2021
f3551d8
Update SU2_CFD/include/solvers/CFVMFlowSolverBase.inl
bigfooted Mar 3, 2021
51da480
Update SU2_CFD/include/solvers/CFVMFlowSolverBase.inl
bigfooted Mar 3, 2021
f3f7139
Update SU2_CFD/include/solvers/CFVMFlowSolverBase.inl
bigfooted Mar 3, 2021
de8f6cd
Update SU2_CFD/src/solvers/CTurbSSTSolver.cpp
bigfooted Mar 3, 2021
ae7687e
Update SU2_CFD/include/solvers/CIncNSSolver.hpp
bigfooted Mar 3, 2021
7b61985
small update
bigfooted Mar 17, 2021
3e996bd
Merge branch 'fix_wallfunctions' of /~https://github.com/su2code/SU2 in…
bigfooted Mar 17, 2021
9437a11
Merge branch 'develop' into fix_wallfunctions
bigfooted Mar 17, 2021
658e7cb
Update SU2_CFD/include/solvers/CSolver.hpp
bigfooted Mar 17, 2021
ae47196
fix unused variables update
bigfooted Mar 17, 2021
06898d6
Merge branch 'fix_wallfunctions' of /~https://github.com/su2code/SU2 in…
bigfooted Mar 17, 2021
69e7fe1
fix unused variables update
bigfooted Mar 17, 2021
6d629c8
fix wall model constant config option
bigfooted Mar 18, 2021
0c0e3e6
fixed alignment and missing break statement
bigfooted Mar 20, 2021
fa88243
computing skinfriction when y+ < 5
bigfooted Mar 25, 2021
db32076
Merge remote-tracking branch 'upstream/develop' into develop
bigfooted Apr 1, 2021
4a4549b
merge with develop
bigfooted Apr 1, 2021
995f587
fix unused beta_1
bigfooted Apr 1, 2021
f713575
Merge remote-tracking branch 'upstream/develop' into develop
bigfooted May 18, 2021
e3b34a8
update with develop
bigfooted May 19, 2021
4b82974
fix OMP command
bigfooted May 19, 2021
423a89e
fix OMP command
bigfooted May 19, 2021
a6dc387
update to enum class
bigfooted May 19, 2021
b2fb98c
medi/ninja
bigfooted May 19, 2021
e32750f
remove vscode
bigfooted May 21, 2021
c33db7c
Update SU2_CFD/include/solvers/CTurbSSTSolver.hpp
pcarruscag May 29, 2021
722f3bb
Merge branch 'hybrid_parallel_ad3' into fix_wallfunctions
pcarruscag May 29, 2021
dabd9ee
Apply suggestions from code review
pcarruscag May 29, 2021
af96967
Merge branch 'fix_wallfunctions' of /~https://github.com/su2code/SU2 in…
pcarruscag May 29, 2021
a626425
small cleanup
pcarruscag May 29, 2021
ea38fd5
Merge remote-tracking branch 'upstream/develop' into fix_wallfunctions
pcarruscag May 29, 2021
a5a5835
a little more refactoring
pcarruscag May 29, 2021
fb3c0cc
apply fix from #1120 (do not consider tau wall for edges along wall),…
pcarruscag May 30, 2021
4172408
added config options
bigfooted May 30, 2021
44e5126
fixing wall temperature for wall function
Jun 9, 2021
557b950
Merge remote-tracking branch 'upstream/develop' into fix_wallfunctions
pcarruscag Jun 13, 2021
90723af
some fixes and better warnings
pcarruscag Jun 13, 2021
7ab705c
Merge branch 'develop' into fix_wallfunctions
pcarruscag Jun 15, 2021
9fd30a9
add testcase
bigfooted Jun 15, 2021
7d0d172
add testcase
bigfooted Jun 23, 2021
2b371f8
add config options for wall functions
bigfooted Jul 3, 2021
b874239
Merge branch 'su2code:fix_wallfunctions' into fix_wallfunctions
bigfooted Jul 3, 2021
3306eb9
fix y+ bug
bigfooted Jul 16, 2021
8c0a1f2
added testcase
bigfooted Aug 24, 2021
aa009e0
Merge branch 'develop' into fix_wallfunctions
bigfooted Aug 24, 2021
3a68a3e
remove deleted files CDiscAdFEAVariable
bigfooted Aug 24, 2021
075ef48
update wall temperature for aerodynamic heating
bigfooted Aug 24, 2021
caf9ab7
remove unused variables
bigfooted Aug 24, 2021
8066a23
Update Common/src/CConfig.cpp
bigfooted Aug 24, 2021
3ff82e5
Update SU2_CFD/include/solvers/CFVMFlowSolverBase.inl
bigfooted Aug 24, 2021
ec5ecec
Update Common/include/CConfig.hpp
bigfooted Aug 24, 2021
67b1a53
Update TestCases/wallfunctions/flatplate/turb_SA_flatplate.cfg
bigfooted Aug 24, 2021
1591c7c
Update SU2_CFD/src/solvers/CIncNSSolver.cpp
bigfooted Aug 24, 2021
de13ceb
Update SU2_CFD/src/solvers/CIncNSSolver.cpp
bigfooted Aug 24, 2021
f7d3a6b
Update SU2_CFD/src/solvers/CIncNSSolver.cpp
bigfooted Aug 24, 2021
2d76265
reviewer changes
bigfooted Aug 24, 2021
9a67668
Merge branch 'fix_wallfunctions' of /~https://github.com/bigfooted/SU2 …
bigfooted Aug 24, 2021
d7197e0
update testcase
bigfooted Aug 24, 2021
9f39f7d
Update SU2_CFD/include/solvers/CFVMFlowSolverBase.inl
bigfooted Aug 25, 2021
ea14c02
Update SU2_CFD/include/solvers/CFVMFlowSolverBase.inl
bigfooted Aug 25, 2021
4226dbf
Update SU2_CFD/src/solvers/CIncNSSolver.cpp
bigfooted Aug 25, 2021
b00e0ec
Update SU2_CFD/src/solvers/CIncNSSolver.cpp
bigfooted Aug 25, 2021
5af6111
Update SU2_CFD/src/solvers/CNSSolver.cpp
bigfooted Aug 25, 2021
b268a9d
Update SU2_CFD/src/solvers/CNSSolver.cpp
bigfooted Aug 25, 2021
73f456c
Update SU2_CFD/src/solvers/CNSSolver.cpp
bigfooted Aug 25, 2021
b2db011
Update SU2_CFD/src/solvers/CNSSolver.cpp
bigfooted Aug 25, 2021
0940d87
Update SU2_CFD/src/solvers/CNSSolver.cpp
bigfooted Aug 25, 2021
238c9e5
Update SU2_CFD/src/solvers/CNSSolver.cpp
bigfooted Aug 25, 2021
474cee3
Update SU2_CFD/src/solvers/CTurbSASolver.cpp
bigfooted Aug 25, 2021
310585b
Update SU2_CFD/src/solvers/CTurbSSTSolver.cpp
bigfooted Aug 25, 2021
34a6eff
Update SU2_CFD/src/solvers/CTurbSSTSolver.cpp
bigfooted Aug 25, 2021
322f010
Update SU2_CFD/src/solvers/CNSSolver.cpp
bigfooted Sep 6, 2021
10a69be
change some comments
bigfooted Sep 6, 2021
7c9b447
Update TestCases/wallfunctions/flatplate/turb_SA_flatplate.cfg
bigfooted Sep 6, 2021
3f4c2d0
Update TestCases/wallfunctions/flatplate/turb_SA_flatplate.cfg
bigfooted Sep 6, 2021
827fbbc
Update SU2_CFD/src/solvers/CIncNSSolver.cpp
bigfooted Sep 6, 2021
ec87ed9
add additional testcases
bigfooted Sep 6, 2021
ffba868
Merge branch 'develop' into fix_wallfunctions
bigfooted Sep 6, 2021
dfd2939
added incomp. and comp. testcases
bigfooted Sep 20, 2021
545f139
cleanup of testcases config files
bigfooted Sep 20, 2021
00548d9
Update SU2_CFD/src/solvers/CIncNSSolver.cpp
bigfooted Sep 21, 2021
7f5a342
removed logfile
bigfooted Sep 21, 2021
0ca421f
Update SU2_CFD/src/solvers/CNSSolver.cpp
bigfooted Sep 21, 2021
1dd5c96
added nondimensionalization
bigfooted Sep 29, 2021
bbca88c
Merge branch 'fix_wallfunctions' of /~https://github.com/bigfooted/SU2 …
bigfooted Sep 29, 2021
11cb94e
Merge remote-tracking branch 'origin/develop' into fix_wallfunctions
TobiKattmann Sep 30, 2021
fc03901
Changes to Testcases cfg's. Fix convergence for inc cases.
TobiKattmann Sep 30, 2021
437d1fc
Add '_' in some var names to be consistent with cfg.
TobiKattmann Sep 30, 2021
651d669
Remove unused Wall_Functions Marker from Testcases repo.
TobiKattmann Sep 30, 2021
e48ba40
Remove empty added line.
TobiKattmann Sep 30, 2021
578822e
Rename TauWall functions to Tau_Wall to be consistent with var-name.
TobiKattmann Oct 1, 2021
3daef85
Update reg test vals. Adding more screen output fields.
TobiKattmann Oct 1, 2021
e2cdf26
Merge branch 'fix_wallfunctions' of /~https://github.com/bigfooted/SU2 …
TobiKattmann Oct 1, 2021
5a166b6
Merge remote-tracking branch 'origin/develop' into fix_wallfunctions
TobiKattmann Oct 7, 2021
dde0a9f
Remove unnecessary nondim. All values come from the solver itself.
TobiKattmann Oct 7, 2021
194692c
Const-ing vars in SetTau_Wall_WF func for NS and IncNS.
TobiKattmann Oct 7, 2021
9fe38b7
Rename Conductivity_Ref -> Thermal_Conductivity_Ref.
TobiKattmann Oct 7, 2021
0af828b
else not needed due to continue
pcarruscag Oct 7, 2021
d3b2fed
Minor changes. Comments and moved variable.
TobiKattmann Oct 7, 2021
b0bcd88
Merge branch 'fix_wallfunctions' of /~https://github.com/bigfooted/SU2 …
TobiKattmann Oct 7, 2021
7a7194c
Merge branch 'develop' into fix_wallfunctions
pcarruscag Oct 8, 2021
7d0a480
Merge remote-tracking branch 'origin/develop' into fix_wallfunctions
TobiKattmann Oct 13, 2021
17e52ea
Merge remote-tracking branch 'origin/develop' into fix_wallfunctions
TobiKattmann Oct 13, 2021
dd8d981
do not recompute y+ when wall functions are used
bigfooted Oct 16, 2021
b9e83e7
Update cfg files. Cleaning + formatting.
TobiKattmann Oct 16, 2021
e35cfeb
Merge branch 'develop' into fix_wallfunctions
TobiKattmann Oct 19, 2021
af850b9
Update TestCases/serial_regression.py
pcarruscag Oct 19, 2021
0111ebb
Merge remote-tracking branch 'origin/develop' into fix_wallfunctions
TobiKattmann Oct 19, 2021
9a3804a
Merge branch 'fix_wallfunctions' of /~https://github.com/bigfooted/SU2 …
TobiKattmann Oct 19, 2021
f9a5129
Merge remote-tracking branch 'origin/develop' into fix_wallfunctions
TobiKattmann Oct 19, 2021
d492fb4
Do some checks for the wall function impl in CConfig.
TobiKattmann Oct 19, 2021
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
47 changes: 34 additions & 13 deletions Common/include/CConfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -821,10 +821,13 @@ class CConfig {
Pressure_Thermodynamic, /*!< \brief Thermodynamic pressure of the fluid. */
Temperature_FreeStream, /*!< \brief Total temperature of the fluid. */
Temperature_ve_FreeStream; /*!< \brief Total vibrational-electronic temperature of the fluid. */
su2double Prandtl_Lam, /*!< \brief Laminar Prandtl number for the gas. */
Prandtl_Turb, /*!< \brief Turbulent Prandtl number for the gas. */
wallModelKappa, /*!< \brief von Karman constant kappa for turbulence wall modeling */
wallModelB, /*!< \brief constant B for turbulence wall modeling */
unsigned short wallModel_MaxIter; /*!< \brief maximum number of iterations for the Newton method for the wall model */
su2double wallModel_Kappa, /*!< \brief von Karman constant kappa for turbulence wall modeling */
wallModel_B, /*!< \brief constant B for turbulence wall modeling */
wallModel_RelFac, /*!< \brief relaxation factor for the Newton method used in the wall model */
wallModel_MinYplus; /*!< \brief minimum Y+ value, below which the wall model is not used anymore */
su2double Prandtl_Lam, /*!< \brief Laminar Prandtl number for the gas. */
Prandtl_Turb, /*!< \brief Turbulent Prandtl number for the gas. */
Length_Ref, /*!< \brief Reference length for non-dimensionalization. */
Pressure_Ref, /*!< \brief Reference pressure for non-dimensionalization. */
Temperature_Ref, /*!< \brief Reference temperature for non-dimensionalization.*/
Expand All @@ -833,7 +836,7 @@ class CConfig {
Velocity_Ref, /*!< \brief Reference velocity for non-dimensionalization.*/
Time_Ref, /*!< \brief Reference time for non-dimensionalization. */
Viscosity_Ref, /*!< \brief Reference viscosity for non-dimensionalization. */
Conductivity_Ref, /*!< \brief Reference conductivity for non-dimensionalization. */
Thermal_Conductivity_Ref, /*!< \brief Reference conductivity for non-dimensionalization. */
Energy_Ref, /*!< \brief Reference viscosity for non-dimensionalization. */
Wall_Temperature, /*!< \brief Temperature at an isotropic wall in Kelvin. */
Omega_Ref, /*!< \brief Reference angular velocity for non-dimensionalization. */
Expand Down Expand Up @@ -1671,13 +1674,31 @@ class CConfig {
* \brief Get the value of the von Karman constant kappa for turbulence wall modeling.
* \return von Karman constant.
*/
su2double GetwallModelKappa(void) const { return wallModelKappa; }
su2double GetwallModel_Kappa() const { return wallModel_Kappa; }

/*!
* \brief Get the value of the von Karman constant kappa for turbulence wall modeling.
* \return von Karman constant.
* \brief Get the value of the max. number of Newton iterations for turbulence wall modeling.
* \return Max number of iterations.
*/
unsigned short GetwallModel_MaxIter() const { return wallModel_MaxIter; }

/*!
* \brief Get the value of the relaxation factor for turbulence wall modeling.
* \return Relaxation factor.
*/
su2double GetwallModel_RelFac() const { return wallModel_RelFac; }

/*!
* \brief Get the value of the minimum Y+ value below which the wall function is deactivated.
* \return Minimum Y+ value.
*/
su2double GetwallModel_MinYPlus() const { return wallModel_MinYplus; }

/*!
* \brief Get the value of the wall model constant B for turbulence wall modeling.
* \return Wall model constant B.
*/
su2double GetwallModelB(void) const { return wallModelB; }
su2double GetwallModel_B() const { return wallModel_B; }

/*!
* \brief Get the value of the thermal diffusivity for solids.
Expand Down Expand Up @@ -1753,10 +1774,10 @@ class CConfig {
su2double GetFan_Poly_Eff(void) const { return Fan_Poly_Eff; }

/*!
* \brief Get the value of the reference conductivity for non-dimensionalization.
* \return Reference conductivity for non-dimensionalization.
* \brief Get the value of the reference thermal conductivity for non-dimensionalization.
* \return Reference thermal conductivity for non-dimensionalization.
*/
su2double GetConductivity_Ref(void) const { return Conductivity_Ref; }
su2double GetThermal_Conductivity_Ref(void) const { return Thermal_Conductivity_Ref; }

/*!
* \brief Get the value of the reference angular velocity for non-dimensionalization.
Expand Down Expand Up @@ -2376,7 +2397,7 @@ class CConfig {
* \brief Set the reference conductivity for nondimensionalization.
* \param[in] val_conductivity_ref - Value of the reference conductivity.
*/
void SetConductivity_Ref(su2double val_conductivity_ref) { Conductivity_Ref = val_conductivity_ref; }
void SetConductivity_Ref(su2double val_conductivity_ref) { Thermal_Conductivity_Ref = val_conductivity_ref; }

/*!
* \brief Set the nondimensionalized freestream pressure.
Expand Down
29 changes: 22 additions & 7 deletions Common/src/CConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1223,10 +1223,20 @@ void CConfig::SetConfig_Options() {
addDoubleOption("PRANDTL_LAM", Prandtl_Lam, 0.72);
/*!\brief PRANDTL_TURB \n DESCRIPTION: Turbulent Prandtl number (0.9 (air), only for compressible flows) \n DEFAULT 0.90 \ingroup Config*/
addDoubleOption("PRANDTL_TURB", Prandtl_Turb, 0.90);
/*!\brief WALLMODELKAPPA \n DESCRIPTION: von Karman constant used for the wall model \n DEFAULT 0.41 \ingroup Config*/
addDoubleOption("WALLMODELKAPPA", wallModelKappa, 0.41);
/*!\brief WALLMODELB \n DESCRIPTION: constant B used for the wall model \n DEFAULT 5.0 \ingroup Config*/
addDoubleOption("WALLMODELB", wallModelB, 5.5);

/*--- Options related to wall models. ---*/

/*!\brief WALLMODEL_KAPPA \n DESCRIPTION: von Karman constant used for the wall model \n DEFAULT 0.41 \ingroup Config*/
addDoubleOption("WALLMODEL_KAPPA", wallModel_Kappa, 0.41);
/*!\brief WALLMODEL_MAXITER \n DESCRIPTION: Max iterations used for the wall model \n DEFAULT 200 \ingroup Config*/
addUnsignedShortOption("WALLMODEL_MAXITER", wallModel_MaxIter, 200);
/*!\brief WALLMODEL_RELFAC \n DESCRIPTION: Relaxation factor used for the wall model \n DEFAULT 0.5 \ingroup Config*/
addDoubleOption("WALLMODEL_RELFAC", wallModel_RelFac, 0.5);
/*!\brief WALLMODEL_MINYPLUS \n DESCRIPTION: lower limit for Y+ used for the wall model \n DEFAULT 5.0 \ingroup Config*/
addDoubleOption("WALLMODEL_MINYPLUS", wallModel_MinYplus, 5.0);
/*!\brief WALLMODEL_B \n DESCRIPTION: constant B used for the wall model \n DEFAULT 5.5 \ingroup Config*/
addDoubleOption("WALLMODEL_B", wallModel_B, 5.5);

/*!\brief BULK_MODULUS \n DESCRIPTION: Value of the Bulk Modulus \n DEFAULT 1.42E5 \ingroup Config*/
addDoubleOption("BULK_MODULUS", Bulk_Modulus, 1.42E5);
/* DESCRIPTION: Epsilon^2 multipier in Beta calculation for incompressible preconditioner. */
Expand Down Expand Up @@ -3295,11 +3305,16 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i
if (Kind_WallFunctions[iMarker] != WALL_FUNCTIONS::NONE)
Wall_Functions = true;

if ((Kind_WallFunctions[iMarker] == WALL_FUNCTIONS::ADAPTIVE_FUNCTION) || (Kind_WallFunctions[iMarker] == WALL_FUNCTIONS::SCALABLE_FUNCTION)
|| (Kind_WallFunctions[iMarker] == WALL_FUNCTIONS::NONEQUILIBRIUM_MODEL))

if ((Kind_WallFunctions[iMarker] == WALL_FUNCTIONS::ADAPTIVE_FUNCTION) ||
(Kind_WallFunctions[iMarker] == WALL_FUNCTIONS::SCALABLE_FUNCTION) ||
(Kind_WallFunctions[iMarker] == WALL_FUNCTIONS::NONEQUILIBRIUM_MODEL))
SU2_MPI::Error(string("For RANS problems, use NONE, STANDARD_WALL_FUNCTION or EQUILIBRIUM_WALL_MODEL.\n"), CURRENT_FUNCTION);

if (Kind_WallFunctions[iMarker] == WALL_FUNCTIONS::STANDARD_FUNCTION) {
/// TODO TK:: Add warnings, errors, incompatibilities here.

}
TobiKattmann marked this conversation as resolved.
Show resolved Hide resolved

}
}

Expand Down
2 changes: 1 addition & 1 deletion Common/src/wall_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ CWallModel::CWallModel(CConfig *config) {
Pr_lam = config->GetPrandtl_Lam();
Pr_turb = config->GetPrandtl_Turb();

karman = config->GetwallModelKappa(); // von Karman constant -> k = 0.41; or 0.38;
karman = config->GetwallModel_Kappa(); // von Karman constant -> k = 0.41; or 0.38;
}

void CWallModel::WallShearStressAndHeatFlux(const su2double rhoExchange,
Expand Down
2 changes: 1 addition & 1 deletion SU2_CFD/include/numerics/CNumerics.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1554,7 +1554,7 @@ class CNumerics {
* \param[in] val_tauwall_i - Tauwall at point i
* \param[in] val_tauwall_j - Tauwall at point j
*/
inline virtual void SetTauWall(su2double val_tauwall_i, su2double val_tauwall_j) { }
inline virtual void SetTau_Wall(su2double val_tauwall_i, su2double val_tauwall_j) { }

/*!
* \brief - Calculate the central/upwind blending function for a face
Expand Down
2 changes: 1 addition & 1 deletion SU2_CFD/include/numerics/flow/flow_diffusion.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ class CAvgGrad_Base : public CNumerics {
* \param[in] val_tauwall_i - Value of the wall shear stress at point i.
* \param[in] val_tauwall_j - Value of the wall shear stress at point j.
*/
inline void SetTauWall(su2double val_tauwall_i, su2double val_tauwall_j) override {
inline void SetTau_Wall(su2double val_tauwall_i, su2double val_tauwall_j) override {
TauWall_i = val_tauwall_i;
TauWall_j = val_tauwall_j;
}
Expand Down
2 changes: 1 addition & 1 deletion SU2_CFD/include/numerics_simd/flow/diffusion/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ FORCEINLINE void addQCR(const MatrixType& grad, MatrixDbl<nDim>& tau) {

/*!
* \brief Scale the stress tensor according to the target (from a
* wall function) magnitute in the tangential direction.
TobiKattmann marked this conversation as resolved.
Show resolved Hide resolved
* wall function) magnitude in the tangential direction.
*/
template<class Container, size_t nDim>
FORCEINLINE void addTauWall(Int iPoint, Int jPoint,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ class CCompressibleViscousFluxBase : public CNumericsSIMD {
addPerturbedRSM(avgV, avgGrad, turb_ke, tau,
uq_eigval_comp, uq_permute, uq_delta_b, uq_urlx);
}
if(wallFun) addTauWall(iPoint, jPoint, solution.GetTauWall(), unitNormal, tau);

TobiKattmann marked this conversation as resolved.
Show resolved Hide resolved
if(wallFun) addTauWall(iPoint, jPoint, solution.GetTau_Wall(), unitNormal, tau);

Double cond = derived->thermalConductivity(avgV);
VectorDbl<nDim> heatFlux;
Expand Down
50 changes: 29 additions & 21 deletions SU2_CFD/include/solvers/CFVMFlowSolverBase.inl
Original file line number Diff line number Diff line change
Expand Up @@ -443,8 +443,8 @@ void CFVMFlowSolverBase<V, R>::Viscous_Residual_impl(unsigned long iEdge, CGeome

/*--- Wall shear stress values (wall functions) ---*/

numerics->SetTauWall(nodes->GetTauWall(iPoint),
nodes->GetTauWall(jPoint));
numerics->SetTau_Wall(nodes->GetTau_Wall(iPoint),
nodes->GetTau_Wall(jPoint));

/*--- Compute and update residual ---*/

Expand Down Expand Up @@ -2393,10 +2393,11 @@ void CFVMFlowSolverBase<V, FlowRegime>::Friction_Forces(const CGeometry* geometr
unsigned long iVertex, iPoint, iPointNormal;
unsigned short iMarker, iMarker_Monitoring, iDim, jDim;
unsigned short T_INDEX = 0, TVE_INDEX = 0, VEL_INDEX = 0;
su2double Viscosity = 0.0, WallDist[3] = {0.0}, Area, Density = 0.0, GradTemperature = 0.0,
UnitNormal[3] = {0.0}, TauElem[3] = {0.0}, TauTangent[3] = {0.0}, Tau[3][3] = {{0.0}}, Cp,
su2double Viscosity = 0.0, Area, Density = 0.0, GradTemperature = 0.0, WallDistMod, FrictionVel,
UnitNormal[3] = {0.0}, TauElem[3] = {0.0}, Tau[3][3] = {{0.0}}, Cp,
thermal_conductivity, MaxNorm = 8.0, Grad_Vel[3][3] = {{0.0}}, Grad_Temp[3] = {0.0}, AxiFactor;
const su2double *Coord = nullptr, *Coord_Normal = nullptr, *Normal = nullptr;
const su2double minYPlus = config->GetwallModel_MinYPlus();

string Marker_Tag, Monitoring_Tag;

Expand Down Expand Up @@ -2526,30 +2527,37 @@ void CFVMFlowSolverBase<V, FlowRegime>::Friction_Forces(const CGeometry* geometr
/*--- Compute wall shear stress (using the stress tensor). Compute wall skin friction coefficient, and heat flux
* on the wall ---*/

su2double TauNormal = GeometryToolbox::DotProduct(nDim, TauElem, UnitNormal);
su2double TauTangent[MAXNDIM] = {0.0};
GeometryToolbox::TangentProjection(nDim, Tau, UnitNormal, TauTangent);

for (iDim = 0; iDim < nDim; iDim++) {
TauTangent[iDim] = TauElem[iDim] - TauNormal * UnitNormal[iDim];
/* --- in case of wall functions, we have computed the skin friction in the turbulence solver --- */
/* --- Note that in the wall model, we switch off the computation when the computed y+ < 5 --- */
/* --- We put YPlus to 1.0 so we have to compute skinfriction and the actual y+ in that case as well --- */
if (!wallfunctions || (wallfunctions && YPlus[iMarker][iVertex] < 5.0))
CSkinFriction[iMarker](iVertex,iDim) = TauTangent[iDim] * factorFric;
WallShearStress[iMarker][iVertex] = GeometryToolbox::Norm(int(MAXNDIM), TauTangent);

/*--- For wall functions, the wall stresses need to be scaled by the wallfunction stress Tau_Wall---*/
su2double Tau_Wall, scale;
if (wallfunctions && (YPlus[iMarker][iVertex] > minYPlus)){
Tau_Wall = nodes->GetTau_Wall(iPoint);
scale = Tau_Wall / WallShearStress[iMarker][iVertex];
for (iDim = 0; iDim < nDim; iDim++) {
TauTangent[iDim] *= scale;
TauElem[iDim] *= scale;
}

WallShearStress[iMarker][iVertex] = Tau_Wall;
}
WallShearStress[iMarker][iVertex] = GeometryToolbox::Norm(nDim, TauTangent);

for (iDim = 0; iDim < nDim; iDim++) WallDist[iDim] = (Coord[iDim] - Coord_Normal[iDim]);

su2double WallDistMod = GeometryToolbox::Norm(nDim, WallDist);
for (iDim = 0; iDim < nDim; iDim++) {
CSkinFriction[iMarker](iVertex,iDim) = TauTangent[iDim] * factorFric;
}

/*--- Compute y+ and non-dimensional velocity ---*/
WallDistMod = GeometryToolbox::Distance(nDim, Coord, Coord_Normal);

su2double FrictionVel = sqrt(fabs(WallShearStress[iMarker][iVertex]) / Density);
/*--- Compute non-dimensional velocity and y+ ---*/

/* --- in case of wall functions, we have computed YPlus in the turbulence class --- */
/* --- Note that we do not recompute y+ when y+<5 because y+ can become > 5 again --- */
if (!wallfunctions)
FrictionVel = sqrt(fabs(WallShearStress[iMarker][iVertex]) / Density);

if (!wallfunctions) {
YPlus[iMarker][iVertex] = WallDistMod * FrictionVel / (Viscosity / Density);
}

/*--- Compute total and maximum heat flux on the wall ---*/

Expand Down
2 changes: 1 addition & 1 deletion SU2_CFD/include/solvers/CIncNSSolver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class CIncNSSolver final : public CIncEulerSolver {
* \param[in] solver_container - Container vector with all the solutions.
* \param[in] config - Definition of the particular problem.
*/
void SetTauWall_WF(CGeometry *geometry,
void SetTau_Wall_WF(CGeometry *geometry,
CSolver** solver_container,
const CConfig* config);

Expand Down
2 changes: 1 addition & 1 deletion SU2_CFD/include/solvers/CNEMONSSolver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class CNEMONSSolver final : public CNEMOEulerSolver {
* \param[in] solver_container - Container vector with all the solutions.
* \param[in] config - Definition of the particular problem.
*/
void SetTauWall_WF(CGeometry *geometry, CSolver** solver_container, const CConfig* config);
void SetTau_Wall_WF(CGeometry *geometry, CSolver** solver_container, const CConfig* config);

public:

Expand Down
2 changes: 1 addition & 1 deletion SU2_CFD/include/solvers/CNSSolver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class CNSSolver final : public CEulerSolver {
* \param[in] solver_container - Container vector with all the solutions.
* \param[in] config - Definition of the particular problem.
*/
void SetTauWall_WF(CGeometry *geometry, CSolver** solver_container, const CConfig* config);
void SetTau_Wall_WF(CGeometry *geometry, CSolver** solver_container, const CConfig* config);

public:
/*!
Expand Down
13 changes: 13 additions & 0 deletions SU2_CFD/include/variables/CIncNSVariable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
*/
class CIncNSVariable final : public CIncEulerVariable {
private:
VectorType Tau_Wall; /*!< \brief Magnitude of the wall shear stress from a wall function. */
VectorType DES_LengthScale;

public:
Expand Down Expand Up @@ -100,6 +101,18 @@ class CIncNSVariable final : public CIncEulerVariable {
bool SetPrimVar(unsigned long iPoint, su2double eddy_visc, su2double turb_ke, CFluidModel *FluidModel) override;
using CVariable::SetPrimVar;

/*!
* \brief Set the value of the wall shear stress computed by a wall function.
*/
inline void SetTau_Wall(unsigned long iPoint, su2double tau_wall) override { Tau_Wall(iPoint) = tau_wall; }

/*!
* \brief Get the value of the wall shear stress computed by a wall function.
* \return Value of the wall shear stress computed by a wall function.
*/
inline su2double GetTau_Wall(unsigned long iPoint) const override { return Tau_Wall(iPoint); }
inline const VectorType& GetTau_Wall() const { return Tau_Wall; }

/*!
* \brief Set the DES Length Scale.
*/
Expand Down
6 changes: 3 additions & 3 deletions SU2_CFD/include/variables/CNSVariable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,14 +158,14 @@ class CNSVariable final : public CEulerVariable {
/*!
* \brief Set the value of the wall shear stress computed by a wall function.
*/
inline void SetTauWall(unsigned long iPoint, su2double val_tau_wall) override { Tau_Wall(iPoint) = val_tau_wall; }
inline void SetTau_Wall(unsigned long iPoint, su2double tau_wall) override { Tau_Wall(iPoint) = tau_wall; }

/*!
* \brief Get the value of the wall shear stress computed by a wall function.
* \return Value of the wall shear stress computed by a wall function.
*/
inline su2double GetTauWall(unsigned long iPoint) const override { return Tau_Wall(iPoint); }
inline const VectorType& GetTauWall() const { return Tau_Wall; }
inline su2double GetTau_Wall(unsigned long iPoint) const override { return Tau_Wall(iPoint); }
inline const VectorType& GetTau_Wall() const { return Tau_Wall; }

/*!
* \brief Get the DES length scale
Expand Down
4 changes: 2 additions & 2 deletions SU2_CFD/include/variables/CVariable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2159,9 +2159,9 @@ class CVariable {
*/
inline virtual su2double GetSensitivity(unsigned long iPoint, unsigned long iDim) const { return 0.0; }

inline virtual void SetTauWall(unsigned long iPoint, su2double val_tau_wall) {}
inline virtual void SetTau_Wall(unsigned long iPoint, su2double tau_wall) {}

inline virtual su2double GetTauWall(unsigned long iPoint) const { return 0.0; }
inline virtual su2double GetTau_Wall(unsigned long iPoint) const { return 0.0; }

inline virtual void SetVortex_Tilting(unsigned long iPoint, CMatrixView<const su2double> PrimGrad_Flow,
const su2double* Vorticity, su2double LaminarViscosity) {}
Expand Down
2 changes: 1 addition & 1 deletion SU2_CFD/src/interfaces/cht/CConjugateHeatInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ void CConjugateHeatInterface::GetDonor_Variable(CSolver *donor_solution, CGeomet
switch (donor_config->GetKind_ConductivityModel()) {

case CONDUCTIVITYMODEL::CONSTANT:
thermal_conductivity = thermal_conductivityND*donor_config->GetConductivity_Ref();
thermal_conductivity = thermal_conductivityND*donor_config->GetThermal_Conductivity_Ref();
break;

case CONDUCTIVITYMODEL::CONSTANT_PRANDTL:
Expand Down
2 changes: 1 addition & 1 deletion SU2_CFD/src/output/CFlowOutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1807,7 +1807,7 @@ void CFlowOutput::WriteForcesBreakdown(const CConfig* config, const CSolver* flo
file << "Reference viscosity: " << config->GetViscosity_Ref();
if (si_units) file << " N.s/m^2.\n";
else file << " lbf.s/ft^2.\n";
file << "Reference conductivity: " << config->GetConductivity_Ref();
file << "Reference conductivity: " << config->GetThermal_Conductivity_Ref();
if (si_units) file << " W/m^2.K.\n";
else file << " lbf/ft.s.R.\n";
}
Expand Down
2 changes: 1 addition & 1 deletion SU2_CFD/src/output/output_structure_legacy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3122,7 +3122,7 @@ void COutputLegacy::SpecialOutput_ForcesBreakdown(CSolver *****solver, CGeometry
if (config[val_iZone]->GetSystemMeasurements() == SI) Breakdown_file << " N.s/m^2." << "\n";
else if (config[val_iZone]->GetSystemMeasurements() == US) Breakdown_file << " lbf.s/ft^2." << "\n";
if (compressible){
Breakdown_file << "Reference conductivity: " << config[val_iZone]->GetConductivity_Ref();
Breakdown_file << "Reference conductivity: " << config[val_iZone]->GetThermal_Conductivity_Ref();
if (config[val_iZone]->GetSystemMeasurements() == SI) Breakdown_file << " W/m^2.K." << "\n";
else if (config[val_iZone]->GetSystemMeasurements() == US) Breakdown_file << " lbf/ft.s.R." << "\n";
}
Expand Down
Loading