Skip to content

Commit 161be5d

Browse files
committed
cleanup and reviewer suggestions
1 parent 82360ca commit 161be5d

File tree

8 files changed

+24
-103
lines changed

8 files changed

+24
-103
lines changed

Common/include/containers/CPyWrapperMatrixView.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
\
5555
/*! \brief Gets the value for a (row, column) pair. */ \
5656
passivedouble operator()(unsigned long row, unsigned long col) const { return Get(row, col); } \
57+
std::vector<passivedouble> operator()(unsigned long row) const { return Get(row); } \
5758
\
5859
/*! \brief Gets the value for a (row, column) pair. */ \
5960
passivedouble Get(unsigned long row, unsigned long col) const { return SU2_TYPE::GetValue(Access(row, col)); } \

SU2_CFD/include/drivers/CDriver.hpp

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -481,30 +481,12 @@ class CDriver : public CDriverBase {
481481
*/
482482
unsigned long GetNumberInnerIter() const;
483483

484-
/*!
485-
* \brief Set the number of inner iterations.
486-
* \return
487-
*/
488-
void SetNumberInnerIter(unsigned long val_iter);
489-
490484
/*!
491485
* \brief Get the number of outer iterations.
492486
* \return Number of outer iterations.
493487
*/
494488
unsigned long GetNumberOuterIter() const;
495489

496-
/*!
497-
* \brief Set the number of outer iterations.
498-
* \return
499-
*/
500-
void SetNumberOuterIter(unsigned long val_iter);
501-
502-
/*!
503-
* \brief Get the current solution
504-
* \return Current solution
505-
*/
506-
unsigned long GetSolution(unsigned short iSolver, unsigned long iPoint, unsigned short iVar);
507-
508490
/*!
509491
* \brief Get the current time iteration.
510492
* \return Current time iteration.
@@ -589,13 +571,13 @@ class CDriver : public CDriverBase {
589571
* \brief Get the Freestream Density for nondimensionalization
590572
* \return Freestream Density
591573
*/
592-
unsigned long GetDensity_FreeStreamND() const;
574+
passivedouble GetDensity_FreeStreamND() const;
593575

594576
/*!
595577
* \brief Get the reference Body force for nondimensionalization
596578
* \return reference Body Force
597579
*/
598-
unsigned long GetForce_Ref() const;
580+
passivedouble GetForce_Ref() const;
599581

600582

601583
/// \}

SU2_CFD/include/solvers/CSpeciesSolver.hpp

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -104,39 +104,6 @@ class CSpeciesSolver : public CScalarSolver<CSpeciesVariable> {
104104
*/
105105
void BC_Inlet(CGeometry* geometry, CSolver** solver_container, CNumerics* conv_numerics, CNumerics* visc_numerics,
106106
CConfig* config, unsigned short val_marker) override;
107-
108-
109-
/*!
110-
* \brief Impose the Navier-Stokes wall boundary condition.
111-
* \param[in] geometry - Geometrical definition of the problem.
112-
* \param[in] solver_container - Container vector with all the solutions.
113-
* \param[in] conv_numerics - Description of the numerical method.
114-
* \param[in] visc_numerics - Description of the numerical method.
115-
* \param[in] config - Definition of the particular problem.
116-
* \param[in] val_marker - Surface marker where the boundary condition is applied.
117-
*/
118-
void BC_Isothermal_Wall(CGeometry* geometry, CSolver** solver_container, CNumerics* conv_numerics,
119-
CNumerics* visc_numerics, CConfig* config, unsigned short val_marker) override;
120-
121-
/*!
122-
* \brief Impose the Navier-Stokes wall boundary condition.
123-
* \param[in] geometry - Geometrical definition of the problem.
124-
* \param[in] solver_container - Container vector with all the solutions.
125-
* \param[in] conv_numerics - Description of the numerical method.
126-
* \param[in] visc_numerics - Description of the numerical method.
127-
* \param[in] config - Definition of the particular problem.
128-
* \param[in] val_marker - Surface marker where the boundary condition is applied.
129-
*/
130-
void BC_HeatFlux_Wall(CGeometry* geometry, CSolver** solver_container, CNumerics* conv_numerics,
131-
CNumerics* visc_numerics, CConfig* config, unsigned short val_marker) override;
132-
133-
/*!
134-
* \brief Generic implementation of the isothermal wall also covering CHT cases,
135-
* for which the wall temperature is given by GetConjugateHeatVariable.
136-
*/
137-
void BC_Isothermal_Wall_Generic(CGeometry* geometry, CSolver** solver_container, CNumerics* conv_numerics,
138-
CNumerics* visc_numerics, CConfig* config, unsigned short val_marker,
139-
bool cht_mode = false);
140107

141108
/*!
142109
* \brief Store of a set of provided inlet profile values at a vertex.

SU2_CFD/src/python_wrapper_structure.cpp

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,12 @@ unsigned long CDriver::GetNumberTimeIter() const { return config_container[selec
6060

6161
unsigned long CDriver::GetNumberInnerIter() const { return config_container[selected_zone]->GetnInner_Iter(); }
6262
unsigned long CDriver::GetNumberOuterIter() const { return config_container[selected_zone]->GetnOuter_Iter(); }
63-
void CDriver::SetNumberInnerIter(unsigned long val_iter) { config_container[selected_zone]->SetnInner_Iter(val_iter); }
64-
void CDriver::SetNumberOuterIter(unsigned long val_iter) { config_container[selected_zone]->SetnOuter_Iter(val_iter); }
6563

66-
unsigned long CDriver::GetDensity_FreeStreamND() const {
64+
passivedouble CDriver::GetDensity_FreeStreamND() const {
6765
return SU2_TYPE::GetValue(config_container[selected_zone]->GetDensity_FreeStreamND());
6866
}
69-
unsigned long CDriver::GetForce_Ref() const {
67+
68+
passivedouble CDriver::GetForce_Ref() const {
7069
return SU2_TYPE::GetValue(config_container[selected_zone]->GetForce_Ref());
7170
}
7271

@@ -78,11 +77,6 @@ passivedouble CDriver::GetUnsteadyTimeStep() const {
7877

7978
string CDriver::GetSurfaceFileName() const { return config_container[selected_zone]->GetSurfCoeff_FileName(); }
8079

81-
unsigned long CDriver::GetSolution(unsigned short iSOLVER, unsigned long iPoint, unsigned short iVar) {
82-
auto solver = solver_container[iZone][INST_0][MESH_0][iSOLVER];
83-
return SU2_TYPE::GetValue(solver->GetNodes()->GetSolution(iPoint,iVar));
84-
}
85-
8680
////////////////////////////////////////////////////////////////////////////////
8781
/* Functions related to the management of markers */
8882
////////////////////////////////////////////////////////////////////////////////

SU2_CFD/src/solvers/CIncEulerSolver.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1811,6 +1811,8 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont
18111811
}
18121812
}
18131813

1814+
//Custom_Source_Residual(geometry, solver_container, numerics_container, config, iMesh);
1815+
18141816
}
18151817

18161818
void CIncEulerSolver::Source_Template(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics,

SU2_CFD/src/solvers/CSpeciesSolver.cpp

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -344,9 +344,6 @@ void CSpeciesSolver::BC_Inlet(CGeometry* geometry, CSolver** solver_container, C
344344

345345
if (!geometry->nodes->GetDomain(iPoint)) continue;
346346

347-
/*--- Identify the boundary by string name ---*/
348-
string Marker_Tag = config->GetMarker_All_TagBound(val_marker);
349-
350347
if (config->GetMarker_StrongBC(Marker_Tag)==true) {
351348
nodes->SetSolution_Old(iPoint, Inlet_SpeciesVars[val_marker][iVertex]);
352349

@@ -440,25 +437,6 @@ void CSpeciesSolver::SetUniformInlet(const CConfig* config, unsigned short iMark
440437
}
441438
}
442439

443-
/*--- Currently all walls are zero-flux for the species ---*/
444-
void CSpeciesSolver::BC_Isothermal_Wall(CGeometry* geometry, CSolver** solver_container,
445-
CNumerics* conv_numerics, CNumerics* visc_numerics, CConfig* config,
446-
unsigned short val_marker) {
447-
BC_Isothermal_Wall_Generic(geometry, solver_container, conv_numerics, visc_numerics, config, val_marker);
448-
}
449-
450-
void CSpeciesSolver::BC_HeatFlux_Wall(CGeometry* geometry, CSolver** solver_container,
451-
CNumerics* conv_numerics, CNumerics* visc_numerics, CConfig* config,
452-
unsigned short val_marker) {
453-
BC_Isothermal_Wall_Generic(geometry, solver_container, conv_numerics, visc_numerics, config, val_marker);
454-
}
455-
456-
void CSpeciesSolver::BC_Isothermal_Wall_Generic(CGeometry* geometry, CSolver** solver_container,
457-
CNumerics* conv_numerics, CNumerics* visc_numerics,
458-
CConfig* config, unsigned short val_marker, bool cht_mode) {
459-
}
460-
461-
462440
void CSpeciesSolver::BC_Outlet(CGeometry* geometry, CSolver** solver_container, CNumerics* conv_numerics,
463441
CNumerics* visc_numerics, CConfig* config, unsigned short val_marker) {
464442

@@ -591,7 +569,7 @@ void CSpeciesSolver::Source_Residual(CGeometry *geometry, CSolver **solver_conta
591569
}
592570

593571

594-
void CSpeciesSolver::CustomSourceResidual(CGeometry *geometry, CSolver **solver_container,
572+
void CSpeciesSolver::Custom_Source_Residual(CGeometry *geometry, CSolver **solver_container,
595573
CNumerics **numerics_container, CConfig *config, unsigned short iMesh) {
596574

597575
/*--- Pick one numerics object per thread. ---*/

TestCases/py_wrapper/custom_source_buoyancy/run.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def main():
3333
"""
3434
custom source to add buoyancy term.
3535
"""
36-
# parallel
36+
# parallel
3737
comm = MPI.COMM_WORLD
3838
# serial
3939
#comm = 0
@@ -85,7 +85,7 @@ def main():
8585
#print("max. number of inner iterations: ",driver.GetNumberInnerIter());
8686
#print("max nr of outer iterations: ",driver.GetNumberOuterIter());
8787

88-
# is in domain: isdomain = driver.GetNodeDomain(iPoint)
88+
# is in domain: isdomain = driver.GetNodeDomain(iPoint)
8989
#for i_vertex in range(n_vertex)
9090
#AllSolutions = driver.GetAllSolutions(iSOLVER)
9191
Body_Force_Vector = [0.0, -9.81, 0.0]
@@ -96,16 +96,14 @@ def main():
9696

9797
Iter = driver.GetNumberInnerIter()
9898
print("1. inner iterations = ",Iter)
99-
# set the inner iterations to 1
100-
driver.SetNumberInnerIter(1)
10199

102100
for inner_iter in range(Iter):
103101
# set the source term, per point
104102
print(driver.GetNumberNodes() - driver.GetNumberHaloNodes())
105103
for i_node in range(driver.GetNumberNodes() - driver.GetNumberHaloNodes()):
106104
#SolutionVector = driver.GetSolutionVector(iSOLVER,i_node)
107105
PrimitiveVector = driver.GetPrimitiveVector(iSOLVER,i_node)
108-
DensityInc_i = PrimitiveVector[iDENSITY]
106+
DensityInc_i = PrimitiveVector[iDENSITY]
109107

110108
for iDim in range(nDim):
111109
custom_source_vector[iDim+1] = -(DensityInc_i - DensityInc_0) * Body_Force_Vector[iDim] / Force_Ref

TestCases/py_wrapper/turbulent_premixed_psi/run.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,12 @@
3030
from mpi4py import MPI
3131
import numpy as np
3232

33-
# Import mpi4py for parallel run
34-
if options.with_MPI == True:
35-
from mpi4py import MPI
36-
comm = MPI.COMM_WORLD
37-
rank = comm.Get_rank()
38-
else:
39-
comm = 0
33+
# with mpi:
34+
from mpi4py import MPI
35+
comm = MPI.COMM_WORLD
36+
rank = comm.Get_rank()
37+
# without mpi:
38+
# comm = 0
4039

4140
# flame temperature of the methane-air mixture (phi=0.5, P=5)
4241
Tf = 1777
@@ -84,11 +83,11 @@ def SetInitialSpecies(SU2Driver):
8483
for iPoint in range(SU2Driver.GetNumberNodes() - SU2Driver.GetNumberHaloNodes()):
8584
coord = allCoords.Get(iPoint)
8685
C = initC(coord)
87-
# now update the initial condition for the species
86+
# now update the initial condition for the species
8887
SU2Driver.SetSolutionVector(iSPECIESSOLVER, iPoint, [C])
8988

9089
# ################################################################## #
91-
# Temperature is an algebraic function of c
90+
# Temperature is an algebraic function of c
9291
# ################################################################## #
9392
def update_temperature(SU2Driver, iPoint):
9493
# first, get the progress variable
@@ -106,7 +105,7 @@ def update_temperature(SU2Driver, iPoint):
106105

107106

108107
# ################################################################## #
109-
# Source term according to Zimont
108+
# Source term according to Zimont
110109
# ################################################################## #
111110
def zimont(SU2Driver, iPoint):
112111

@@ -141,7 +140,7 @@ def zimont(SU2Driver, iPoint):
141140
return Sc
142141

143142
# ################################################################## #
144-
# Get the list of solver variable names
143+
# Get the list of solver variable names
145144
# ################################################################## #
146145
def getsolvar(SU2Driver):
147146
primindex = SU2Driver.GetPrimitiveIndices()
@@ -155,7 +154,7 @@ def getsolvar(SU2Driver):
155154
return varindex
156155

157156
# ################################################################## #
158-
# Main routine
157+
# Main routine
159158
# ################################################################## #
160159
def main():
161160

@@ -223,7 +222,7 @@ def main():
223222
driver.Preprocess(inner_iter)
224223
driver.Run()
225224

226-
# set the source term, per point,
225+
# set the source term, per point,
227226
for i_node in range(driver.GetNumberNodes() - driver.GetNumberHaloNodes()):
228227
# add source term:
229228
# default TFC of Zimont: rho*Sc = rho_u * U_t * grad(c)

0 commit comments

Comments
 (0)