From cbb05061b509c065eeafeff1ffbc446c5a876b31 Mon Sep 17 00:00:00 2001 From: Paul Dechamps <paulzer@Pauls-MacBook-Pro.local> Date: Tue, 19 Apr 2022 10:42:29 +0200 Subject: [PATCH] Modified lift test to test machine accuracy --- dart/src/wBLRegion.cpp | 2 +- dart/tests/lift.py | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/dart/src/wBLRegion.cpp b/dart/src/wBLRegion.cpp index 4e3e81e..43a776e 100644 --- a/dart/src/wBLRegion.cpp +++ b/dart/src/wBLRegion.cpp @@ -142,7 +142,7 @@ void BLRegion::SetWakeBC(double Re, std::vector<double> UpperCond, std::vector<d void BLRegion::ComputeBlwVel() { DeltaStar[0] = U[0] * U[1]; - Blowing.resize(mesh->GetnMarkers()-1,0); + Blowing.resize(mesh->GetnMarkers()-1, 0.); for (size_t iPoint = 1; iPoint<mesh->GetnMarkers(); ++iPoint) { DeltaStar[iPoint] = U[iPoint*nVar + 0] * U[iPoint*nVar + 1]; diff --git a/dart/tests/lift.py b/dart/tests/lift.py index 54f58b3..623c495 100644 --- a/dart/tests/lift.py +++ b/dart/tests/lift.py @@ -40,7 +40,7 @@ def main(): # define flow variables alpha = 2*math.pi/180 - M_inf = 0.7 + M_inf = 0. c_ref = 1 dim = 2 @@ -79,12 +79,12 @@ def main(): print(tms) # visualize solution and plot results - floD.initViewer(pbl) - tboxU.plot(Cp[:,0], Cp[:,3], 'x', 'Cp', 'Cl = {0:.{3}f}, Cd = {1:.{3}f}, Cm = {2:.{3}f}'.format(solver.Cl, solver.Cd, solver.Cm, 4), True) + #floD.initViewer(pbl) + #tboxU.plot(Cp[:,0], Cp[:,3], 'x', 'Cp', 'Cl = {0:.{3}f}, Cd = {1:.{3}f}, Cm = {2:.{3}f}'.format(solver.Cl, solver.Cd, solver.Cm, 4), True) # check results print(ccolors.ANSI_BLUE + 'PyTesting...' + ccolors.ANSI_RESET) - tests = CTests() + """tests = CTests() if M_inf == 0 and alpha == 3*math.pi/180: tests.add(CTest('min(Cp)', min(Cp[:,3]), -1.1, 1.5e-1)) tests.add(CTest('Cl', solver.Cl, 0.36, 5e-2)) @@ -100,7 +100,9 @@ def main(): tests.add(CTest('Cm', solver.Cm, 0.0, 1e-2)) else: raise Exception('Test not defined for this flow') - tests.run() + tests.run()""" + print('{:.14f}'.format(solver.Cl)) + # eof print('') -- GitLab