Пример #1
0
    else:
        svar = "s_{i}"

    if type == 'liftdrag':
        q = "L"
    else:
        q = "F"

    label = r'$\frac{\partial ' + q + '_' + dir + '}{\partial ' + svar + '}$'
    # label=r"$"+label+"$"
    return label


os.system("rm -rf ./results/Ma*/*")

MainText("\nREADING INPUT-FILES")
machvalues, anglevalues, perturbvals, NUMMACH, NUMANGLES, NUMPERTURB = ReadInputFiles(
    'scriptinput/')

MainText("\nSTART PlOTTING")
for type in ['liftdrag', 'force']:
    for index_mach in range(1, NUMMACH + 1):
        if not os.path.exists("./results/Ma" +
                              str(machvalues[index_mach - 1])):
            os.makedirs("./results/Ma" + str(machvalues[index_mach - 1]))
        readmefile = open(
            './results/Ma' + str(machvalues[index_mach - 1]) + '/README.md',
            'a+')
        for index_angle in range(1, NUMANGLES + 1):
            plotfile = './results/Ma' + str(
                machvalues[index_mach - 1]) + '/' + type + '_angle' + str(
Пример #2
0
#!/usr/bin/python3

import os as os
import sys

sys.path.append('../')
from functionlib import extractLifts, doFD, writeCSVana
from functionlib2 import MainText, ReadInfo

os.system("rm -rf ./results/*")

MainText("\nREADING INPUT FILE")
dic = ReadInfo('info')
NUMANGLES = dic['NUMANGLES']
NUMPERTURB = dic['NUMPERTURB']
NUMMACH = dic['NUMMACH']
NUMSHAPEVARS = dic['NUMSHAPEVARS']

perturbvals = []
with open('scriptinput/perturbations') as f:
    for line in f.readlines():
        perturbvals.append(float(line))

MainText("STARTING CALCULATIONS")
for index_mach in range(1, NUMMACH + 1):
    for index_angle in range(1, NUMANGLES + 1):
        for index_shapevar in range(1, NUMSHAPEVARS + 1):
            csvfilename = 'results/sim_' + str(index_mach) + '_' + str(
                index_angle) + '_' + str(index_shapevar) + '.csv'
            with open(csvfilename, 'w') as resultfile:
                resultfile.write("absvar-value,dLx,dLy\n")
Пример #3
0
#!/usr/bin/python

import os as os
import sys

sys.path.append("../")

from functionlib import extractLifts, doFD, writeCSVana
from functionlib2 import MainText, ReadInfo, ReadInputFiles

os.system("rm -rf ./results/*")

#The following lines reads integer key-value pairs from a text file
MainText('\nREADING INPUT-FILES')
machnums, angles, shapevars, perturbvals, NUMMACH, NUMANGLES, NUMSHAPEVARS, NUMPERTURB = ReadInputFiles(
    'scriptinput/')

MainText('STARTING CALCULATIONS')
for type in ['force', 'liftdrag']:
    for index_mach in range(1, NUMMACH + 1):
        for index_angle in range(1, NUMANGLES + 1):
            for index_shapevar in range(1, NUMSHAPEVARS + 1):
                csvfilename = 'results/sim_' + str(index_mach) + '_' + str(
                    index_angle) + '_' + str(
                        index_shapevar) + '_' + type + '.csv'
                print('\033[4mMACH: ' + machnums[index_mach - 1] +
                      '   ANGLE: ' + angles[index_angle - 1] +
                      '   SHAPEVAR: ' + shapevars[index_shapevar - 1] +
                      '\033[00m')
                with open(csvfilename, 'w') as resultfile:
                    resultfile.write("absvar-value,dLx,dLy\n")