CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > Fidelity CFD

Design3D : Compute Thrust and Torque for every sample in database generation

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 29, 2023, 13:53
Default 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
Gegetalla is on a distinguished road
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
Gegetalla is offline   Reply With Quote

Old   June 30, 2023, 07:25
Default
  #2
New Member
 
Gerard Talla
Join Date: Apr 2023
Posts: 5
Rep Power: 3
Gegetalla is on a distinguished road
up pls I need to solve this problem quickly...
Gegetalla is offline   Reply With Quote

Reply

Tags
design3d, fidelity, macros, thrust, torque


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 11:06.