|
[Sponsors] |
Design3D : Compute Thrust and Torque for every sample in database generation |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 29, 2023, 13:53 |
Design3D : Compute Thrust and Torque for every sample in database generation
|
#1 |
New Member
Gerard Talla
Join Date: Apr 2023
Posts: 5
Rep Power: 3 |
Hello everyone,
I need to ask a question on how to create a Python script (using Macros) to calculate the thrust and torque of a drone's propeller for each case generated in a data generation. I already know how to do it using the "Wall" file for the basic parameter case (sample 1), but I'm unsure about how to write the script to calculate for each individual case (sample 2, sample 3, etc.). This is crucial for conducting an optimization study Here is my python script in order to compute the torque for exemple project_file = '' data_filename = '' solution_file = '3D' quantity_name = 'MACRO_TORQUE' entry_type = 'SCALAR' import os (filepath, filename) = os.path.split(data_filename) wallFile = os.path.join(filepath, '...\P_3_5000\P_3_5000.wall') with open(wallFile, 'r') as fichier: val3 =[] val4 = [] for ligne in fichier: if ligne.startswith('INVISCID PART'): val3.append(ligne[90:105]) with open(wallFile, 'r') as fichier : for ligne in fichier: if ligne.startswith('VISCOUS PART'): val4.append(ligne[90:105]) val3 = [float(j) for j in val3] val4 = [float(j) for j in val4] MNV =sum(val3) MV = sum(val4) results = MNV + MV f = open (data_filename, 'w' , 0) f.write('PARAMETER \n') s = 'NAME %s\n' %(quantity_name) f.write(s) s = 'TYPE %s\n' %(entry_type) f.write(s) s = 'VALUE %12.6f\n' %(results) f.write(s) f.close() Thanks in advance |
|
June 30, 2023, 07:25 |
|
#2 |
New Member
Gerard Talla
Join Date: Apr 2023
Posts: 5
Rep Power: 3 |
up pls I need to solve this problem quickly...
|
|
Tags |
design3d, fidelity, macros, thrust, torque |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Gradients for Thrust and Torque coefficients using Finite Differences | Daaman | SU2 Shape Design | 1 | July 19, 2021 06:46 |
Calculation of thrust and torque for propeller | aeksberde | OpenFOAM Post-Processing | 2 | October 28, 2019 06:23 |
Propeller Thrust and Torque Increasing | KindaHungry | STAR-CCM+ | 1 | November 3, 2018 06:59 |