# 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
# Test the blast implementation. The test case is a compressible attached transitional flow.
# Tested functionalities;
# - Time integration.
# - Two time-marching techniques (agressive and safe).
# - Transition routines.
# - Forced transition.
# - Compressible flow routines.
# - Laminar and turbulent flow.
#
# Untested functionalities.
# - Separation routines.
# - Multiple failure case at one iteration.
# - Response to unconverged inviscid solver.
# Imports.
importblast.utilsasviscUtils
importnumpyasnp
importos.path
fromfwk.wutilsimportparseargs
importfwk
fromfwk.testingimport*
fromfwk.coloringimportccolors
importmath
defcfgInviscid(nthrds,verb):
# Parameters
return{
# Options
'scenario':'aerodynamic',
'task':'analysis',
'Threads':nthrds,# number of threads
'Verb':verb,# verbosity
# Model (geometry or mesh)
'File':os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))+'/modules/dartflo/dart/models/agard445.geo',# Input file containing the model
'Pars':{'xL':7.,'yL':3.,'zL':6.,'xO':-3,'zO':-3,'msLeRt':0.0028,'msTeRt':0.0056,'msLeTp':0.0018,'msTeTp':0.0036,'msF':1.0},# parameters for input file model
'Dim':3,# problem dimension
'Format':'vtk',# save format (vtk or gmsh)
# Markers
'Fluid':'field',# name of physical group containing the fluid
'Farfield':['upstream','farfield','downstream'],# LIST of names of physical groups containing the farfield boundaries (upstream/downstream should be first/last element)
'Wings':['wing'],# LIST of names of physical groups containing the lifting surface boundary
'Wakes':['wake'],# LIST of names of physical group containing the wake
'WakeTips':['wakeTip'],# LIST of names of physical group containing the edge of the wake
'Tes':['te'],# LIST of names of physical group containing the trailing edge
'dbc':True,
'Upstream':'upstream',
# Freestream
'M_inf':0.954,# freestream Mach number
'AoA':1,# freestream angle of attack
# Geometry
'S_ref':0.35,# reference surface length
'c_ref':0.47,# reference chord length
'x_ref':0.0,# reference point for moment computation (x)
'y_ref':0.0,# reference point for moment computation (y)
'z_ref':0.0,# reference point for moment computation (z)
# Numerical
'LSolver':'GMRES',# inner solver (Pardiso, MUMPS or GMRES)
'G_fill':2,# fill-in factor for GMRES preconditioner
'G_tol':1e-5,# tolerance for GMRES
'G_restart':50,# restart for GMRES
'Rel_tol':1e-6,# relative tolerance on solver residual
'Abs_tol':1e-8,# absolute tolerance on solver residual
'Max_it':50# solver maximum number of iterations
}
defcfgBlast(verb):
return{
'Re':6.7e6,# Freestream Reynolds number
'Minf':0.954,# Freestream Mach number (used for the computation of the time step only)
'CFL0':1,# Inital CFL number of the calculation
'sections':np.linspace(0.026,0.7,15),
'writeSections':np.linspace(0.01,0.76,15),
'Sym':[0.],
'span':0.762,
'interpolator':'Rbf',
'rbftype':'linear',
'smoothing':1e-8,
'degree':0,
'neighbors':10,
'saveTag':5,
'Verb':verb,# Verbosity level of the solver
'couplIter':100,# Maximum number of iterations
'couplTol':1e-3,# 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.