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
3e9aa7b7
Verified
Commit
3e9aa7b7
authored
1 year ago
by
Paul Dechamps
Browse files
Options
Downloads
Patches
Plain Diff
(feat) Average of transition
Driver now computes the average position of the transition
parent
bc2c3362
No related branches found
No related tags found
1 merge request
!1
BLASTER v1.0
Pipeline
#19927
passed
1 year ago
Stage: build
Stage: test
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
blast/coupler.py
+2
-2
2 additions, 2 deletions
blast/coupler.py
blast/src/DDriver.cpp
+9
-0
9 additions, 0 deletions
blast/src/DDriver.cpp
blast/src/DDriver.h
+1
-0
1 addition, 0 deletions
blast/src/DDriver.h
blast/utils.py
+5
-3
5 additions, 3 deletions
blast/utils.py
with
17 additions
and
5 deletions
blast/coupler.py
+
2
−
2
View file @
3e9aa7b7
...
...
@@ -87,7 +87,7 @@ class Coupler:
print
(
'
{:>5s}| {:>7s} {:>7s} {:>7s} | {:>6s} {:>6s} | {:>6s}
'
.
format
(
'
It
'
,
'
Cl
'
,
'
Cd
'
,
'
Cdwake
'
,
'
xtrT
'
,
'
xtrB
'
,
'
Error
'
))
print
(
'
----------------------------------------------------------
'
)
if
couplIter
%
self
.
iterPrint
==
0
:
print
(
'
{:>4.0f}| {:>7.4f} {:>7.4f} {:>7.4f} | {:>6.4f} {:>6.4f} | {:>6.3f}
'
.
format
(
couplIter
,
self
.
iSolverAPI
.
getCl
(),
self
.
iSolverAPI
.
getCd
()
+
self
.
vSolver
.
Cdf
,
self
.
vSolver
.
Cdt
,
self
.
vSolver
.
getxoctr
(
0
,
0
),
self
.
vSolver
.
getxoctr
(
0
,
1
),
np
.
log10
(
error
)))
print
(
'
{:>4.0f}| {:>7.4f} {:>7.4f} {:>7.4f} | {:>6.4f} {:>6.4f} | {:>6.3f}
'
.
format
(
couplIter
,
self
.
iSolverAPI
.
getCl
(),
self
.
iSolverAPI
.
getCd
()
+
self
.
vSolver
.
Cdf
,
self
.
vSolver
.
Cdt
,
self
.
vSolver
.
get
Avrg
xoctr
(
0
),
self
.
vSolver
.
get
Avrg
xoctr
(
1
),
np
.
log10
(
error
)))
if
self
.
iSolverAPI
.
getVerbose
()
!=
0
or
self
.
vSolver
.
verbose
!=
0
:
print
(
''
)
couplIter
+=
1
...
...
@@ -97,6 +97,6 @@ class Coupler:
print
(
''
)
print
(
'
{:>5s}| {:>7s} {:>7s} {:>7s} | {:>6s} {:>8s} | {:>6s}
'
.
format
(
'
It
'
,
'
Cl
'
,
'
Cd
'
,
'
Cdwake
'
,
'
xtrT
'
,
'
xtrB
'
,
'
Error
'
))
print
(
'
----------------------------------------------------------
'
)
print
(
ccolors
.
ANSI_RED
,
'
{:>4.0f}| {:>7.5f} {:>7.5f} {:>7.5f} | {:>6.4f} {:>7.4f} | {:>6.3f}
\n
'
.
format
(
couplIter
,
self
.
iSolverAPI
.
getCl
(),
self
.
iSolverAPI
.
getCd
()
+
self
.
vSolver
.
Cdf
,
self
.
vSolver
.
Cdt
,
self
.
vSolver
.
getxoctr
(
0
,
0
),
self
.
vSolver
.
getxoctr
(
0
,
1
),
np
.
log10
(
error
)),
ccolors
.
ANSI_RESET
)
print
(
ccolors
.
ANSI_RED
,
'
{:>4.0f}| {:>7.5f} {:>7.5f} {:>7.5f} | {:>6.4f} {:>7.4f} | {:>6.3f}
\n
'
.
format
(
couplIter
,
self
.
iSolverAPI
.
getCl
(),
self
.
iSolverAPI
.
getCd
()
+
self
.
vSolver
.
Cdf
,
self
.
vSolver
.
Cdt
,
self
.
vSolver
.
get
Avrg
xoctr
(
0
),
self
.
vSolver
.
get
Avrg
xoctr
(
1
),
np
.
log10
(
error
)),
ccolors
.
ANSI_RESET
)
self
.
iSolverAPI
.
writeCp
(
sfx
=
'
_viscous
'
+
self
.
filesfx
)
return
aeroCoeffs
This diff is collapsed.
Click to expand it.
blast/src/DDriver.cpp
+
9
−
0
View file @
3e9aa7b7
...
...
@@ -393,6 +393,15 @@ void Driver::computeSectionalDrag(std::vector<BoundaryLayer *> const &bl, size_t
Cdp_sec
[
i
]
=
Cdt_sec
[
i
]
-
Cdf_sec
[
i
];
}
double
Driver
::
getAvrgxoctr
(
size_t
const
iRegion
)
const
{
double
xtr
=
0.0
;
for
(
size_t
iSec
=
0
;
iSec
<
sections
.
size
();
++
iSec
)
xtr
+=
sections
[
iSec
][
iRegion
]
->
xoctr
;
xtr
/=
sections
.
size
();
return
xtr
;
}
/**
* @brief Compute total drag coefficient on the airfoil/wing.
* Performs the sectional drag integration for 3D computations.
...
...
This diff is collapsed.
Click to expand it.
blast/src/DDriver.h
+
1
−
0
View file @
3e9aa7b7
...
...
@@ -45,6 +45,7 @@ public:
// Getters.
double
getxtr
(
size_t
iSec
,
size_t
iRegion
)
const
{
return
sections
[
iSec
][
iRegion
]
->
xtr
;
};
double
getxoctr
(
size_t
iSec
,
size_t
iRegion
)
const
{
return
sections
[
iSec
][
iRegion
]
->
xoctr
;
};
double
getAvrgxoctr
(
size_t
const
iRegion
)
const
;
double
getRe
()
const
{
return
Re
;
};
std
::
vector
<
std
::
vector
<
double
>>
getSolution
(
size_t
iSec
);
...
...
This diff is collapsed.
Click to expand it.
blast/utils.py
+
5
−
3
View file @
3e9aa7b7
...
...
@@ -67,6 +67,8 @@ def initBlast(iconfig, vconfig, iSolver='DART'):
if
'
nSections
'
not
in
vconfig
:
vconfig
[
'
nSections
'
]
=
len
(
vconfig
[
'
sections
'
])
if
'
sfx
'
not
in
vconfig
:
vconfig
[
'
sfx
'
]
=
''
# Viscous solver
vSolver
=
initBL
(
vconfig
[
'
Re
'
],
vconfig
[
'
Minf
'
],
vconfig
[
'
CFL0
'
],
vconfig
[
'
nSections
'
],
xtrF
=
vconfig
[
'
xtrF
'
])
...
...
@@ -80,7 +82,7 @@ def initBlast(iconfig, vconfig, iSolver='DART'):
# Coupler
import
blast.coupler
as
blastCoupler
coupler
=
blastCoupler
.
Coupler
(
iSolverAPI
,
vSolver
,
_maxCouplIter
=
vconfig
[
'
couplIter
'
],
_couplTol
=
vconfig
[
'
couplTol
'
],
_iterPrint
=
vconfig
[
'
iterPrint
'
],
_resetInv
=
vconfig
[
'
resetInv
'
])
coupler
=
blastCoupler
.
Coupler
(
iSolverAPI
,
vSolver
,
_maxCouplIter
=
vconfig
[
'
couplIter
'
],
_couplTol
=
vconfig
[
'
couplTol
'
],
_iterPrint
=
vconfig
[
'
iterPrint
'
],
_resetInv
=
vconfig
[
'
resetInv
'
]
,
sfx
=
vconfig
[
'
sfx
'
]
)
return
coupler
,
iSolverAPI
,
vSolver
def
mesh
(
file
,
pars
):
...
...
@@ -131,8 +133,8 @@ def getSolution(vSolver, iSec=0):
'
y
'
:
solverOutput
[
17
],
'
z
'
:
solverOutput
[
18
],
'
ueInv
'
:
solverOutput
[
19
],
'
xtrT
'
:
vSolver
.
get
xtr
(
iSec
,
0
),
'
xtrB
'
:
vSolver
.
get
xtr
(
iSec
,
1
),
'
xtrT
'
:
vSolver
.
get
Avrgxoctr
(
0
),
'
xtrB
'
:
vSolver
.
get
Avrgxoctr
(
1
),
'
Cdt_w
'
:
vSolver
.
Cdt_sec
[
iSec
],
'
Cdf
'
:
vSolver
.
Cdf_sec
[
iSec
],
'
Cdp
'
:
vSolver
.
Cdp_sec
[
iSec
]
...
...
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