From c6e5a3d1411e72e87165a7fffa2f8dfd5de677e4 Mon Sep 17 00:00:00 2001
From: Paul Dechamps <paul.dechamps@uliege.be>
Date: Tue, 7 Jan 2025 17:38:19 +0100
Subject: [PATCH] (feat) Coupler writes the viscous results

---
 blast/coupler.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/blast/coupler.py b/blast/coupler.py
index 58430e8..4d7cfa0 100644
--- a/blast/coupler.py
+++ b/blast/coupler.py
@@ -22,6 +22,7 @@ import fwk
 from fwk.coloring import ccolors
 import math
 import numpy as np
+import blast.utils as vutils
 
 class Coupler:
     def __init__(self, iSolverAPI, vSolver, _maxCouplIter=150, _couplTol=1e-4, _iterPrint=1, _resetInv=False, sfx=''):
@@ -88,7 +89,6 @@ class Coupler:
                 self.isol.updateStagnation()
                 if write:
                     self.isol.writeCp(sfx='_inviscid'+self.filesfx)
-
             # Impose inviscid boundary in the viscous solver.
             self.tms['processing'].start()
             self.isol.getInviscidBC()
@@ -116,6 +116,7 @@ class Coupler:
                     print(ccolors.ANSI_RED, 'Warning: Solver(s) did not converge', ccolors.ANSI_RESET)
                 if write:
                     self.isol.writeCp(sfx='_viscous'+self.filesfx)
+                    _ = vutils.getSolution(self.isol.sec, write=True, toW='all')
                 return aeroCoeffs
             cdPrev = cd
 
@@ -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)
             if write:
                 self.isol.writeCp(sfx='_viscous'+self.filesfx)
+                _ = vutils.getSolution(self.isol.sec, write=True, toW='all')
             return aeroCoeffs
     
     def reset(self):
-- 
GitLab