# Debugging Katz Program 14

 Register Blogs Members List Search Today's Posts Mark Forums Read

 February 8, 2013, 12:22 Debugging Katz Program 14 #1 New Member   Ranald M Engelbeck Join Date: Feb 2013 Location: Puyallup, Washington Posts: 4 Rep Power: 4 I have successfully compiled Program 14 from Katz & Plotkin's book "Low Speed Aerodynamics" Now I am trying to debug the code to ensure it works. The baseline case set up in the published code yeilds a reasonable result: Inputs: ALPHA1=5.0 CROOT= 1.0 CTIP=1.0 XTIP=0.0 ZTIP=0.0 B=10.0 VT=1.0 JB=3 The answer was not published....hopefully, this matches someones answer? CL= 0.4487 L= 2.2433 CM= 0.1148 CD= 0.0248 Looking into the code brought up few issues I wanted to ask about: 1.) The programs variable VT I am interpreting as free stream velocity and RO to be density by their use in the program. However, setting the values of both of these variables in the program to 1.0 makes me wonder if they are normalized? 2.) However, when I tried to run a geometry more representative of an real airplane (dimensions in inches) I get nonsensical anwsers: Inputs: ALPHA1=5.0 CROOT= 246.59 CTIP=58.18 XTIP=311.24 ZTIP=-59.69 B=670.25 VT=1.0 JB=3 Outputs: CL=-.7883E+08 L=-.4026E+13 CM=-.3876E+10 CD=-.3926E+07 Am I missing some other geometry normalization...say wing dimensions normalized to root chord (CROOT)? 3.) There is a fragment of code correcting the individual panel sweeps from chord wise/spanwise to streamwise/perpendicular to streamwise in the code leading up to the force and moment calculations.... C FIRST ORDER CORRECTION FOR PANEL SWEEP QL=QL+QM*(DX**2+DZ**2)/DR QM=QM*(DY**2+DZ**2)/DR Is there a discussion of they theory behind this correction somewhere? Anybody have any experiance with this code? How about a website that has the source code in machine readable format?...maybe I have a typo somewhere? Ron

February 12, 2013, 08:02
Source code to aide debugging Program 14
#2
New Member

Ranald M Engelbeck
Join Date: Feb 2013
Location: Puyallup, Washington
Posts: 4
Rep Power: 4
Thank you to Dr Katz for allowing me to upload source code....
Attached Files
 LowOrderPanelMethod.f (20.5 KB, 13 views)

February 21, 2013, 09:12
#3
Senior Member

Lefteris
Join Date: Oct 2011
Location: UK
Posts: 193
Rep Power: 5
Quote:
 Originally Posted by Engelbeck I have successfully compiled Program 14 from Katz & Plotkin's book "Low Speed Aerodynamics" Now I am trying to debug the code to ensure it works. The baseline case set up in the published code yeilds a reasonable result: Inputs: ALPHA1=5.0 CROOT= 1.0 CTIP=1.0 XTIP=0.0 ZTIP=0.0 B=10.0 VT=1.0 JB=3 The answer was not published....hopefully, this matches someones answer? CL= 0.4487 L= 2.2433 CM= 0.1148 CD= 0.0248 Looking into the code brought up few issues I wanted to ask about: 1.) The programs variable VT I am interpreting as free stream velocity and RO to be density by their use in the program. However, setting the values of both of these variables in the program to 1.0 makes me wonder if they are normalized? 2.) However, when I tried to run a geometry more representative of an real airplane (dimensions in inches) I get nonsensical anwsers: Inputs: ALPHA1=5.0 CROOT= 246.59 CTIP=58.18 XTIP=311.24 ZTIP=-59.69 B=670.25 VT=1.0 JB=3 Outputs: CL=-.7883E+08 L=-.4026E+13 CM=-.3876E+10 CD=-.3926E+07 Am I missing some other geometry normalization...say wing dimensions normalized to root chord (CROOT)? Ron
I'm not familiar with this code but I took a look at it. I would suggest that you do the following:
a) use SI units. not inches.
b) fortran uses rads and not degrees so you should be sure that you use rads or that the conversion from degrees to rads is done properly

PS
ok I just noticed that the conversion from degrees to rads is done : ALPHA1*PAY/180.0 so you don't neet to worry about that. Try to use SI units for the rest.
__________________
Lefteris

 February 22, 2013, 12:00 Si units not relivant to problem... #4 New Member   Ranald M Engelbeck Join Date: Feb 2013 Location: Puyallup, Washington Posts: 4 Rep Power: 4 I do not think the units of the length dimensions affects the dimensionless results of lift drag and pitching moment coefficients since the should be referenced to wing area and chord length. One way of looking at the conversion factor between si and imperial units is as a geometry scaling factor....this is why I think the input length dimensions and speed are normalized by dividing by some reference length. Katz has no description on how to interpret the inputs, and I can't figure out if I have some coding error or the inputs are normalized by some length parameter like root chord...not a clue!

 February 23, 2013, 15:03 #5 Senior Member   Lefteris Join Date: Oct 2011 Location: UK Posts: 193 Rep Power: 5 I was working on CAFFA code (by prof. Peric) and although nowhere was clearly stated, the code was working properly only in SI units thus, I suggest you try SI units (ultimately this is the meaning of the SI units, a common system so that people around the world don't get confused). Checking your grid's scaling is of critical importance as well. Whatever units you have used, use the appropriate factor to convert it to m. __________________ Lefteris

 March 7, 2013, 07:52 #6 New Member   Ranald M Engelbeck Join Date: Feb 2013 Location: Puyallup, Washington Posts: 4 Rep Power: 4 Remember the section of code I refered to in the orgional post? ie: C FIRST ORDER CORRECTION FOR PANEL SWEEP QL=QL+QM*(DX**2+DZ**2)/DR QM=QM*(DY**2+DZ**2)/DR ...well, I commented it out and all the coefficients came back to magnitudes I was expecting....so I conclude that this code fragment is at least one of the problems...Soooo...what is this section of code doing? Simple sweep correction?

 Tags debug katz program 14

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post johnjohnmulley Main CFD Forum 2 August 5, 2013 07:53 chihoangkt ANSYS 0 July 16, 2012 16:41 mani.rajendiran Fluent UDF and Scheme Programming 0 March 22, 2012 12:25 Xwang Main CFD Forum 1 October 24, 2010 17:29 CedricVH OpenFOAM 2 January 15, 2010 12:55

All times are GMT -4. The time now is 15:05.