Skip to content

Commit e4ca763

Browse files
authored
Merge branch 'develop' into coupled_thermoelasticity
2 parents 20af8ad + 57667b2 commit e4ca763

File tree

11 files changed

+85
-14
lines changed

11 files changed

+85
-14
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,6 @@
2727
[submodule "subprojects/MLPCpp"]
2828
path = subprojects/MLPCpp
2929
url = https://github.com/EvertBunschoten/MLPCpp.git
30+
[submodule "externals/FADO"]
31+
path = externals/FADO
32+
url = https://github.com/pcarruscag/FADO.git

AUTHORS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ Thomas D. Economon
136136
Tim Albring
137137
TobiKattmann
138138
Trent Lukaczyk
139+
Vikram Bharadwaj
139140
Vinzenz Götz
140141
VivaanKhatri
141142
Wally Maier

SU2_CFD/src/output/COutput.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,7 @@ void COutput::SetHistoryOutput(CGeometry *geometry,
206206
unsigned long TimeIter,
207207
unsigned long OuterIter,
208208
unsigned long InnerIter) {
209-
210-
curTimeIter = TimeIter;
209+
curTimeIter = TimeIter;
211210
curAbsTimeIter = max(TimeIter, config->GetStartWindowIteration()) - config->GetStartWindowIteration();
212211
curOuterIter = OuterIter;
213212
curInnerIter = InnerIter;
@@ -273,7 +272,7 @@ void COutput::SetHistoryOutput(CGeometry ****geometry, CSolver *****solver, CCon
273272

274273
void COutput::SetMultizoneHistoryOutput(COutput **output, CConfig **config, CConfig *driver_config, unsigned long TimeIter, unsigned long OuterIter){
275274

276-
curTimeIter = TimeIter;
275+
curTimeIter = TimeIter;
277276
curAbsTimeIter = max(TimeIter, driver_config->GetStartWindowIteration()) - driver_config->GetStartWindowIteration();
278277
curOuterIter = OuterIter;
279278

@@ -389,6 +388,9 @@ void COutput::WriteToFile(CConfig *config, CGeometry *geometry, OUTPUT_TYPE form
389388
/*--- File writer that will later be used to write the file to disk. Created below in the "switch" ---*/
390389
CFileWriter *fileWriter = nullptr;
391390

391+
/*--- Set current time iter even if history file is not written ---*/
392+
curTimeIter = config->GetTimeIter();
393+
392394
/*--- If it is still present, strip the extension (suffix) from the filename ---*/
393395
const auto lastindex = fileName.find_last_of('.');
394396
fileName = fileName.substr(0, lastindex);
@@ -476,7 +478,7 @@ void COutput::WriteToFile(CConfig *config, CGeometry *geometry, OUTPUT_TYPE form
476478
extension = CSU2MeshFileWriter::fileExt;
477479

478480
if (fileName.empty())
479-
fileName = volumeFilename;
481+
fileName = config->GetFilename(volumeFilename, "", curTimeIter);
480482

481483
if (!config->GetWrt_Volume_Overwrite())
482484
filename_iter = config->GetFilename_Iter(fileName, curInnerIter, curOuterIter);

SU2_CFD/src/solvers/CTurbSASolver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ void CTurbSASolver::BC_HeatFlux_Wall(CGeometry *geometry, CSolver **solver_conta
500500
Res_Wall = coeff*RoughWallBC*Area;
501501
LinSysRes.SubtractBlock(iPoint, &Res_Wall);
502502

503-
su2double Jacobian_i = (laminar_viscosity*Area)/(0.03*Roughness_Height*sigma);
503+
su2double Jacobian_i = (laminar_viscosity /density *Area)/(0.03*Roughness_Height*sigma);
504504
Jacobian_i += 2.0*RoughWallBC*Area/sigma;
505505
if (implicit) Jacobian.AddVal2Diag(iPoint, -Jacobian_i);
506506
}

SU2_PY/meson.build

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,5 @@ install_data(['FSI_tools/__init__.py',
7070
install_data(['SU2_Nastran/__init__.py',
7171
'SU2_Nastran/pysu2_nastran.py'],
7272
install_dir: join_paths(get_option('bindir'), 'SU2_Nastran'))
73+
74+
install_subdir(['../externals/FADO'], install_dir: get_option('bindir'))

TestCases/TestCase.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,14 @@ def run_filediff(self, with_tsan=False, with_asan=False):
361361

362362
# Assert that both files have the same number of lines
363363
if len(fromlines) != len(tolines):
364-
diff = ["ERROR: Number of lines in " + fromfile + " and " + tofile + " differ: " + len(fromlines) + " vs " + len(tolines) + "."]
364+
stringerr = "ERROR: Number of lines in " + str(fromfile) + " and " + str(tofile) + " differ: " + str(len(fromlines)) + " vs " + str(len(tolines)) + "."
365+
diff = [stringerr]
366+
print("generated file = ")
367+
for i_line in tolines:
368+
print(i_line)
369+
for i_line in fromlines:
370+
print(i_line)
371+
365372
passed = False
366373

367374
# Loop through all lines
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ITER, avg_dp
2+
1, 89.03358290403737

TestCases/tutorials.py

Lines changed: 44 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,34 @@ def main():
9191
sp_pinArray_2d_dp_hf_tp.test_vals = [-4.640621, 1.436697, -0.707302, 208.023676]
9292
test_list.append(sp_pinArray_2d_dp_hf_tp)
9393

94+
# 90 degree pipe bend with wall functions from the experiments of Sudo et al.
95+
sudo_tutorial = TestCase('sudo_bend')
96+
sudo_tutorial.cfg_dir = "../Tutorials/incompressible_flow/Inc_Turbulent_Bend_Wallfunctions"
97+
sudo_tutorial.cfg_file = "sudo.cfg"
98+
sudo_tutorial.test_iter = 10
99+
sudo_tutorial.test_vals = [-14.579462, -13.203791, -13.601782, -12.616876, -14.005299, -10.817605, 15.000000, -2.296083]
100+
sudo_tutorial.command = TestCase.Command("mpirun -n 2", "SU2_CFD")
101+
test_list.append(sudo_tutorial)
102+
103+
# design-primal: 90 degree pipe bend with wall functions from the experiments of Sudo et al.
104+
sudo_design_primal = TestCase('sudo_bend_design_primal')
105+
sudo_design_primal.cfg_dir = "../Tutorials/design/Inc_Turbulent_Bend_Wallfunctions"
106+
sudo_design_primal.cfg_file = "sudo_primal.cfg"
107+
sudo_design_primal.test_iter = 10
108+
sudo_design_primal.test_vals = [-13.474698, -12.487574, -12.441102, -11.418111, -12.552674, -9.712569, 89.034000]
109+
sudo_design_primal.command = TestCase.Command("mpirun -n 2", "SU2_CFD")
110+
test_list.append(sudo_design_primal)
111+
112+
# design-adjoint: 90 degree pipe bend with wall functions from the experiments of Sudo et al.
113+
sudo_design_adjoint = TestCase('sudo_bend_design_adjoint')
114+
sudo_design_adjoint.cfg_dir = "../Tutorials/design/Inc_Turbulent_Bend_Wallfunctions"
115+
sudo_design_adjoint.cfg_file = "sudo_adjoint.cfg"
116+
sudo_design_adjoint.test_iter = 10
117+
sudo_design_adjoint.test_vals = [-4.133194, -3.691046, -2.581693, -3.476472, -3.837900, -6.900137]
118+
sudo_design_adjoint.command = TestCase.Command("mpirun -n 2", "SU2_CFD_AD")
119+
test_list.append(sudo_design_adjoint)
120+
121+
94122
### Species Transport
95123

96124
# 3 species (2 eq) primitive venturi mixing
@@ -120,14 +148,6 @@ def main():
120148
kenics_mixer_tutorial.command = TestCase.Command("mpirun -n 2", "SU2_CFD")
121149
test_list.append(kenics_mixer_tutorial)
122150

123-
# 90 degree pipe bend with wall functions from the experiments of Sudo et al.
124-
sudo_tutorial = TestCase('sudo_bend')
125-
sudo_tutorial.cfg_dir = "../Tutorials/incompressible_flow/Inc_Turbulent_Bend_Wallfunctions"
126-
sudo_tutorial.cfg_file = "sudo.cfg"
127-
sudo_tutorial.test_iter = 10
128-
sudo_tutorial.test_vals = [-14.579462, -13.203791, -13.601782, -12.616876, -14.005299, -10.817605, 15.000000, -2.296083]
129-
sudo_tutorial.command = TestCase.Command("mpirun -n 2", "SU2_CFD")
130-
test_list.append(sudo_tutorial)
131151

132152
### Incompressible Combustion
133153

@@ -324,6 +344,22 @@ def main():
324344

325345
pass_list = [ test.run_test() for test in test_list ]
326346

347+
348+
# design-FADO: 90 degree pipe bend optimization
349+
sudo_design_fado = TestCase('sudo_bend_design_fado')
350+
sudo_design_fado.command = TestCase.Command(exec = "python", param = "optimization.py")
351+
sudo_design_fado.cfg_dir = "../Tutorials/design/Inc_Turbulent_Bend_Wallfunctions"
352+
sudo_design_fado.cfg_file = "sudo.cfg"
353+
sudo_design_fado.multizone = False
354+
sudo_design_fado.test_iter = 10
355+
sudo_design_fado.timeout = 1600
356+
sudo_design_fado.reference_file = "../../../TestCases/Tutorials/design/Inc_Turbulent_Bend_Wallfunctions/optim.csv.ref"
357+
sudo_design_fado.test_file = "optim.csv"
358+
sudo_design_fado.comp_threshold = 1e-6
359+
sudo_design_fado.tol_file_percent = 0.1
360+
pass_list.append(sudo_design_fado.run_filediff())
361+
test_list.append(sudo_design_fado)
362+
327363
# Tests summary
328364
print('==================================================================')
329365
print('Summary of the parallel tests')

externals/FADO

Submodule FADO added at ce7ee01

meson_scripts/init.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ def init_submodules(
4848
own_mpp=True,
4949
own_cool=True,
5050
own_mel=True,
51+
own_fado=True,
5152
own_mlpcpp=True,
5253
):
5354

@@ -71,6 +72,8 @@ def init_submodules(
7172
github_repo_coolprop = "https://github.com/CoolProp/CoolProp"
7273
sha_version_mel = "46205ab019e5224559091375a6d71aabae6bc5b9"
7374
github_repo_mel = "https://github.com/pcarruscag/MEL"
75+
sha_version_fado = "ce7ee018e4e699af5028d69baa1939fea290e18a"
76+
github_repo_fado = "https://github.com/pcarruscag/FADO"
7477
sha_version_mlpcpp = "6865a58b22f21a92977839d9c93eae9522402f55"
7578
github_repo_mlpcpp = "https://github.com/EvertBunschoten/MLPCpp"
7679

@@ -82,6 +85,7 @@ def init_submodules(
8285
mpp_name = "Mutationpp"
8386
coolprop_name = "CoolProp"
8487
mel_name = "MEL"
88+
fado_name = "FADO"
8589
mlpcpp_name = "MLPCpp"
8690

8791
base_path = cur_dir + os.path.sep + "externals" + os.path.sep
@@ -91,6 +95,7 @@ def init_submodules(
9195
alt_name_meson = base_path + "meson"
9296
alt_name_ninja = base_path + "ninja"
9397
alt_name_mel = base_path + "mel"
98+
alt_name_fado = base_path + "FADO"
9499
alt_name_mpp = cur_dir + os.path.sep + "subprojects" + os.path.sep + "Mutationpp"
95100
alt_name_coolprop = cur_dir + os.path.sep + "subprojects" + os.path.sep + "CoolProp"
96101
alt_name_mlpcpp = cur_dir + os.path.sep + "subprojects" + os.path.sep + "MLPCpp"
@@ -123,6 +128,8 @@ def init_submodules(
123128
submodule_status(alt_name_coolprop, sha_version_coolprop)
124129
if own_mel:
125130
submodule_status(alt_name_mel, sha_version_mel)
131+
if own_fado:
132+
submodule_status(alt_name_fado, sha_version_fado)
126133
if own_mlpcpp:
127134
submodule_status(alt_name_mlpcpp, sha_version_mlpcpp)
128135
# Otherwise download the zip file from git
@@ -157,6 +164,10 @@ def init_submodules(
157164
)
158165
if own_mel:
159166
download_module(mel_name, alt_name_mel, github_repo_mel, sha_version_mel)
167+
if own_fado:
168+
download_module(
169+
fado_name, alt_name_fado, github_repo_fado, sha_version_fado
170+
)
160171
if own_mlpcpp:
161172
download_module(
162173
mlpcpp_name, alt_name_mlpcpp, github_repo_mlpcpp, sha_version_mlpcpp

0 commit comments

Comments
 (0)