Skip to content

Commit d43a50b

Browse files
committed
address PR comments, fix iDim==3 issues
1 parent 99988b5 commit d43a50b

4 files changed

Lines changed: 42 additions & 42 deletions

File tree

SU2_CFD/include/numerics_simd/flow/convection/centered.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,8 @@ class CCenteredBase : public Base {
170170

171171
/*--- Add the contributions from the base class (static decorator). ---*/
172172

173-
Base::updateFlux(iEdge, iPoint, jPoint, avgV, V, solution_, geometry,
174-
config, area, unitNormal, implicit, flux, jac_i, jac_j);
173+
Base::viscousTerms(iEdge, iPoint, jPoint, avgV, V, solution_, geometry,
174+
config, area, unitNormal, implicit, flux, jac_i, jac_j);
175175

176176
/*--- Stop preaccumulation. ---*/
177177

SU2_CFD/include/numerics_simd/flow/convection/roe.hpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@
3838
* \class CRoeBase
3939
* \brief Base class for Roe schemes, derived classes implement
4040
* the dissipation term in a const "finalizeFlux" method.
41-
* A base class implementing "updateFlux" is accepted as template parameter.
41+
* A base class implementing "viscousTerms" is accepted as template parameter.
4242
* Similarly to derived, that method should update the flux and Jacobians, but
43-
* whereas "finalizeFlux" is passed data prepared by CRoeBase, "updateFlux"
44-
* takes the same input arguments as "ComputeFlux", i.e. it must fetch the data
45-
* it needs from CVariable. Derived is meant to implement small details,
46-
* Base is meant to do heavy lifting like computing viscous fluxes.
43+
* whereas "finalizeFlux" is passed data prepared by CRoeBase, "viscousTerms"
44+
* takes the same input arguments as "ComputeFlux", i.e. it can fetch more
45+
* data from CVariable. Derived is meant to implement small details,
46+
* Base is meant to do heavy lifting.
4747
*/
4848
template<class Derived, class Base>
4949
class CRoeBase : public Base {
@@ -199,8 +199,8 @@ class CRoeBase : public Base {
199199

200200
/*--- Add the contributions from the base class (static decorator). ---*/
201201

202-
Base::updateFlux(iEdge, iPoint, jPoint, V1st, solution_, vector_ij, geometry,
203-
config, area, unitNormal, implicit, flux, jac_i, jac_j);
202+
Base::viscousTerms(iEdge, iPoint, jPoint, V1st, solution_, vector_ij, geometry,
203+
config, area, unitNormal, implicit, flux, jac_i, jac_j);
204204

205205
/*--- Stop preaccumulation. ---*/
206206

SU2_CFD/include/numerics_simd/flow/diffusion/viscous_fluxes.hpp

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class CNoViscousFlux : public CNumericsSIMD {
5858
* the decorated class can pass them to avoid expensive data accesses.
5959
*/
6060
template<class... Ts>
61-
void updateFlux(Ts&...) const {}
61+
void viscousTerms(Ts&...) const {}
6262
};
6363

6464
/*!
@@ -98,21 +98,21 @@ class CCompressibleViscousFlux : public CNumericsSIMD {
9898
* \brief Add viscous contributions to flux and jacobians.
9999
*/
100100
template<class PrimVarType, size_t nVar>
101-
FORCEINLINE void updateFlux(Int iEdge,
102-
Int iPoint,
103-
Int jPoint,
104-
const PrimVarType& avgV,
105-
const CPair<PrimVarType>& V,
106-
const CVariable& solution_,
107-
const VectorDbl<nDim>& vector_ij,
108-
const CGeometry& geometry,
109-
const CConfig& config,
110-
Double area,
111-
const VectorDbl<nDim>& unitNormal,
112-
bool implicit,
113-
VectorDbl<nVar>& flux,
114-
MatrixDbl<nVar>& jac_i,
115-
MatrixDbl<nVar>& jac_j) const {
101+
FORCEINLINE void viscousTerms(Int iEdge,
102+
Int iPoint,
103+
Int jPoint,
104+
const PrimVarType& avgV,
105+
const CPair<PrimVarType>& V,
106+
const CVariable& solution_,
107+
const VectorDbl<nDim>& vector_ij,
108+
const CGeometry& geometry,
109+
const CConfig& config,
110+
Double area,
111+
const VectorDbl<nDim>& unitNormal,
112+
bool implicit,
113+
VectorDbl<nVar>& flux,
114+
MatrixDbl<nVar>& jac_i,
115+
MatrixDbl<nVar>& jac_j) const {
116116

117117
static_assert(PrimVarType::nVar <= nPrimVar,"");
118118

@@ -201,36 +201,36 @@ class CCompressibleViscousFlux : public CNumericsSIMD {
201201
* \overload Average primitives if not provided yet.
202202
*/
203203
template<class PrimVarType, class... Ts>
204-
FORCEINLINE void updateFlux(Int iEdge,
205-
Int iPoint,
206-
Int jPoint,
207-
const CPair<PrimVarType>& V,
208-
Ts&... args) const {
204+
FORCEINLINE void viscousTerms(Int iEdge,
205+
Int iPoint,
206+
Int jPoint,
207+
const CPair<PrimVarType>& V,
208+
Ts&... args) const {
209209
PrimVarType avgV;
210210
for (size_t iVar = 0; iVar < PrimVarType::nVar; ++iVar) {
211211
avgV.all(iVar) = 0.5 * (V.i.all(iVar) + V.j.all(iVar));
212212
}
213213

214214
/*--- Continue calculation. ---*/
215-
updateFlux(iEdge, iPoint, jPoint, avgV, V, args...);
215+
viscousTerms(iEdge, iPoint, jPoint, avgV, V, args...);
216216
}
217217

218218
/*!
219219
* \overload Compute the i-j vector if not provided yet.
220220
*/
221221
template<class PrimVarType, class... Ts>
222-
FORCEINLINE void updateFlux(Int iEdge,
223-
Int iPoint,
224-
Int jPoint,
225-
const PrimVarType& avgV,
226-
const CPair<PrimVarType>& V,
227-
const CVariable& solution_,
228-
const CGeometry& geometry,
229-
Ts&... args) const {
222+
FORCEINLINE void viscousTerms(Int iEdge,
223+
Int iPoint,
224+
Int jPoint,
225+
const PrimVarType& avgV,
226+
const CPair<PrimVarType>& V,
227+
const CVariable& solution_,
228+
const CGeometry& geometry,
229+
Ts&... args) const {
230230

231231
const auto vector_ij = distanceVector<nDim>(iPoint, jPoint, geometry.nodes->GetCoord());
232232

233233
/*--- Continue calculation. ---*/
234-
updateFlux(iEdge, iPoint, jPoint, avgV, V, solution_, vector_ij, geometry, args...);
234+
viscousTerms(iEdge, iPoint, jPoint, avgV, V, solution_, vector_ij, geometry, args...);
235235
}
236236
};

SU2_CFD/include/solvers/CFVMFlowSolverBase.inl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1814,7 +1814,7 @@ void CFVMFlowSolverBase<V, FlowRegime>::Momentum_Forces(const CGeometry* geometr
18141814

18151815
/*--- Moment with respect to the reference axis ---*/
18161816

1817-
if (iDim == 3) {
1817+
if (nDim == 3) {
18181818
MomentMomentum[0] += (Force[2] * MomentDist[1] - Force[1] * MomentDist[2]) / RefLength;
18191819
MomentX_Force[1] += (-Force[1] * Coord[2]);
18201820
MomentX_Force[2] += (Force[2] * Coord[1]);
@@ -2310,7 +2310,7 @@ void CFVMFlowSolverBase<V, FlowRegime>::Friction_Forces(const CGeometry* geometr
23102310

23112311
/*--- Moment with respect to the reference axis ---*/
23122312

2313-
if (iDim == 3) {
2313+
if (nDim == 3) {
23142314
MomentViscous[0] += (Force[2] * MomentDist[1] - Force[1] * MomentDist[2]) / RefLength;
23152315
MomentX_Force[1] += (-Force[1] * Coord[2]);
23162316
MomentX_Force[2] += (Force[2] * Coord[1]);

0 commit comments

Comments
 (0)