Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dartflo
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository 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
dartflo
Commits
c98140c4
Commit
c98140c4
authored
2 years ago
by
Paul Dechamps
Browse files
Options
Downloads
Patches
Plain Diff
Fixed bug in wake BC for VII + Minor improvements.
parent
1f8b1200
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#15451
passed with warnings
1 year ago
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
vii/coupler.py
+6
-6
6 additions, 6 deletions
vii/coupler.py
vii/interfaces/dart/DartInterface.py
+5
-2
5 additions, 2 deletions
vii/interfaces/dart/DartInterface.py
vii/src/DDriver.cpp
+1
-1
1 addition, 1 deletion
vii/src/DDriver.cpp
vii/tests/bli2D.py
+5
-5
5 additions, 5 deletions
vii/tests/bli2D.py
with
17 additions
and
14 deletions
vii/coupler.py
+
6
−
6
View file @
c98140c4
...
...
@@ -52,7 +52,7 @@ class Coupler:
# Write inviscid Cp distribution.
if
couplIter
==
0
:
self
.
iSolverAPI
.
writeCp
()
self
.
iSolverAPI
.
writeCp
(
sfx
=
'
_Inviscid
'
)
# Impose inviscid boundary in the viscous solver.
self
.
tms
[
'
processing
'
].
start
()
...
...
@@ -74,16 +74,16 @@ class Coupler:
# Check convergence status.
error
=
abs
((
self
.
vSolver
.
Cdt
-
cdPrev
)
/
self
.
vSolver
.
Cdt
)
if
self
.
vSolver
.
Cdt
!=
0
else
1
if
error
<=
self
.
couplTol
:
print
(
ccolors
.
ANSI_GREEN
,
'
{:>4.0f}| {:>
10
.5f} {:>
10
.5f} | {:>
10
.4f} {:>
8
.4f} {:>
8.2
f}
\n
'
.
format
(
couplIter
,
self
.
iSolverAPI
.
getCl
(),
self
.
vSolver
.
Cdt
,
self
.
vSolver
.
getxtr
(
0
,
0
),
self
.
vSolver
.
getxtr
(
0
,
1
),
np
.
log10
(
error
)),
ccolors
.
ANSI_RESET
)
print
(
ccolors
.
ANSI_GREEN
,
'
{:>4.0f}| {:>
7
.5f} {:>
7.5f} {:>7
.5f} | {:>
6
.4f} {:>
6
.4f}
|
{:>
6.3
f}
\n
'
.
format
(
couplIter
,
self
.
iSolverAPI
.
getCl
(),
self
.
iSolverAPI
.
getCd
()
+
self
.
vSolver
.
Cdf
,
self
.
vSolver
.
Cdt
,
self
.
vSolver
.
getx
oc
tr
(
0
,
0
),
self
.
vSolver
.
getx
oc
tr
(
0
,
1
),
np
.
log10
(
error
)),
ccolors
.
ANSI_RESET
)
return
aeroCoeffs
cdPrev
=
self
.
vSolver
.
Cdt
if
couplIter
==
0
:
print
(
'
- AoA: {:<2.2f} Mach: {:<1.1f} Re: {:<2.1f}e6
'
.
format
(
self
.
iSolverAPI
.
getAoA
()
*
180
/
math
.
pi
,
self
.
iSolverAPI
.
getMinf
(),
self
.
vSolver
.
getRe
()
/
1e6
))
print
(
'
{:>5s}| {:>
10
s} {:>
10
s} | {:>
10
s} {:>
8
s} {:>
8
s}
'
.
format
(
'
It
'
,
'
Cl
'
,
'
Cd
'
,
'
xtrT
'
,
'
xtrB
'
,
'
Error
'
))
print
(
'
{:>5s}| {:>
7
s} {:>
7s} {:>7
s} | {:>
6
s} {:>
6
s}
|
{:>
6
s}
'
.
format
(
'
It
'
,
'
Cl
'
,
'
Cd
'
,
'
Cdwake
'
,
'
xtrT
'
,
'
xtrB
'
,
'
Error
'
))
print
(
'
----------------------------------------------------------
'
)
if
couplIter
%
self
.
iterPrint
==
0
:
print
(
'
{:>4.0f}| {:>
10
.4f} {:>
10
.4f} | {:>
10
.4f} {:>
8
.4f} {:>
8
.3f}
'
.
format
(
couplIter
,
self
.
iSolverAPI
.
getCl
(),
self
.
vSolver
.
Cdt
,
self
.
vSolver
.
getxtr
(
0
,
0
),
self
.
vSolver
.
getxtr
(
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
.
getx
oc
tr
(
0
,
0
),
self
.
vSolver
.
getx
oc
tr
(
0
,
1
),
np
.
log10
(
error
)))
if
self
.
iSolverAPI
.
getVerbose
()
!=
0
or
self
.
vSolver
.
verbose
!=
0
:
print
(
''
)
couplIter
+=
1
...
...
@@ -91,7 +91,7 @@ class Coupler:
else
:
print
(
ccolors
.
ANSI_RED
,
'
Maximum number of {:<.0f} coupling iterations reached
'
.
format
(
self
.
maxCouplIter
),
ccolors
.
ANSI_RESET
)
print
(
''
)
print
(
'
{:>5s}| {:>
10
s} {:>
10
s} | {:>
10
s} {:>8s} {:>
8
s}
'
.
format
(
'
It
'
,
'
Cl
'
,
'
Cd
'
,
'
xtrT
'
,
'
xtrB
'
,
'
Error
'
))
print
(
'
{:>5s}| {:>
7s} {:>7
s} {:>
7
s} | {:>
6
s} {:>8s}
|
{:>
6
s}
'
.
format
(
'
It
'
,
'
Cl
'
,
'
Cd
'
,
'
Cdwake
'
,
'
xtrT
'
,
'
xtrB
'
,
'
Error
'
))
print
(
'
----------------------------------------------------------
'
)
print
(
ccolors
.
ANSI_RED
,
'
{:>4.0f}| {:>
10
.5f} {:>
10
.5f} | {:>
10
.4f} {:>
8
.4f} {:>
8.2
f}
\n
'
.
format
(
couplIter
,
self
.
iSolverAPI
.
getCl
(),
self
.
vSolver
.
Cdt
,
self
.
vSolver
.
getxtr
(
0
,
0
),
self
.
vSolver
.
getxtr
(
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.3
f}
\n
'
.
format
(
couplIter
,
self
.
iSolverAPI
.
getCl
(),
self
.
iSolverAPI
.
getCd
()
+
self
.
vSolver
.
Cdf
,
self
.
vSolver
.
Cdt
,
self
.
vSolver
.
getx
oc
tr
(
0
,
0
),
self
.
vSolver
.
getx
oc
tr
(
0
,
1
),
np
.
log10
(
error
)),
ccolors
.
ANSI_RESET
)
return
aeroCoeffs
\ No newline at end of file
This diff is collapsed.
Click to expand it.
vii/interfaces/dart/DartInterface.py
+
5
−
2
View file @
c98140c4
...
...
@@ -50,11 +50,11 @@ class DartInterface:
def
run
(
self
):
return
self
.
solver
.
run
()
def
writeCp
(
self
):
def
writeCp
(
self
,
sfx
=
''
):
"""
Write Cp distribution around the airfoil on file.
"""
Cp
=
floU
.
extract
(
self
.
group
[
0
].
boundary
.
tag
.
elems
,
self
.
solver
.
Cp
)
tboxU
.
write
(
Cp
,
'
Cp
_Inviscid
.dat
'
,
'
%1.5e
'
,
'
,
'
,
'
x, y, z, Cp
'
,
''
)
tboxU
.
write
(
Cp
,
'
Cp
'
+
sfx
+
'
.dat
'
,
'
%1.5e
'
,
'
,
'
,
'
x, y, z, Cp
'
,
''
)
def
save
(
self
,
writer
):
self
.
solver
.
save
(
writer
)
...
...
@@ -67,6 +67,9 @@ class DartInterface:
def
getCl
(
self
):
return
self
.
solver
.
Cl
def
getCd
(
self
):
return
self
.
solver
.
Cd
def
getCm
(
self
):
return
self
.
solver
.
Cm
...
...
This diff is collapsed.
Click to expand it.
vii/src/DDriver.cpp
+
1
−
1
View file @
c98140c4
...
...
@@ -191,7 +191,7 @@ int Driver::run(unsigned int const couplIter)
for
(
size_t
k
=
0
;
k
<
upperConditions
.
size
();
++
k
)
{
upperConditions
[
k
]
=
sections
[
iSec
][
0
]
->
u
[(
sections
[
iSec
][
0
]
->
mesh
->
getnMarkers
()
-
1
)
*
sections
[
iSec
][
0
]
->
getnVar
()
+
k
];
lowerConditions
[
k
]
=
sections
[
iSec
][
0
]
->
u
[(
sections
[
iSec
][
1
]
->
mesh
->
getnMarkers
()
-
1
)
*
sections
[
iSec
][
1
]
->
getnVar
()
+
k
];
lowerConditions
[
k
]
=
sections
[
iSec
][
1
]
->
u
[(
sections
[
iSec
][
1
]
->
mesh
->
getnMarkers
()
-
1
)
*
sections
[
iSec
][
1
]
->
getnVar
()
+
k
];
}
sections
[
iSec
][
iRegion
]
->
setWakeBC
(
Re
,
upperConditions
,
lowerConditions
);
lockTrans
=
true
;
...
...
This diff is collapsed.
Click to expand it.
vii/tests/bli2D.py
+
5
−
5
View file @
c98140c4
...
...
@@ -55,7 +55,7 @@ def main():
Re
=
1e7
alpha
=
2.
*
math
.
pi
/
180
M_inf
=
0.2
xtrF
=
[
-
1
,
0.4
5
]
xtrF
=
[
-
1
,
0.4
0
]
# Numerical parameters.
CFL0
=
1
...
...
@@ -112,11 +112,11 @@ def main():
# Test for n0012 (le=0.01, te=0.01), alpha=2, M=.2, Re=1e7.
print
(
ccolors
.
ANSI_BLUE
+
'
PyTesting...
'
+
ccolors
.
ANSI_RESET
)
tests
=
CTests
()
tests
.
add
(
CTest
(
'
Cl
'
,
iSolverAPI
.
getCl
(),
0.23
44
,
5e-3
))
# XFOIL 0.2325
tests
.
add
(
CTest
(
'
Cd
'
,
vSolution
[
'
Cdt
'
],
0.005
5
,
1e-3
,
forceabs
=
True
))
# XFOIL 0.00531
tests
.
add
(
CTest
(
'
Cdp
'
,
vSolution
[
'
Cdp
'
],
0.00
1
0
,
1e-3
,
forceabs
=
True
))
# XFOIL 0.00084, Cdf = 0.00447
tests
.
add
(
CTest
(
'
Cl
'
,
iSolverAPI
.
getCl
(),
0.23
5
,
5e-3
))
# XFOIL 0.2325
tests
.
add
(
CTest
(
'
Cd
'
,
vSolution
[
'
Cdt
'
],
0.005
1
,
1e-3
,
forceabs
=
True
))
# XFOIL 0.00531
tests
.
add
(
CTest
(
'
Cdp
'
,
vSolution
[
'
Cdp
'
],
0.000
5
,
1e-3
,
forceabs
=
True
))
# XFOIL 0.00084, Cdf = 0.00447
tests
.
add
(
CTest
(
'
xtr_top
'
,
vSolution
[
'
xtrT
'
],
0.21
,
0.03
,
forceabs
=
True
))
# XFOIL 0.1877
tests
.
add
(
CTest
(
'
xtr_bot
'
,
vSolution
[
'
xtrB
'
],
0.4
5
,
0.01
,
forceabs
=
True
))
# XFOIL 0.4998
tests
.
add
(
CTest
(
'
xtr_bot
'
,
vSolution
[
'
xtrB
'
],
0.4
0
,
0.01
,
forceabs
=
True
))
# XFOIL 0.4998
tests
.
run
()
# eof
...
...
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