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
c6e5a3d1
Verified
Commit
c6e5a3d1
authored
3 months ago
by
Paul Dechamps
Browse files
Options
Downloads
Patches
Plain Diff
(feat) Coupler writes the viscous results
parent
7e2b47ce
No related branches found
Branches containing commit
No related tags found
1 merge request
!1
BLASTER v1.0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
blast/coupler.py
+3
-1
3 additions, 1 deletion
blast/coupler.py
with
3 additions
and
1 deletion
blast/coupler.py
+
3
−
1
View file @
c6e5a3d1
...
@@ -22,6 +22,7 @@ import fwk
...
@@ -22,6 +22,7 @@ import fwk
from
fwk.coloring
import
ccolors
from
fwk.coloring
import
ccolors
import
math
import
math
import
numpy
as
np
import
numpy
as
np
import
blast.utils
as
vutils
class
Coupler
:
class
Coupler
:
def
__init__
(
self
,
iSolverAPI
,
vSolver
,
_maxCouplIter
=
150
,
_couplTol
=
1e-4
,
_iterPrint
=
1
,
_resetInv
=
False
,
sfx
=
''
):
def
__init__
(
self
,
iSolverAPI
,
vSolver
,
_maxCouplIter
=
150
,
_couplTol
=
1e-4
,
_iterPrint
=
1
,
_resetInv
=
False
,
sfx
=
''
):
...
@@ -88,7 +89,6 @@ class Coupler:
...
@@ -88,7 +89,6 @@ class Coupler:
self
.
isol
.
updateStagnation
()
self
.
isol
.
updateStagnation
()
if
write
:
if
write
:
self
.
isol
.
writeCp
(
sfx
=
'
_inviscid
'
+
self
.
filesfx
)
self
.
isol
.
writeCp
(
sfx
=
'
_inviscid
'
+
self
.
filesfx
)
# Impose inviscid boundary in the viscous solver.
# Impose inviscid boundary in the viscous solver.
self
.
tms
[
'
processing
'
].
start
()
self
.
tms
[
'
processing
'
].
start
()
self
.
isol
.
getInviscidBC
()
self
.
isol
.
getInviscidBC
()
...
@@ -116,6 +116,7 @@ class Coupler:
...
@@ -116,6 +116,7 @@ class Coupler:
print
(
ccolors
.
ANSI_RED
,
'
Warning: Solver(s) did not converge
'
,
ccolors
.
ANSI_RESET
)
print
(
ccolors
.
ANSI_RED
,
'
Warning: Solver(s) did not converge
'
,
ccolors
.
ANSI_RESET
)
if
write
:
if
write
:
self
.
isol
.
writeCp
(
sfx
=
'
_viscous
'
+
self
.
filesfx
)
self
.
isol
.
writeCp
(
sfx
=
'
_viscous
'
+
self
.
filesfx
)
_
=
vutils
.
getSolution
(
self
.
isol
.
sec
,
write
=
True
,
toW
=
'
all
'
)
return
aeroCoeffs
return
aeroCoeffs
cdPrev
=
cd
cdPrev
=
cd
...
@@ -136,6 +137,7 @@ class Coupler:
...
@@ -136,6 +137,7 @@ class Coupler:
print
(
ccolors
.
ANSI_RED
,
'
{:>4.0f}| {:>7.5f} {:>7.5f} {:>7.5f} | {:>6.4f} {:>7.4f} | {:>6.3f}
\n
'
.
format
(
couplIter
-
1
,
self
.
isol
.
getCl
(),
self
.
isol
.
getCd
()
+
self
.
vsol
.
Cdf
,
self
.
vsol
.
Cdt
,
self
.
vsol
.
getAverageTransition
(
0
),
self
.
vsol
.
getAverageTransition
(
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
-
1
,
self
.
isol
.
getCl
(),
self
.
isol
.
getCd
()
+
self
.
vsol
.
Cdf
,
self
.
vsol
.
Cdt
,
self
.
vsol
.
getAverageTransition
(
0
),
self
.
vsol
.
getAverageTransition
(
1
),
np
.
log10
(
error
)),
ccolors
.
ANSI_RESET
)
if
write
:
if
write
:
self
.
isol
.
writeCp
(
sfx
=
'
_viscous
'
+
self
.
filesfx
)
self
.
isol
.
writeCp
(
sfx
=
'
_viscous
'
+
self
.
filesfx
)
_
=
vutils
.
getSolution
(
self
.
isol
.
sec
,
write
=
True
,
toW
=
'
all
'
)
return
aeroCoeffs
return
aeroCoeffs
def
reset
(
self
):
def
reset
(
self
):
...
...
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