diff --git a/blast/tests/su2/t_n0012_su2_2D.py b/blast/tests/su2/t_n0012_su2_2D.py new file mode 100644 index 0000000000000000000000000000000000000000..fc1d0514ff5dbbbefcbf3e14ee52bf59e29d461e --- /dev/null +++ b/blast/tests/su2/t_n0012_su2_2D.py @@ -0,0 +1,68 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +# Copyright 2022 University of Liège +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +# @author Paul Dechamps +# @date 2022 reworked 2025 +# Test the vii implementation using SU2 as the inviscid solver + +# Imports. +import blast.blUtils as vutils +from fwk.wutils import parseargs +from fwk.coloring import ccolors +from fwk.testing import * + +def cfgSu2(verb): + import os + return { + 'filename' : os.path.abspath(os.path.join(os.path.split(os.path.abspath(__file__))[0], "config.cfg")), + 'meshfile': os.path.abspath(os.path.join(os.path.split(os.path.abspath(__file__))[0], "../../models/su2/n0012_su2.su2")), + 'wingTags' : ['airfoil', 'airfoil_'], + 'Verb': verb, # Verbosity level + } + +def cfgBlast(): + return { + 'Re' : 1e7, # Freestream Reynolds number + 'CFL0' : 2, # Inital CFL number of the calculation + 'couplIter': 2, # Maximum number of iterations + 'sections': {'airfoil': [0.0]}, + 'spans': {'airfoil': 1.0}, + 'couplTol' : 1e-4, # Tolerance of the VII methodology + 'iterPrint': 1, # int, number of iterations between outputs + 'resetInv' : True, # bool, flag to reset the inviscid calculation at every iteration. + 'xtrF' : [None, 0.4], # Forced transition locations + 'interpolator' : 'Matching',# Interpolator for the coupling + } + +def main(): + return 0 + args = parseargs() + icfg = cfgSu2(args.verb) + vcfg = cfgBlast() + coupler, isol, vsol = vutils.initBlast(icfg, vcfg, iSolver='SU2', task='analysis') + #coupler.run() + isol.run() + + print(ccolors.ANSI_BLUE + 'PyTesting...' + ccolors.ANSI_RESET) + tests = CTests() + tests.add(CTest('SU2 initialization', isol is not None, True, 0, forceabs=True)) + tests.add(CTest('CL', isol.getCl(), 0.219, 1e-2)) + tests.run() + +if __name__ == "__main__": + main()