import mod_mesh import os, shutil from numpy import * # ut_src = '/mnt/pwfiles/ericdow/utcfd/bin/' src = '/home/ericdow/code/opt_blade_2D/src/' inp = '/home/ericdow/code/opt_blade_2D/input/' rundir = '/home/ericdow/code/opt_blade_2D/input/tmp/' cg_mesh_orig = 'sc10.cgns' cg_mesh_mod = 'sc10_mod.cgns' rpath = 'blade_surf.dat' wpath = 'blade_surf_mod.dat' # number of iterations to run each mesh niter = 3000 # number of cores to run on np = 1 # generate modified mesh nmodes = 5 M = [.005,.005,.005,.005,.005] mod_mesh.modify(src,inp,rundir,cg_mesh_orig,cg_mesh_mod,rpath,wpath,M)
# number of MC samples to run n_mc = 1 # number of iterations to run each mesh niter = 1 # number of cores to run on np = 1 for i in range(n_mc): # create directory to run utcfd in rundir = runs + "run" + "%04d/" % i if not (os.path.exists(rundir)): os.mkdir(rundir) # generate modified mesh mod_mesh.modify(src, inp, cg_mesh_orig, cg_mesh_mod, rpath, wpath) shutil.move(inp + cg_mesh_mod, rundir + "utcfd_in.cgns") # copy casefile to run directory shutil.copy(inp + "casefile.inp", rundir) # run preut (file must be in adf format to run preut) os.chdir(rundir) os.system(ut_src + "preut -f utcfd_in.cgns -b casefile.inp") # copy correct 'utcfd.bc' to run directory shutil.copy(inp + "utcfd.bc", rundir) # set number of iterations in 'utcfd.input' lines = file("utcfd.input").readlines() il = 0
import mod_mesh import os, shutil from numpy import * # ut_src = '/mnt/pwfiles/ericdow/utcfd/bin/' src = '/home/ericdow/code/opt_blade_2D/src/' inp = '/home/ericdow/code/opt_blade_2D/input/' rundir = '/home/ericdow/code/opt_blade_2D/input/tmp/' cg_mesh_orig = 'sc10.cgns' cg_mesh_mod = 'sc10_mod.cgns' rpath = 'blade_surf.dat' wpath = 'blade_surf_mod.dat' # number of iterations to run each mesh niter = 3000 # number of cores to run on np = 1 # generate modified mesh nmodes = 5 M = [.005, .005, .005, .005, .005] mod_mesh.modify(src, inp, rundir, cg_mesh_orig, cg_mesh_mod, rpath, wpath, M)