PIbd-42_SSPR/runner_db.py

59 lines
2.1 KiB
Python
Raw Normal View History

from insert_to_db import add_data_to_db
import macros_generator as mg
import yaml
# Загрузка конфигурации из файла config.yaml
with open('config.yaml', 'r') as config_file:
config = yaml.safe_load(config_file)
DIAMETERS = config['parameters']['diameters']
# outer_blades_count = [12, 24, 36, 48]
outer_blades_count = 24.0
# outer_blades_length = [44, 70, 86, 107.5]
outer_blades_length = 70.0
outer_blades_angle = [30.0, 45.0, 60.0, 75.0]
# middle_blades_count = [9, 18, 27, 36]
middle_blades_count = 18.0
# load = [190, 260, 315, 400, 465]
# load_eco = [260, 315, 400, 465]
load = [190, 260, 315, 400, 465]
# recycling_eco = [0, 7, 14, 21, 28]
recycling_full = [0, 5, 8, 10, 15, 20, 25, 30]
# recycling = [0, 6, 12, 18, 24, 30]
# recycling = [0, 5, 8]
for angle in outer_blades_angle:
for current_load in load:
for current_recycling in recycling_full:
experiment_parameters = {
'outer_blades_count': outer_blades_count,
'outer_blades_length': outer_blades_length,
'outer_blades_angle': angle,
'middle_blades_count': middle_blades_count,
'load': current_load,
'recycling': current_recycling,
}
_cur_diameters = DIAMETERS.copy()
fuel_parameters = mg.load_calculation(float(current_load), _cur_diameters)
load_parameters = {
'load': current_load,
'primary_air_consumption': fuel_parameters['primary_air_consumption'],
'secondary_air_consumption': fuel_parameters['secondary_air_consumption'],
'gas_inlet_consumption': fuel_parameters['gas_inlet_consumption']
}
recycling_parameters = mg.recycling_calculation(
fuel_parameters['alpha'], fuel_parameters['gas_consumption'], fuel_parameters['air_consumption'],
float(current_recycling))
recycling_parameters['load'] = float(current_load)
recycling_parameters['recycling_level'] = float(current_recycling)
add_data_to_db(experiment_parameters, load_parameters, recycling_parameters)