From 6ffc8e418d50563d3995e88a6609e4f8a6bb3b3f Mon Sep 17 00:00:00 2001
From: Paul Dechamps <paul.dechamps@uliege.be>
Date: Mon, 24 Feb 2025 18:00:10 +0100
Subject: [PATCH] (fix) Fixed bug for case no transition and update high lift
 validation case

---
 blast/src/blDriver.cpp            |  3 +++
 blast/validation/v_highlift_2D.py | 17 ++++++++---------
 2 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/blast/src/blDriver.cpp b/blast/src/blDriver.cpp
index dc5cf15..a23f3dc 100644
--- a/blast/src/blDriver.cpp
+++ b/blast/src/blDriver.cpp
@@ -88,7 +88,10 @@ int Driver::run()
                 if (reg->getName() == "wake" || reg->getName() == "fuselage")
                     reg->setxtr(0.);
                 else if (reg->getName() == "upper" || reg->getName() == "lower")
+                {
+                    reg->transitionNode = reg->nodes.size() - 1;
                     reg->setxtr(1.);
+                }
                 else
                     throw std::runtime_error("Didn't expect region name: " + reg->getName());
 
diff --git a/blast/validation/v_highlift_2D.py b/blast/validation/v_highlift_2D.py
index 4ceacb1..2b937aa 100644
--- a/blast/validation/v_highlift_2D.py
+++ b/blast/validation/v_highlift_2D.py
@@ -72,14 +72,12 @@ def cfgInviscid(nthrds, verb):
 def cfgBlast(verb):
     return {
         'Re' : 3e6,                 # Freestream Reynolds number
-        'Minf' : 0.16,              # Freestream Mach number (used for the computation of the time step only)
-        'CFL0' : 0.1,                 # Inital CFL number of the calculation
-        'Verb': verb,               # Verbosity level of the solver
+        'CFL0' : 5,                 # Inital CFL number of the calculation
+        'sections': {'airfoil': [0]},
         'couplIter': 150,           # Maximum number of iterations
         'couplTol' : 1e-3,          # Tolerance of the VII methodology
         'iterPrint': 1,             # int, number of iterations between outputs
         'resetInv' : False,          # bool, flag to reset the inviscid calculation at every iteration.
-        'sections' : [0],           # List of sections for boundary layer calculation
         'xtrF' : [None, None],      # Forced transition locations
         'interpolator' : 'Matching' # Interpolator for the coupling
     }
@@ -115,7 +113,8 @@ def main():
     print('{0:6.1f}e6 {1:8.2f} {2:8.1f} {3:8.4f} {4:8.4f} {5:8.4f} {6:8.4f} {7:8.4f}'.format(vcfg['Re']/1e6, isol.getMinf(), isol.getAoA()*180/math.pi, isol.getCl(), vsol.Cdt, vsol.Cdp, vsol.Cdf, isol.getCm()))
 
      # Write results to file.
-    bl_solution = vutils.getSolution(isol.sec, write=False)[0]
+    vutils.save(vsol.bodies[0].sections)
+    bl_solution = vutils.getSolution(vsol.bodies[0].sections, write=False)[0]
     tms['total'].stop()
 
     print(ccolors.ANSI_BLUE + 'PyTiming...' + ccolors.ANSI_RESET)
@@ -127,12 +126,12 @@ def main():
     # Test solution
     print(ccolors.ANSI_BLUE + 'PyTesting...' + ccolors.ANSI_RESET)
     tests = CTests()
-    tests.add(CTest('Cl', isol.getCl(), 1.634, 5e-2))
-    tests.add(CTest('Cd wake', vsol.Cdt, 0.0166, 1e-2, forceabs=True))
+    tests.add(CTest('Cl', isol.getCl(), 1.743, 5e-2))
+    tests.add(CTest('Cd wake', vsol.Cdt, 0.0111, 1e-2, forceabs=True))
     tests.add(CTest('Cd integral', vsol.Cdf + isol.getCd(), 0.0212, 1e-2, forceabs=True))
     tests.add(CTest('Cdf', vsol.Cdf, 0.0043, 1e-3, forceabs=True))
-    tests.add(CTest('xtr_top', vsol.getAverageTransition(0), 0.0084, 0.002, forceabs=True))
-    tests.add(CTest('xtr_bot', vsol.getAverageTransition(1), 1.0, 0.01, forceabs=True))
+    tests.add(CTest('xtr_top', vsol.bodies[0].getAvgxtr(0), 0.0082, 0.002, forceabs=True))
+    tests.add(CTest('xtr_bot', vsol.bodies[0].getAvgxtr(1), 1.0, 0.01, forceabs=True))
     tests.run()
 
     # Plot results
-- 
GitLab