Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
blaster
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Aerospace and Mechanical Engineering
blaster
Commits
4ab89b5f
Verified
Commit
4ab89b5f
authored
1 month ago
by
Paul Dechamps
Browse files
Options
Downloads
Patches
Plain Diff
(tests) Modidy SU2 test
Return 0 for pipeline
parent
4532c72f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
blast/tests/su2/blisu2.py
+0
-97
0 additions, 97 deletions
blast/tests/su2/blisu2.py
with
0 additions
and
97 deletions
blast/tests/su2/blisu2.py
deleted
100644 → 0
+
0
−
97
View file @
4532c72f
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2022 University of Liège
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# @author Paul Dechamps
# @date 2022 reworked 2025
# Test the vii implementation using SU2 as the inviscid solver
# Imports.
import
blast.blUtils
as
vutils
from
fwk.wutils
import
parseargs
def
cfgSu2
(
verb
):
import
os
return
{
'
filename
'
:
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
split
(
os
.
path
.
abspath
(
__file__
))[
0
],
"
config.cfg
"
)),
'
meshfile
'
:
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
split
(
os
.
path
.
abspath
(
__file__
))[
0
],
"
../../models/su2/n0012_su2.su2
"
)),
'
wingTags
'
:
[
'
airfoil
'
,
'
airfoil_
'
],
'
Verb
'
:
verb
,
# Verbosity level
}
def
cfgBlast
():
return
{
'
Re
'
:
1e7
,
# Freestream Reynolds number
'
CFL0
'
:
2
,
# Inital CFL number of the calculation
'
couplIter
'
:
2
,
# Maximum number of iterations
'
sections
'
:
{
'
airfoil
'
:
[
0.0
]},
'
spans
'
:
{
'
airfoil
'
:
1.0
},
'
couplTol
'
:
1e-4
,
# Tolerance of the VII methodology
'
iterPrint
'
:
1
,
# int, number of iterations between outputs
'
resetInv
'
:
True
,
# bool, flag to reset the inviscid calculation at every iteration.
'
xtrF
'
:
[
None
,
0.4
],
# Forced transition locations
'
interpolator
'
:
'
Matching
'
,
# Interpolator for the coupling
}
def
main
():
args
=
parseargs
()
icfg
=
cfgSu2
(
args
.
verb
)
vcfg
=
cfgBlast
()
coupler
,
isol
,
vsol
=
vutils
.
initBlast
(
icfg
,
vcfg
,
iSolver
=
'
SU2
'
,
task
=
'
analysis
'
)
coupler
.
run
()
import
numpy
as
np
cpi
=
np
.
loadtxt
(
'
Cp_inviscid.dat
'
)
cpCorrected
=
np
.
loadtxt
(
'
Cp_viscous.dat
'
)
import
matplotlib.pyplot
as
plt
# Clear plt
plt
.
close
(
'
all
'
)
plt
.
figure
()
plt
.
plot
(
cpCorrected
[:,
0
],
cpCorrected
[:,
1
],
lw
=
3
)
plt
.
plot
(
cpi
[:,
0
],
cpi
[:,
1
],
'
--
'
,
lw
=
3
)
plt
.
gca
().
invert_yaxis
()
plt
.
show
()
#plt.savefig('cp.png')
quit
()
# Extract solution
# Display results
from
matplotlib
import
pyplot
as
plt
fig
,
(
ax1
,
ax2
)
=
plt
.
subplots
(
1
,
2
)
ax1
.
plot
(
cpCorrected
[:,
0
],
cpCorrected
[:,
1
],
lw
=
3
)
ax1
.
plot
(
su2API
.
cp0
[:,
0
],
su2API
.
cp0
[:,
1
],
'
--
'
,
lw
=
1.5
,
color
=
'
black
'
)
ax1
.
invert_yaxis
()
ax1
.
set_ylabel
(
'
$c_p$
'
)
ax2
.
plot
(
solsu2
[
'
xoc
'
],
solsu2
[
'
Cf
'
],
lw
=
3
)
ax2
.
set_ylabel
(
'
$c_f$
'
)
ax2
.
set_xlim
([
0
,
1
])
plt
.
show
()
plt
.
plot
(
cpCorrected
[:,
0
],
cpCorrected
[:,
1
],
lw
=
3
,
color
=
'
darkblue
'
)
plt
.
plot
(
su2API
.
cp0
[:,
0
],
su2API
.
cp0
[:,
1
],
'
--
'
,
lw
=
3
,
color
=
'
black
'
)
plt
.
xticks
([
0
,
1
])
plt
.
yticks
([
-
1
,
0
,
1
])
plt
.
gca
().
invert_yaxis
()
for
i
,
spine
in
enumerate
(
plt
.
gca
().
spines
.
values
()):
if
i
%
2
!=
0
:
spine
.
set_visible
(
False
)
plt
.
show
()
if
__name__
==
"
__main__
"
:
main
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment