Skip to content

Commit d47e3fa

Browse files
authored
Merge branch 'develop' into fix/solver-stability-security
2 parents 8d70fda + b91b14d commit d47e3fa

File tree

6 files changed

+31
-24
lines changed

6 files changed

+31
-24
lines changed

SU2_CFD/include/numerics/CNumerics.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,7 +1059,7 @@ class CNumerics {
10591059
* \param[in] val_velocity - Pointer to the velocity.
10601060
* \param[in] val_betainc2 - Value of the artificial compresibility factor.
10611061
* \param[in] val_enthalpy - Value of the enthalpy.
1062-
* \param[in] val_dRhodT - Value of the derivative of density w.r.t. temperature.
1062+
* \param[in] val_dRhodh - Value of the derivative of density w.r.t. enthalpy.
10631063
* \param[in] val_normal - Normal vector, the norm of the vector is the area of the face.
10641064
* \param[in] val_scale - Scale of the projection.
10651065
* \param[out] val_Proj_Jac_tensor - Pointer to the projected inviscid Jacobian.
@@ -1068,7 +1068,7 @@ class CNumerics {
10681068
const su2double *val_velocity,
10691069
const su2double *val_betainc2,
10701070
const su2double *val_enthalpy,
1071-
const su2double *val_dRhodT,
1071+
const su2double *val_dRhodh,
10721072
const su2double *val_normal,
10731073
su2double val_scale,
10741074
su2double **val_Proj_Jac_Tensor) const;

SU2_CFD/include/variables/CIncEulerVariable.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,14 @@ class CIncEulerVariable : public CFlowVariable {
7878
* \brief Constructor of the class.
7979
* \param[in] val_pressure - value of the pressure.
8080
* \param[in] velocity - Value of the flow velocity (initialization value).
81-
* \param[in] temperature - Value of the temperature (initialization value).
81+
* \param[in] enthalpy - Value of the enthalpy (initialization value).
8282
* \param[in] npoint - Number of points/nodes/vertices in the domain.
8383
* \param[in] ndim - Number of dimensions of the problem.
8484
* \param[in] nvar - Number of variables of the problem.
8585
* \param[in] config - Definition of the particular problem.
8686
*/
8787

88-
CIncEulerVariable(su2double pressure, const su2double *velocity, su2double temperature,
88+
CIncEulerVariable(su2double pressure, const su2double *velocity, su2double enthalpy,
8989
unsigned long npoint, unsigned long ndim, unsigned long nvar, const CConfig *config);
9090

9191
/*!
@@ -125,7 +125,7 @@ class CIncEulerVariable : public CFlowVariable {
125125
}
126126

127127
/*!
128-
* \brief Set the value of the enthalpy for multicomponent incompressible flows with energy equation.
128+
* \brief Set the value of the enthalpy for incompressible flows with energy equation.
129129
* \param[in] iPoint - Point index.
130130
*/
131131
inline void SetEnthalpy(unsigned long iPoint, su2double val_enthalpy) {

SU2_CFD/src/numerics/CNumerics.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ void CNumerics::GetInviscidProjJac(const su2double *val_velocity, const su2doubl
250250

251251
void CNumerics::GetInviscidIncProjJac(const su2double *val_density, const su2double *val_velocity,
252252
const su2double *val_betainc2, const su2double *val_enthalpy,
253-
const su2double *val_dRhodT, const su2double *val_normal,
253+
const su2double *val_dRhodh, const su2double *val_normal,
254254
su2double val_scale, su2double **val_Proj_Jac_Tensor) const {
255255
const bool wasActive = AD::BeginPassive();
256256
unsigned short iDim;
@@ -265,54 +265,54 @@ void CNumerics::GetInviscidIncProjJac(const su2double *val_density, const su2dou
265265
val_Proj_Jac_Tensor[0][0] = val_scale*(proj_vel/(*val_betainc2));
266266
val_Proj_Jac_Tensor[0][1] = val_scale*(val_normal[0]*(*val_density));
267267
val_Proj_Jac_Tensor[0][2] = val_scale*(val_normal[1]*(*val_density));
268-
val_Proj_Jac_Tensor[0][3] = val_scale*((*val_dRhodT)*proj_vel);
268+
val_Proj_Jac_Tensor[0][3] = val_scale*((*val_dRhodh)*proj_vel);
269269

270270
val_Proj_Jac_Tensor[1][0] = val_scale*(val_normal[0] + val_velocity[0]*proj_vel/(*val_betainc2));
271271
val_Proj_Jac_Tensor[1][1] = val_scale*((*val_density)*(val_normal[0]*val_velocity[0] + proj_vel));
272272
val_Proj_Jac_Tensor[1][2] = val_scale*(val_normal[1]*(*val_density)*val_velocity[0]);
273-
val_Proj_Jac_Tensor[1][3] = val_scale*((*val_dRhodT)*val_velocity[0]*proj_vel);
273+
val_Proj_Jac_Tensor[1][3] = val_scale*((*val_dRhodh)*val_velocity[0]*proj_vel);
274274

275275
val_Proj_Jac_Tensor[2][0] = val_scale*(val_normal[1] + val_velocity[1]*proj_vel/(*val_betainc2));
276276
val_Proj_Jac_Tensor[2][1] = val_scale*(val_normal[0]*(*val_density)*val_velocity[1]);
277277
val_Proj_Jac_Tensor[2][2] = val_scale*((*val_density)*(proj_vel + val_normal[1]*val_velocity[1]));
278-
val_Proj_Jac_Tensor[2][3] = val_scale*((*val_dRhodT)*val_velocity[1]*proj_vel);
278+
val_Proj_Jac_Tensor[2][3] = val_scale*((*val_dRhodh)*val_velocity[1]*proj_vel);
279279

280280
val_Proj_Jac_Tensor[3][0] = val_scale*((*val_enthalpy)*proj_vel/(*val_betainc2));
281281
val_Proj_Jac_Tensor[3][1] = val_scale*((*val_enthalpy)*val_normal[0]*(*val_density));
282282
val_Proj_Jac_Tensor[3][2] = val_scale*((*val_enthalpy)*val_normal[1]*(*val_density));
283-
val_Proj_Jac_Tensor[3][3] = val_scale*(((*val_enthalpy)*(*val_dRhodT) + (*val_density))*proj_vel);
283+
val_Proj_Jac_Tensor[3][3] = val_scale*(((*val_enthalpy)*(*val_dRhodh) + (*val_density))*proj_vel);
284284

285285
} else {
286286

287287
val_Proj_Jac_Tensor[0][0] = val_scale*(proj_vel/(*val_betainc2));
288288
val_Proj_Jac_Tensor[0][1] = val_scale*(val_normal[0]*(*val_density));
289289
val_Proj_Jac_Tensor[0][2] = val_scale*(val_normal[1]*(*val_density));
290290
val_Proj_Jac_Tensor[0][3] = val_scale*(val_normal[2]*(*val_density));
291-
val_Proj_Jac_Tensor[0][4] = val_scale*((*val_dRhodT)*proj_vel);
291+
val_Proj_Jac_Tensor[0][4] = val_scale*((*val_dRhodh)*proj_vel);
292292

293293
val_Proj_Jac_Tensor[1][0] = val_scale*(val_normal[0] + val_velocity[0]*proj_vel/(*val_betainc2));
294294
val_Proj_Jac_Tensor[1][1] = val_scale*((*val_density)*(val_normal[0]*val_velocity[0] + proj_vel));
295295
val_Proj_Jac_Tensor[1][2] = val_scale*(val_normal[1]*(*val_density)*val_velocity[0]);
296296
val_Proj_Jac_Tensor[1][3] = val_scale*(val_normal[2]*(*val_density)*val_velocity[0]);
297-
val_Proj_Jac_Tensor[1][4] = val_scale*((*val_dRhodT)*val_velocity[0]*proj_vel);
297+
val_Proj_Jac_Tensor[1][4] = val_scale*((*val_dRhodh)*val_velocity[0]*proj_vel);
298298

299299
val_Proj_Jac_Tensor[2][0] = val_scale*(val_normal[1] + val_velocity[1]*proj_vel/(*val_betainc2));
300300
val_Proj_Jac_Tensor[2][1] = val_scale*(val_normal[0]*(*val_density)*val_velocity[1]);
301301
val_Proj_Jac_Tensor[2][2] = val_scale*((*val_density)*(proj_vel + val_normal[1]*val_velocity[1]));
302302
val_Proj_Jac_Tensor[2][3] = val_scale*(val_normal[2]*(*val_density)*val_velocity[1]);
303-
val_Proj_Jac_Tensor[2][4] = val_scale*((*val_dRhodT)*val_velocity[1]*proj_vel);
303+
val_Proj_Jac_Tensor[2][4] = val_scale*((*val_dRhodh)*val_velocity[1]*proj_vel);
304304

305305
val_Proj_Jac_Tensor[3][0] = val_scale*(val_normal[2] + val_velocity[2]*proj_vel/(*val_betainc2));
306306
val_Proj_Jac_Tensor[3][1] = val_scale*(val_normal[0]*(*val_density)*val_velocity[2]);
307307
val_Proj_Jac_Tensor[3][2] = val_scale*(val_normal[1]*(*val_density)*val_velocity[2]);
308308
val_Proj_Jac_Tensor[3][3] = val_scale*((*val_density)*(proj_vel + val_normal[2]*val_velocity[2]));
309-
val_Proj_Jac_Tensor[3][4] = val_scale*((*val_dRhodT)*val_velocity[2]*proj_vel);
309+
val_Proj_Jac_Tensor[3][4] = val_scale*((*val_dRhodh)*val_velocity[2]*proj_vel);
310310

311311
val_Proj_Jac_Tensor[4][0] = val_scale*((*val_enthalpy)*proj_vel/(*val_betainc2));
312312
val_Proj_Jac_Tensor[4][1] = val_scale*((*val_enthalpy)*val_normal[0]*(*val_density));
313313
val_Proj_Jac_Tensor[4][2] = val_scale*((*val_enthalpy)*val_normal[1]*(*val_density));
314314
val_Proj_Jac_Tensor[4][3] = val_scale*((*val_enthalpy)*val_normal[2]*(*val_density));
315-
val_Proj_Jac_Tensor[4][4] = val_scale*(((*val_enthalpy)*(*val_dRhodT) + (*val_density))*proj_vel);
315+
val_Proj_Jac_Tensor[4][4] = val_scale*(((*val_enthalpy)*(*val_dRhodh) + (*val_density))*proj_vel);
316316

317317
}
318318
AD::EndPassive(wasActive);

SU2_CFD/src/variables/CIncNSVariable.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@ bool CIncNSVariable::SetPrimVar(unsigned long iPoint, su2double eddy_visc, su2do
123123

124124
SetSpecificHeatCp(iPoint, FluidModel->GetCp());
125125
SetSpecificHeatCv(iPoint, FluidModel->GetCv());
126+
127+
/*--- Set enthalpy ---*/
128+
126129
SetEnthalpy(iPoint, FluidModel->GetEnthalpy());
127130

128131
return physical;

meson_scripts/init.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ def _extract_member(self, member, targetpath, pwd):
289289

290290
if not os.path.exists(filepath) and not os.path.exists(alt_filepath):
291291
try:
292-
urllib.request.urlretrieve(url, commit_sha + ".zip")
292+
urllib.request.urlretrieve(url, filename)
293293
except Exception as e:
294294
print(e)
295295
print("Download of module " + name + " failed.")
@@ -303,8 +303,8 @@ def _extract_member(self, member, targetpath, pwd):
303303
filepath = alt_filepath
304304

305305
# Unzip file
306-
zipf = MyZipFile(filepath)
307-
zipf.extractall(target_dir)
306+
with MyZipFile(filepath) as zipf:
307+
zipf.extractall(target_dir)
308308

309309
# Remove directory if exists
310310
if os.path.exists(alt_name):

preconfigure.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ def build_ninja():
3838
# If we are on windows, we don't need to compile ninja, we just download the executable
3939
if os.name == "nt":
4040
ninja_exe_url = "https://github.com/ninja-build/ninja/releases/download/v1.13.0/ninja-win.zip"
41+
ninja_zip_path = os.path.join(sys.path[0], "ninja-win.zip")
4142

4243
# Try to execute ninja, if it fails, download .exe from github
4344
try:
@@ -48,18 +49,18 @@ def build_ninja():
4849
except OSError:
4950
print("Downloading ninja ... ")
5051
try:
51-
urllib.request.urlretrieve(ninja_exe_url, "ninja-win.zip")
52-
except:
52+
urllib.request.urlretrieve(ninja_exe_url, ninja_zip_path)
53+
except Exception as e:
5354
print(e)
5455
print("Download of ninja executable failed.")
5556
print("Get archive at " + ninja_exe_url)
5657
print("extract ninja.exe in the source code root folder.")
5758
print("Run meson.py again.")
5859
sys.exit(1)
5960

60-
zipf = zipfile.ZipFile(sys.path[0] + os.path.sep + "ninja-win.zip")
61-
zipf.extractall(sys.path[0])
62-
remove_file(sys.path[0] + os.path.sep + "ninja-win.zip")
61+
with zipfile.ZipFile(ninja_zip_path) as zipf:
62+
zipf.extractall(sys.path[0])
63+
remove_file(ninja_zip_path)
6364
else:
6465
ninjapath = sys.path[0] + os.path.sep + "externals" + os.path.sep + "ninja"
6566
try:
@@ -75,7 +76,10 @@ def build_ninja():
7576
subprocess.run(
7677
["python3", "configure.py", "--bootstrap"], cwd=ninjapath, env=env
7778
)
78-
shutil.copy(ninjapath + os.path.sep + "ninja", ".")
79+
shutil.copy(
80+
os.path.join(ninjapath, "ninja"),
81+
os.path.join(sys.path[0], "ninja"),
82+
)
7983

8084

8185
def run(

0 commit comments

Comments
 (0)