Skip to content
Snippets Groups Projects
Verified Commit c6e5a3d1 authored by Paul Dechamps's avatar Paul Dechamps :speech_balloon:
Browse files

(feat) Coupler writes the viscous results

parent 7e2b47ce
No related branches found
No related tags found
1 merge request!1BLASTER v1.0
...@@ -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):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment