Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
944efc7
Create CScalar<solver/var> and scalar_conv/diff/source layer and put …
TobiKattmann Jul 21, 2021
7342a32
opy turb testcases to front for faster local testing. Will be reverted
TobiKattmann Jul 21, 2021
7d0e6a4
Merge remote-tracking branch 'origin/develop' into feature_scalarbase
TobiKattmann Aug 12, 2021
a005a95
Merge remote-tracking branch 'origin/develop' into feature_scalarbase
TobiKattmann Aug 13, 2021
c3ad054
Merge remote-tracking branch 'origin/develop' into feature_scalarbase
TobiKattmann Aug 16, 2021
519178f
Move back turb-specific diffusion numerics.
TobiKattmann Aug 16, 2021
3472dac
Move back turb-specific convection numerics.
TobiKattmann Aug 16, 2021
6f684f9
Move back turb-specific source numerics.
TobiKattmann Aug 16, 2021
0837245
Merge remote-tracking branch 'origin/develop' into feature_scalarbase
TobiKattmann Aug 17, 2021
51bbc84
Move muT and HBSources back to Turb Solver
TobiKattmann Aug 23, 2021
2fe2d2a
Merge remote-tracking branch 'origin/develop' into feature_scalarbase
TobiKattmann Aug 23, 2021
bf12017
Push some Functions back from CScalarSolver to CTurbSolver.
TobiKattmann Aug 23, 2021
c922bc6
I am just asking some questions :)
TobiKattmann Aug 23, 2021
411f807
A few chores to make the diff smaller.
TobiKattmann Aug 23, 2021
8d16256
Delete some uncessary functions.
TobiKattmann Aug 23, 2021
336852f
Some very minor changes to make the diff smaller
TobiKattmann Aug 23, 2021
2afbfd6
Merge remote-tracking branch 'origin/develop' into feature_scalarbase
TobiKattmann Aug 24, 2021
98a302e
Change SetTurbVar* to SetScalarVar*.
TobiKattmann Aug 25, 2021
9ba9167
Changing CNumerics class var TurbVar* to ScalarVar*.
TobiKattmann Aug 25, 2021
81d4b42
Changing CNumerics class var TurbVar_Grad* to ScalarVar_Grad*.
TobiKattmann Aug 25, 2021
19511cd
Merge remote-tracking branch 'origin/develop' into feature_scalarbase
TobiKattmann Aug 25, 2021
86e608d
Rename Turb->Scalar var in scalar_diffusion.
TobiKattmann Aug 25, 2021
273fc39
Remove seemingly unused var in CTurbsolver.hpp/cpp.
TobiKattmann Aug 25, 2021
7c06119
Add new files to old build system.
TobiKattmann Aug 27, 2021
63dcf11
Revert "I am just asking some questions :)"
TobiKattmann Aug 27, 2021
076bfcd
Move ComputeUnderRelaxation to CTurbSASolver.
TobiKattmann Aug 27, 2021
eb360d9
Update SU2 version on added scalar files.
TobiKattmann Aug 27, 2021
d9a5e4d
Move HB_Source back from CTurbVariable to CScalarVariable.
TobiKattmann Aug 27, 2021
987d60e
Make empty BC_Sym/BC_EulerWall of CScalar inline and remove cpp impl.
TobiKattmann Aug 27, 2021
0b60a28
SA UnderRelax error fixed.
TobiKattmann Aug 27, 2021
ab6d8e6
Apply clang-format to (C)scalar* files. Changes necessary.
TobiKattmann Aug 27, 2021
b829194
Merge branch 'feature_scalarbase' of https://github.com/su2code/su2 i…
TobiKattmann Aug 27, 2021
c7867b7
Merge remote-tracking branch 'origin/develop' into feature_scalarbase
TobiKattmann Aug 27, 2021
a3a5ccb
Apply suggestions from code review. Comment changes.
TobiKattmann Aug 27, 2021
dc36880
Merge remote-tracking branch 'origin/develop' into feature_scalarbase
TobiKattmann Aug 31, 2021
13007f9
Manually resolve some clang-format issues.
TobiKattmann Aug 31, 2021
b465ef4
Introduce Conservative Var. Make CompleteImplicitIteration general.
TobiKattmann Aug 31, 2021
74cc116
Equivalent Change to Scalar CompleteImplicitIteration
TobiKattmann Aug 31, 2021
6b9f276
Fix reg tests. numeric_limits<>::min returns lowest positive value. Use
TobiKattmann Sep 1, 2021
2ba9a72
Make Scalar DualTimeRes independet of Turb specifics.
TobiKattmann Sep 1, 2021
2d2be7d
Init lower/upperlimit for sol.clipping in ctor of CScalarSolver.
TobiKattmann Sep 1, 2021
817186f
Make distinction for (non)Conservative solution updates for the scalar
TobiKattmann Sep 1, 2021
044f53f
Fix nVar bug in CScalarolver.
TobiKattmann Sep 1, 2021
cb99a16
Fix Dual Time Derivative for CScalarSolver.
TobiKattmann Sep 1, 2021
66aec2e
Merge remote-tracking branch 'origin/develop' into feature_scalarbase
TobiKattmann Sep 8, 2021
462e95c
Apply suggestions from code review
TobiKattmann Sep 9, 2021
ed80960
Use rho=1 trick for non-Conservative scalars for dynamic grids.
TobiKattmann Sep 9, 2021
4ea9529
Move Get/SetHB_source from TurbSA to ScalarVariable.
TobiKattmann Sep 9, 2021
a5ab979
Merge branch 'develop' into feature_scalarbase
TobiKattmann Sep 15, 2021
11ba64a
Merge remote-tracking branch 'origin/develop' into feature_scalarbase
TobiKattmann Sep 16, 2021
3e975d3
Add a generic Visc_res_impl in ScalarSolver. Template the specific
TobiKattmann Sep 16, 2021
3e86076
Change struct to a lambda function.
TobiKattmann Sep 16, 2021
1d8f520
Add empty SolverSpecificNumerics to generic ViscRes_impl.
TobiKattmann Sep 16, 2021
7cc2e8d
updating some comments, and override -> final where possible
pcarruscag Sep 17, 2021
2d45f9c
Merge remote-tracking branch 'origin/develop' into feature_scalarbase
TobiKattmann Sep 21, 2021
4055011
Merge branch 'feature_scalarbase' of https://github.com/su2code/SU2 i…
TobiKattmann Sep 22, 2021
ca16276
Template CScalarSolver on type of CVariable.
TobiKattmann Sep 22, 2021
811d581
Apply clang-format and some other cleanups.
TobiKattmann Sep 22, 2021
58d3df3
Make Scalar LoadRestart pure virtual.
TobiKattmann Sep 22, 2021
443190f
Rename to VariableType and Remove duplicate compilations due to templ…
TobiKattmann Sep 22, 2021
b123fb5
Change forgotten TVariable to VariableType
TobiKattmann Sep 22, 2021
2b18052
Small changes. Added newline to eof and one comment change.
TobiKattmann Sep 22, 2021
6f8e69a
Rename TVariable to VariableType in CScalarSolver.inl.
TobiKattmann Sep 22, 2021
0b88e40
Merge branch 'feature_scalarbase' of https://github.com/su2code/SU2 i…
TobiKattmann Sep 22, 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
34 changes: 17 additions & 17 deletions SU2_CFD/include/numerics/CNumerics.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ class CNumerics {
*Psi_i, /*!< \brief Vector of adjoint variables at point i. */
*Psi_j; /*!< \brief Vector of adjoint variables at point j. */
const su2double
*TurbVar_i, /*!< \brief Vector of turbulent variables at point i. */
*TurbVar_j; /*!< \brief Vector of turbulent variables at point j. */
*ScalarVar_i, /*!< \brief Vector of scalar variables at point i. */
*ScalarVar_j; /*!< \brief Vector of scalar variables at point j. */
const su2double
*TransVar_i, /*!< \brief Vector of turbulent variables at point i. */
*TransVar_j; /*!< \brief Vector of turbulent variables at point j. */
Expand All @@ -146,8 +146,8 @@ class CNumerics {
PrimVar_Grad_j, /*!< \brief Gradient of primitive variables at point j. */
PsiVar_Grad_i, /*!< \brief Gradient of adjoint variables at point i. */
PsiVar_Grad_j, /*!< \brief Gradient of adjoint variables at point j. */
TurbVar_Grad_i, /*!< \brief Gradient of turbulent variables at point i. */
TurbVar_Grad_j, /*!< \brief Gradient of turbulent variables at point j. */
ScalarVar_Grad_i, /*!< \brief Gradient of scalar variables at point i. */
ScalarVar_Grad_j, /*!< \brief Gradient of scalar variables at point j. */
TransVar_Grad_i, /*!< \brief Gradient of turbulent variables at point i. */
TransVar_Grad_j, /*!< \brief Gradient of turbulent variables at point j. */
TurbPsi_Grad_i, /*!< \brief Gradient of adjoint turbulent variables at point i. */
Expand Down Expand Up @@ -347,13 +347,13 @@ class CNumerics {
}

/*!
* \brief Set the value of the turbulent variable.
* \param[in] val_turbvar_i - Value of the turbulent variable at point i.
* \param[in] val_turbvar_j - Value of the turbulent variable at point j.
* \brief Set the value of the scalar variable.
* \param[in] val_scalarvar_i - Value of the scalar variable at point i.
* \param[in] val_scalarvar_j - Value of the scalar variable at point j.
*/
inline void SetTurbVar(const su2double *val_turbvar_i, const su2double *val_turbvar_j) {
TurbVar_i = val_turbvar_i;
TurbVar_j = val_turbvar_j;
inline void SetScalarVar(const su2double *val_scalarvar_i, const su2double *val_scalarvar_j) {
ScalarVar_i = val_scalarvar_i;
ScalarVar_j = val_scalarvar_j;
}

/*!
Expand All @@ -367,14 +367,14 @@ class CNumerics {
}

/*!
* \brief Set the gradient of the turbulent variables.
* \param[in] val_turbvar_grad_i - Gradient of the turbulent variable at point i.
* \param[in] val_turbvar_grad_j - Gradient of the turbulent variable at point j.
* \brief Set the gradient of the scalar variables.
* \param[in] val_scalarvar_grad_i - Gradient of the scalar variable at point i.
* \param[in] val_scalarvar_grad_j - Gradient of the scalar variable at point j.
*/
inline void SetTurbVarGradient(CMatrixView<const su2double> val_turbvar_grad_i,
CMatrixView<const su2double> val_turbvar_grad_j) {
TurbVar_Grad_i = val_turbvar_grad_i;
TurbVar_Grad_j = val_turbvar_grad_j;
inline void SetScalarVarGradient(CMatrixView<const su2double> val_scalarvar_grad_i,
CMatrixView<const su2double> val_scalarvar_grad_j) {
ScalarVar_Grad_i = val_scalarvar_grad_i;
ScalarVar_Grad_j = val_scalarvar_grad_j;
}

/*!
Expand Down
89 changes: 89 additions & 0 deletions SU2_CFD/include/numerics/scalar/scalar_convection.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
/*!
* \file scalar_convection.hpp
* \brief Delarations of numerics classes for discretization of
* convective fluxes in scalar problems.
* \author F. Palacios, T. Economon
* \version 7.2.0 "Blackbird"
*
* SU2 Project Website: https://su2code.github.io
*
* The SU2 Project is maintained by the SU2 Foundation
* (http://su2foundation.org)
*
* Copyright 2012-2021, SU2 Contributors (cf. AUTHORS.md)
*
* SU2 is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* SU2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with SU2. If not, see <http://www.gnu.org/licenses/>.
*/

#pragma once

#include "../CNumerics.hpp"

/*!
* \class CUpwScalar
* \brief Template class for scalar upwind fluxes between nodes i and j.
* \details This class serves as a template for the scalar upwinding residual
* classes. The general structure of a scalar upwinding calculation is the
* same for many different models, which leads to a lot of repeated code.
* By using the template design pattern, these sections of repeated code are
* moved to this shared base class, and the specifics of each model
* are implemented by derived classes. In order to add a new residual
* calculation for a convection residual, extend this class and implement
* the pure virtual functions with model-specific behavior.
* \ingroup ConvDiscr
* \author C. Pederson, A. Bueno., and A. Campos.
*/
class CUpwScalar : public CNumerics {
protected:
su2double a0 = 0.0; /*!< \brief The maximum of the face-normal velocity and 0 */
su2double a1 = 0.0; /*!< \brief The minimum of the face-normal velocity and 0 */
su2double* Flux = nullptr; /*!< \brief Final result, diffusive flux/residual. */
su2double** Jacobian_i = nullptr; /*!< \brief Flux Jacobian w.r.t. node i. */
su2double** Jacobian_j = nullptr; /*!< \brief Flux Jacobian w.r.t. node j. */

const bool implicit = false, incompressible = false, dynamic_grid = false;

/*!
* \brief A pure virtual function; Adds any extra variables to AD
*/
virtual void ExtraADPreaccIn() = 0;

/*!
* \brief Model-specific steps in the ComputeResidual method, derived classes
* compute the Flux and its Jacobians via this method.
* \param[in] config - Definition of the particular problem.
*/
virtual void FinishResidualCalc(const CConfig* config) = 0;

public:
/*!
* \brief Constructor of the class.
* \param[in] val_nDim - Number of dimensions of the problem.
* \param[in] val_nVar - Number of variables of the problem.
* \param[in] config - Definition of the particular problem.
*/
CUpwScalar(unsigned short val_nDim, unsigned short val_nVar, const CConfig* config);

/*!
* \brief Destructor of the class.
*/
~CUpwScalar(void) override;

/*!
* \brief Compute the scalar upwind flux between two nodes i and j.
* \param[in] config - Definition of the particular problem.
* \return A lightweight const-view (read-only) of the residual/flux and Jacobians.
*/
ResidualType<> ComputeResidual(const CConfig* config) override;
};
91 changes: 91 additions & 0 deletions SU2_CFD/include/numerics/scalar/scalar_diffusion.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
/*!
* \file scalar_diffusion.hpp
* \brief Declarations of numerics classes for discretization of
* viscous fluxes in scalar problems.
* \author F. Palacios, T. Economon
* \version 7.2.0 "Blackbird"
*
* SU2 Project Website: https://su2code.github.io
*
* The SU2 Project is maintained by the SU2 Foundation
* (http://su2foundation.org)
*
* Copyright 2012-2021, SU2 Contributors (cf. AUTHORS.md)
*
* SU2 is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* SU2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with SU2. If not, see <http://www.gnu.org/licenses/>.
*/

#pragma once

#include "../CNumerics.hpp"

/*!
* \class CAvgGrad_Scalar
* \brief Template class for computing viscous residual of scalar values
* \details This class serves as a template for the scalar viscous residual
* classes. The general structure of a viscous residual calculation is the
* same for many different models, which leads to a lot of repeated code.
* By using the template design pattern, these sections of repeated code are
* moved to a shared base class, and the specifics of each model
* are implemented by derived classes. In order to add a new residual
* calculation for a viscous residual, extend this class and implement
* the pure virtual functions with model-specific behavior.
* \ingroup ViscDiscr
* \author C. Pederson, A. Bueno, and F. Palacios
*/
class CAvgGrad_Scalar : public CNumerics {
protected:
su2double* Proj_Mean_GradScalarVar_Normal = nullptr; /*!< \brief Mean_gradScalarVar DOT normal. */
su2double* Proj_Mean_GradScalarVar = nullptr; /*!< \brief Mean_gradScalarVar DOT normal, corrected if required. */
su2double proj_vector_ij = 0.0; /*!< \brief (Edge_Vector DOT normal)/|Edge_Vector|^2 */
su2double* Flux = nullptr; /*!< \brief Final result, diffusive flux/residual. */
su2double** Jacobian_i = nullptr; /*!< \brief Flux Jacobian w.r.t. node i. */
su2double** Jacobian_j = nullptr; /*!< \brief Flux Jacobian w.r.t. node j. */

const bool correct_gradient = false, implicit = false, incompressible = false;

/*!
* \brief A pure virtual function; Adds any extra variables to AD
*/
virtual void ExtraADPreaccIn() = 0;

/*!
* \brief Model-specific steps in the ComputeResidual method, derived classes
* should compute the Flux and Jacobians (i/j) inside this method.
* \param[in] config - Definition of the particular problem.
*/
virtual void FinishResidualCalc(const CConfig* config) = 0;

public:
/*!
* \brief Constructor of the class.
* \param[in] val_nDim - Number of dimensions of the problem.
* \param[in] val_nVar - Number of variables of the problem.
* \param[in] correct_gradient - Whether to correct gradient for skewness.
* \param[in] config - Definition of the particular problem.
*/
CAvgGrad_Scalar(unsigned short val_nDim, unsigned short val_nVar, bool correct_gradient, const CConfig* config);

/*!
* \brief Destructor of the class.
*/
~CAvgGrad_Scalar(void) override;

/*!
* \brief Compute the viscous residual using an average of gradients without correction.
* \param[in] config - Definition of the particular problem.
* \return A lightweight const-view (read-only) of the residual/flux and Jacobians.
*/
ResidualType<> ComputeResidual(const CConfig* config) override;
};
29 changes: 29 additions & 0 deletions SU2_CFD/include/numerics/scalar/scalar_sources.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*!
* \file scalar_sources.hpp
* \brief Delarations of numerics classes for integration of source terms in scalar problems.
* \version 7.2.0 "Blackbird"
*
* SU2 Project Website: https://su2code.github.io
*
* The SU2 Project is maintained by the SU2 Foundation
* (http://su2foundation.org)
*
* Copyright 2012-2021, SU2 Contributors (cf. AUTHORS.md)
*
* SU2 is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* SU2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with SU2. If not, see <http://www.gnu.org/licenses/>.
*/

#pragma once

#include "../CNumerics.hpp"
62 changes: 1 addition & 61 deletions SU2_CFD/include/numerics/turbulent/turb_convection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,67 +28,7 @@

#pragma once

#include "../CNumerics.hpp"

/*!
* \class CUpwScalar
* \brief Template class for scalar upwind fluxes between nodes i and j.
* \details This class serves as a template for the scalar upwinding residual
* classes. The general structure of a scalar upwinding calculation is the
* same for many different models, which leads to a lot of repeated code.
* By using the template design pattern, these sections of repeated code are
* moved to this shared base class, and the specifics of each model
* are implemented by derived classes. In order to add a new residual
* calculation for a convection residual, extend this class and implement
* the pure virtual functions with model-specific behavior.
* \ingroup ConvDiscr
* \author C. Pederson, A. Bueno., and A. Campos.
*/
class CUpwScalar : public CNumerics {
protected:
su2double
a0 = 0.0, /*!< \brief The maximum of the face-normal velocity and 0 */
a1 = 0.0, /*!< \brief The minimum of the face-normal velocity and 0 */
*Flux = nullptr, /*!< \brief Final result, diffusive flux/residual. */
**Jacobian_i = nullptr, /*!< \brief Flux Jacobian w.r.t. node i. */
**Jacobian_j = nullptr; /*!< \brief Flux Jacobian w.r.t. node j. */

const bool implicit = false, incompressible = false, dynamic_grid = false;

/*!
* \brief A pure virtual function; Adds any extra variables to AD
*/
virtual void ExtraADPreaccIn() = 0;

/*!
* \brief Model-specific steps in the ComputeResidual method, derived classes
* compute the Flux and its Jacobians via this method.
* \param[in] config - Definition of the particular problem.
*/
virtual void FinishResidualCalc(const CConfig* config) = 0;

public:
/*!
* \brief Constructor of the class.
* \param[in] val_nDim - Number of dimensions of the problem.
* \param[in] val_nVar - Number of variables of the problem.
* \param[in] config - Definition of the particular problem.
*/
CUpwScalar(unsigned short val_nDim, unsigned short val_nVar, const CConfig* config);

/*!
* \brief Destructor of the class.
*/
~CUpwScalar(void) override;

/*!
* \brief Compute the scalar upwind flux between two nodes i and j.
* \param[in] config - Definition of the particular problem.
* \return A lightweight const-view (read-only) of the residual/flux and Jacobians.
*/
ResidualType<> ComputeResidual(const CConfig* config) override;

};
#include "../scalar/scalar_convection.hpp"

/*!
* \class CUpwSca_TurbSA
Expand Down
Loading