Skip to content
Snippets Groups Projects

[Flow-v1.3] API change and improved scripts

Merged Boman Romain requested to merge adrien into master
11 files
+ 176
75
Compare changes
  • Side-by-side
  • Inline
Files
11
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# @brief Parameters definition (configuration file) for flow module
# @brief NACA0012 airfoil configuration file for flow polar script
# @authors Adrien Crovato
from fwk.wutils import parseargs
def getParam():
args = parseargs()
p = {}
# Input/Output
p['File'] = '../models/n0012.geo' # Input file containing the model
@@ -16,13 +13,10 @@ def getParam():
p['Format'] = 'vtk' # Save format (vtk or gmsh)
# Markers
p['Fluid'] = 'field' # Name of physical group containing the fluid
p['Farfield'] = ['upstream', 'side', 'downstream'] # Name of physical group containing the farfield boundaries (downstream should be last element)
p['Symmetry'] = [] # Name of physical group containing the symmetry boundaries (none for 2D)
p['Farfield'] = ['upstream', 'side', 'downstream'] # Name of physical groups containing the farfield boundaries (downstream should be last element)
p['Body'] = 'airfoil' # Name of physical group containing the (solid) body boundary
p['Wake'] = 'wake' # Name of physical group containing the wake
p['Te'] = 'te' # Name of physical group containing the trailing edge (none for 3D)
p['wakeTip'] = [] # Name of physical group containing the edge of the wake (none for 2D)
p['TeTip'] = [] # Name of physical group containing the edge of the wake and the trailing edge (none for 2D)
p['Te'] = 'te' # Name of physical group containing the trailing edge
# Freestream
p['M_inf'] = 0.3 # Freestream Mach number
p['AoA_begin'] = -3. # Freestream angle of attack (begin)
@@ -35,14 +29,28 @@ def getParam():
p['y_ref'] = 0. # Reference point for moment computation (y)
p['z_ref'] = 0. # Reference point for moment computation (z)
# Numerical
p['nthreads'] = args.k # Number of threads
p['Rel_tol'] = 1e-6 # Relative tolerance on solver residual
p['Abs_tol'] = 1e-8 # Absolute tolerance on solver residual
p['LS_tol'] = 1e-6 # Tolerance on linesearch residual
p['Max_it'] = 50 # Solver maximum number of iterations
p['Max_it'] = 10 # Solver maximum number of iterations
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.polar as polar
p = getParam()
polar.run(p, args.k)
if __name__ == "__main__":
main()
Loading