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

(feat) Add warning output in coupler

parent 9428bdd1
No related branches found
No related tags found
1 merge request!1BLASTER v1.0
Pipeline #48577 passed
...@@ -79,7 +79,7 @@ class Coupler: ...@@ -79,7 +79,7 @@ class Coupler:
self.tms['inviscid'].start() self.tms['inviscid'].start()
if self.resetInviscid: if self.resetInviscid:
self.isol.reset() self.isol.reset()
self.isol.run() iEc = self.isol.run()
self.tms['inviscid'].stop() self.tms['inviscid'].stop()
# Write inviscid Cp distribution. # Write inviscid Cp distribution.
...@@ -98,7 +98,7 @@ class Coupler: ...@@ -98,7 +98,7 @@ class Coupler:
# Run viscous solver. # Run viscous solver.
self.tms['viscous'].start() self.tms['viscous'].start()
exitCode = self.vsol.run() vEc = self.vsol.run()
self.tms['viscous'].stop() self.tms['viscous'].stop()
aeroCoeffs['Cl'].append(self.isol.getCl()) aeroCoeffs['Cl'].append(self.isol.getCl())
...@@ -111,7 +111,9 @@ class Coupler: ...@@ -111,7 +111,9 @@ class Coupler:
error = abs((cd - cdPrev) / cd) if cd != 0 else 1 error = abs((cd - cdPrev) / cd) if cd != 0 else 1
if error <= self.tol: if error <= self.tol:
print(ccolors.ANSI_GREEN, '{:>4.0f}| {:>7.5f} {:>7.5f} {:>7.5f} | {:>6.4f} {:>6.4f} | {:>6.3f}\n'.format(couplIter, 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_GREEN, '{:>4.0f}| {:>7.5f} {:>7.5f} {:>7.5f} | {:>6.4f} {:>6.4f} | {:>5.0f} {:>5.0f} | {:>6.3f}\n'.format(couplIter, self.isol.getCl(), self.isol.getCd()+self.vsol.Cdf, self.vsol.Cdt, self.vsol.getAverageTransition(0), self.vsol.getAverageTransition(1), iEc, vEc, np.log10(error)), ccolors.ANSI_RESET)
if iEc != 0 or vEc != 0:
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)
return aeroCoeffs return aeroCoeffs
...@@ -119,10 +121,10 @@ class Coupler: ...@@ -119,10 +121,10 @@ class Coupler:
if couplIter == 0: if couplIter == 0:
print('') print('')
print('{:>5s}| {:>7s} {:>7s} {:>7s} | {:>6s} {:>6s} | {:>6s}'.format('It', 'Cl', 'Cd', 'Cdwake', 'xtrT', 'xtrB', 'Error')) print('{:>5s}| {:>7s} {:>7s} {:>7s} | {:>6s} {:>6s} | {:>5s} {:>5s} | {:>6s}'.format('It', 'Cl', 'Cd', 'Cdwake', 'xtrT', 'xtrB', 'iOut', 'vOut', 'Error'))
print(' ----------------------------------------------------------') print(' ----------------------------------------------------------')
if couplIter % self.iterPrint == 0: if couplIter % self.iterPrint == 0:
print(' {:>4.0f}| {:>7.5f} {:>7.5f} {:>7.5f} | {:>6.4f} {:>6.4f} | {:>6.3f}'.format(couplIter, self.isol.getCl(), self.isol.getCd()+self.vsol.Cdf, self.vsol.Cdt, self.vsol.getAverageTransition(0), self.vsol.getAverageTransition(1), np.log10(error))) print(' {:>4.0f}| {:>7.5f} {:>7.5f} {:>7.5f} | {:>6.4f} {:>6.4f} | {:>5.0f} {:>5.0f} | {:>6.3f}'.format(couplIter, self.isol.getCl(), self.isol.getCd()+self.vsol.Cdf, self.vsol.Cdt, self.vsol.getAverageTransition(0), self.vsol.getAverageTransition(1), iEc, vEc, np.log10(error)))
if self.isol.getVerbose() != 0 or self.vsol.verbose != 0: if self.isol.getVerbose() != 0 or self.vsol.verbose != 0:
print('') print('')
couplIter += 1 couplIter += 1
......
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