Skip to content
Snippets Groups Projects
Commit cd46ad3b authored by acrovato's avatar acrovato
Browse files

Add wung fuselage test case. Minor bug fix.

parent 40206990
No related branches found
No related tags found
1 merge request!40Flow v1.4
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# @brief Boeign 737 (modified) configuration file for flow trim script
# @authors Adrien Crovato
def getParam():
p = {}
# Specific
rlems = 1.5*0.06 # root leading edge mesh size
rtems = 1.5*0.06 # root trailing edge mesh size
klems = 1.5*0.039 # kink leading edge mesh size
ktems = 1.5*0.039 # kink trailing edge mesh size
tlems = 1.5*0.014 # tip leading mesh size
ttems = 0.06 # tip trailing mesh size
fums = 0.1 # fuselage mesh size
fams = 4. # farfield mesh size
# Input/Output
p['File'] = '../models/b737mod.geo' # Input file containing the model
p['Pars'] = {'msLe0' : rlems, 'msTe0' : rtems, 'msLe1' : klems, 'msTe1' : ktems, 'msLe2' : tlems, 'msTe2' : ttems, 'msFus' : fums, 'msFar' : fams} # Parameters for input file model
p['Dim'] = 3 # Problem dimension
p['Format'] = 'vtk' # Save format (vtk or gmsh)
p['Slice'] = [3.5, 5.3, 10.5] # array of (y) coordinates to perform slice along the span (empty if none)
p['TagId'] = 5 # tag number of physical group to be sliced
# Markers
p['Fluid'] = 'field' # Name of physical group containing the fluid
p['Farfield'] = ['farfield', 'downstream'] # LIST of name of physical groups containing the farfield boundaries (downstream should be last element)
p['Symmetry'] = 'symmetry' # Name of physical group containing the symmetry boundaries
p['Body'] = ['wing', 'fuselage'] # LIST of name of physical groups containing the (solid) body boundary
p['Wake'] = 'wake' # Name of physical group containing the wake
p['WakeTip'] = 'wakeTip' # Name of physical group containing the edge of the wake
p['TeTip'] = 'teTip' # Name of physical group containing the edge of the wake and the trailing edge
# Freestream
p['M_inf'] = 0.75 # Freestream Mach number
p['CL'] = 0.3 # Target lift coefficient
p['AoA'] = 0. # Freestream angle of attack (guess)
p['dCL'] = 10.0 # Slope of CL w.r.t AoA [1/rad] (guess)
# Geometry
p['S_ref'] = 55.0 # Reference surface length
p['c_ref'] = 3.8 # Reference chord length
p['x_ref'] = 10.15 # Reference point for moment computation (x)
p['y_ref'] = 1.85 # Reference point for moment computation (y)
p['z_ref'] = -0.5 # Reference point for moment computation (z)
# Numerical
p['NSolver'] = 'Newton' # Noninear solver type (Picard or Newton)
p['Rel_tol'] = 1e-6 # Relative tolerance on solver residual
p['Abs_tol'] = 1e-8 # Absolute tolerance on solver residual
p['Max_it'] = 15 # Solver maximum number of iterations
p['LS_tol'] = 1e-6 # Tolerance on linesearch residual
p['Max_it_LS'] = 10 # Linesearch maximum number of iterations
p['AV_thrsh'] = 1e-2 # Residual threshold below which the artificial viscosity is decreased
p['M_crit'] = 5. # Critical Mach number above which density is damped
# Thermodynamic
p['gamma'] = 1.4 # Specific heat ratio
return p
def main():
# Arguments parser
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("-k", help="nb of threads", type=int, default=1)
args, extra = parser.parse_known_args()
# Script call
import flow.scripts.trim as t
trim = t.Trim(getParam(), args.k)
trim.run()
trim.disp()
if __name__ == "__main__":
main()
\ No newline at end of file
This diff is collapsed.
......@@ -35,7 +35,6 @@ class Config:
# mesh the airfoil
print ccolors.ANSI_BLUE + 'Meshing the airfoil...' + ccolors.ANSI_RESET
self.msh = gmsh.MeshLoader(p['File'],__file__).execute(**p['Pars'])
self.mshWriter = Writer(self.msh)
gmshWriter = tbox.GmshExport(self.msh)
if p['Dim'] == 2:
mshCrck = tbox.MshCrack(self.msh, p['Dim'])
......@@ -50,6 +49,7 @@ class Config:
mshCrck.run(gmshWriter)
del gmshWriter
del mshCrck
self.mshWriter = Writer(self.msh)
print '\n'
# initialize the problem
......
......@@ -44,7 +44,9 @@ class Trim(Config):
self.velInfFun.set_v(-U_inf[0], -U_inf[1], -U_inf[2])
# run the solver
self.tms["solver"].start()
self.solver.run()
sucess = self.solver.run()
if not sucess:
raise RuntimeError('Flow solver diverged!\n')
self.tms["solver"].stop()
# update slope
if it != 0:
......
......@@ -55,7 +55,6 @@ def main():
tms['msh'].start()
pars = {'xL' : lgt, 'yL' : wdt, 'zL' : hgt, 'xO' : xO, 'zO' : zO, 'msLeRt' : rlems, 'msTeRt' : rtems, 'msLeTp' : tlems, 'msTeTp' : ttems, 'msF' : fms}
msh = gmsh.MeshLoader("../models/agard445.geo",__file__).execute(**pars)
writer = BestWriter(msh)
# crack the mesh
gmshWriter = tbox.GmshExport(msh)
mshCrck = tbox.MshCrack(msh, dim)
......@@ -64,6 +63,7 @@ def main():
mshCrck.addExcluded('wakeTip')
mshCrck.run(gmshWriter)
del mshCrck
writer = BestWriter(msh)
tms['msh'].stop()
# set the problem and add medium, initial/boundary conditions
......
......@@ -53,7 +53,6 @@ def main():
tms['msh'].start()
pars = {'lgt' : lgt, 'wdt' : wdt, 'hgt' : hgt, 'msLeRt' : rlems, 'msTeRt' : rtems, 'msLeTp' : tlems, 'msTeTp' : ttems, 'msF' : fms}
msh = gmsh.MeshLoader("../models/oneraM6.geo",__file__).execute(**pars)
writer = BestWriter(msh)
# crack the mesh
gmshWriter = tbox.GmshExport(msh)
mshCrck = tbox.MshCrack(msh, dim)
......@@ -62,6 +61,7 @@ def main():
mshCrck.addExcluded('wakeTip')
mshCrck.run(gmshWriter)
del mshCrck
writer = BestWriter(msh)
tms['msh'].stop()
# set the problem and add medium, initial/boundary conditions
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment