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

Design3D- Compute Thurst and Torque From Files

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 22, 2023, 05:36
Default Design3D- Compute Thurst and Torque From Files
  #1
New Member
 
Gerard Talla
Join Date: Apr 2023
Posts: 5
Rep Power: 3
Gegetalla is on a distinguished road
Hello, I am trying to be able to calculate thrust and torque using the macro (so a pyhton code). I want to calculate F_Z and M_Z according to the data available on the "Wall" file (by summing the viscous and inviscid parts).

Can you give me a type code?

Here is my wall file :

FORCES AND MOMENTUM ON ACTIVE SURFACES IN MKS UNITS

THE MOMENTUM IS COMPUTED FOR THE POINT WITH COORDINATES 0.0000 0.0000 0.0000

THESE COMPUTATIONS TAKE INTO ACCOUNT THE PERIODICITY OF PATCHES (PARAMETER IPERFM = 1)


THE PATCH LOCATION IS GIVEN BY :BLOCK NUMBER,ISTART,IEND,JSTART,JEND,KSTART,KEND


FX FY FZ MX MY MZ
DOMAIN 1
PATCH LOCATION: 1 1 9 1 1 1 13
INVISCID PART 0.00000 0.444089E-15 -0.368661E-02 0.433681E-18 0.00000 -0.495484E-04
VISCOUS PART -0.317637E-21 0.00000 0.115185E-04 -0.661744E-23 0.00000 -0.654530E-07


DOMAIN 2
PATCH LOCATION: 2 1 5 1 63 37 37
INVISCID PART 0.00000 -0.520417E-16 -0.483746 0.00000 0.124683E-17 -0.378667E-01
VISCOUS PART 0.00000 0.169407E-20 0.473327E-04 0.00000 -0.158819E-21 0.278188E-05


DOMAIN 2
PATCH LOCATION: 2 5 9 1 63 37 37
INVISCID PART 0.00000 -0.520417E-16 -0.483042 0.00000 0.124683E-17 -0.378639E-01
VISCOUS PART 0.847033E-21 0.00000 0.230656E-04 0.00000 -0.105879E-21 -0.557631E-06


DOMAIN 2
PATCH LOCATION: 2 1 9 1 1 1 37
INVISCID PART 0.00000 -0.444089E-15 -0.348421 0.151788E-17 0.00000 -0.110343E-04
VISCOUS PART -0.423516E-21 0.00000 -0.771241E-05 -0.661744E-23 -0.661744E-23 0.106208E-06


DOMAIN 3
PATCH LOCATION: 3 1 25 1 1 1 73
INVISCID PART -0.266454E-14 0.00000 0.504029E-01 0.346945E-17 0.00000 0.151655E-03
VISCOUS PART 0.00000 0.118585E-19 0.183077E-03 0.00000 -0.158819E-21 0.247336E-05


DOMAIN 3
PATCH LOCATION: 3 1 1 1 63 37 73
INVISCID PART 0.00000 0.133227E-13 -401.256 0.00000 0.122125E-14 9.73432
VISCOUS PART 0.00000 0.113841E-17 0.552055E-02 0.00000 -0.249875E-19 0.146283E-02


DOMAIN 3
PATCH LOCATION: 3 1 1 1 63 1 37
INVISCID PART 0.00000 -0.131006E-13 399.818 0.00000 -0.122125E-14 -9.60761
VISCOUS PART 0.433681E-18 0.00000 -0.465081E-02 0.00000 0.271051E-19 0.217829E-03


DOMAIN 4
PATCH LOCATION: 4 1 13 1 1 1 57
INVISCID PART -0.888178E-15 -0.177636E-14 9.68961 -0.693889E-17 0.346945E-17 0.265260E-05
VISCOUS PART 0.00000 0.677626E-20 0.219303E-03 0.211758E-21 -0.211758E-21 0.126274E-05


DOMAIN 5
PATCH LOCATION: 5 1 13 1 1 1 57
INVISCID PART -0.888178E-15 0.00000 -9.31188 0.00000 -0.346945E-17 -0.147030E-04
VISCOUS PART 0.00000 0.465868E-20 0.763778E-05 -0.264698E-22 -0.264698E-22 0.153237E-05


DOMAIN 6
PATCH LOCATION: 6 1 5 1 1 1 81
INVISCID PART -0.574627E-17 0.00000 -0.557802E-05 0.00000 -0.794093E-22 0.143392E-07
VISCOUS PART 0.00000 0.190582E-20 0.143507E-04 0.00000 -0.104225E-21 0.383061E-05


DOMAIN 7
PATCH LOCATION: 7 1 9 1 1 1 33
INVISCID PART -0.536680E-17 0.00000 -0.596212E-05 0.00000 0.397047E-22 0.143901E-07
VISCOUS PART 0.00000 0.190582E-20 0.254598E-04 0.00000 -0.185288E-21 0.371034E-05


DOMAIN 10
PATCH LOCATION: 10 1 57 1 1 1 7
INVISCID PART -0.277556E-15 0.00000 11.2884 0.00000 -0.119262E-17 -0.431042E-18
VISCOUS PART 0.00000 0.677626E-20 0.400613E-04 0.529396E-22 0.00000 0.832038E-06


DOMAIN 11
PATCH LOCATION: 11 1 29 1 29 25 25
INVISCID PART -0.242861E-16 0.00000 17.2270 0.00000 -0.303577E-17 0.752272E-06
VISCOUS PART 0.00000 0.338813E-20 0.109303E-05 0.264698E-22 0.00000 0.280823E-06


DOMAIN 12
PATCH LOCATION: 12 1 57 1 5 1 1
INVISCID PART -0.867362E-17 0.00000 6.54833 0.00000 -0.195156E-17 0.141812E-07
VISCOUS PART 0.00000 0.169407E-20 0.847340E-06 0.264698E-22 0.00000 0.265007E-06


DOMAIN 15
PATCH LOCATION: 15 1 57 1 1 1 7
INVISCID PART -0.277556E-15 0.00000 -11.2907 0.00000 0.108420E-17 -0.500179E-18
VISCOUS PART -0.169407E-20 0.169407E-20 0.254132E-05 0.00000 -0.132349E-22 0.547515E-06


DOMAIN 16
PATCH LOCATION: 16 1 29 1 29 1 1
INVISCID PART -0.208167E-16 0.00000 -17.2104 0.00000 0.260209E-17 -0.227277E-06
VISCOUS PART 0.00000 0.169407E-20 -0.805830E-07 -0.132349E-22 0.00000 0.217058E-06


DOMAIN 17
PATCH LOCATION: 17 1 57 1 5 25 25
INVISCID PART -0.867362E-17 0.00000 -6.56743 0.00000 0.173472E-17 -0.576063E-08
VISCOUS PART 0.00000 0.847033E-21 -0.486823E-07 -0.661744E-23 0.00000 0.175577E-06

The only example I can find in the documentation is this:

CFViewBackward(89)

#(file opening)

fi=open('/disk1/macros/listIn.dat','r',0)

fo=open('/disk1/macros/listOut.dat','w',0)

#(write header line)

fo.write('Node# x_cord y_cord z_cord fieldValue\n')-

#(select quantity - if the following line is commented, the active quantity is used)

#QntFieldScalar('Static Pressure')

#(import the type module for later use)

from types import *

#(skip the first line, read the file lines and extract the quantity value.)

s=fi.readlines()

for i in range(1,len(s)-1):

#(scan line)

lineList=[]

for x in splitfields(s[i]):

if (x!=''): lineList.append(atof(x))

#(write number and point coordinates)

fo.write("%i %e %e %e"%(lineList[0], lineList[1], lineList[2], lineList[3]))

#(compute value)

q=ProbeXYZ(lineList[1], lineList[2], lineList[3])

#(write value - if the quantity is vectorial then q is a tuple (ordered list of elements))

if (type(q) == tuple):

for j in range(0,len(q)): fo.write('%e'%(q[j]))

else:

fo.write('%e'%(q))

#(write end of line)

fo.write('\n')

#(close files)

fi.close()

fo.close()

Last edited by Gegetalla; June 29, 2023 at 13:18.
Gegetalla is offline   Reply With Quote

Reply


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



All times are GMT -4. The time now is 00:08.