# Negative cl,cd values (rhoSimpleFoam)

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

 May 30, 2023, 06:04 Negative cl,cd values (rhoSimpleFoam) #1 New Member   Rohan Join Date: May 2023 Posts: 20 Rep Power: 3 Greetings, im trying to solve for a finite wing of Naca4415 airfoil data using rhoSimpleFoam. the initial boundary conditions are 0.4M (velocity), and 0 angle of attack. The turbulence model used in k-omega and the flow is compressible. im getting negative coefficients of lift and drag even though i have set the velocity, lift and drag dir based on the coordinate system of the geometry. Tried various things yet nothing works, not sure if im missing something. kindly help me with this, regards, Rohan

 May 31, 2023, 13:48 Can anyone help me figure out the issue? #2 New Member   Rohan Join Date: May 2023 Posts: 20 Rep Power: 3 This is the force coeffs code forces { type forceCoeffs; libs ("libforces.so"); writeControl timeStep; writeInterval 1; patches ("wingbottom"); patches ("wingtip"); patches ("wingtop"); rhoInf 1.2; liftDir (0 1 0); dragDir (1 0 0); CofR (0 0 0); // Coefficient of rotation pitchAxis (0 0 1); magUInf 136.119; lRef 1; // Ref length Aref 1; // Ref area }

 June 1, 2023, 02:56 #3 Senior Member   Yann Join Date: Apr 2012 Location: France Posts: 1,110 Rep Power: 26 Not sure what is going on, but your patches definition is wrong: Code: ```patches ("wingbottom"); patches ("wingtip"); patches ("wingtop");``` I'm pretty sure your coefficients are only calculated on wingtop. If you want to include the 3 patches in the coeff calculation it should be all defined at the same place: Code: `patches (wingbottom wingtip wintop);` Hope this helps, Yann

 June 1, 2023, 03:06 #4 New Member   Rohan Join Date: May 2023 Posts: 20 Rep Power: 3 ohhh, i was thinking lift usually acts on bottom surface of the wing so i need to include wingbottom patch as well. i will try the way you have shown to include all surfaces and check. Thank you very much, Rohan

June 1, 2023, 03:12
#5
Senior Member

Yann
Join Date: Apr 2012
Location: France
Posts: 1,110
Rep Power: 26
Quote:
 Originally Posted by Yann I'm pretty sure your coefficients are only calculated on wingtop.
I think there is a misunderstanding: I mean on your forceCoeffs definition, the last "patches" line override the previous ones so the way your function is defined, it only uses wingtop in the calculation instead of the whole wing (wingtop+wingbottom+wingtip)

Yann

 June 1, 2023, 03:26 #6 New Member   Rohan Join Date: May 2023 Posts: 20 Rep Power: 3 yes, i made a mistake in defining patches, so the alternative way to include them which you have suggested, [patches (wingbottom wingtip wintop);] will this work for my case? Thank you, Rohan

 June 1, 2023, 04:44 #7 Senior Member   Yann Join Date: Apr 2012 Location: France Posts: 1,110 Rep Power: 26 Try and see Check patches names, liftDir and dragDir. Yann

 June 1, 2023, 05:02 #8 New Member   Rohan Join Date: May 2023 Posts: 20 Rep Power: 3 i have tried that statement for patches, the negative Cl, Cd is resolved but the Cl, Cd values are quite high like Cl is ranging around 4.83e+01, Cd around 8,71e-01. i have also tried defining only wingtop as a patch but the cl cd values are all zeroes in this case.

 June 1, 2023, 05:21 #9 Senior Member   Yann Join Date: Apr 2012 Location: France Posts: 1,110 Rep Power: 26 Does your reference length and area make sense? About patches, there is no doubt: if you want to compute the coefficient of your profile you need to include the whole profile.

 June 1, 2023, 05:26 #10 New Member   Rohan Join Date: May 2023 Posts: 20 Rep Power: 3 yes the chord length is 0.046 and the ref area value was calculated based on chord length and span. i will recheck it again anyhow. What units does openfoam consider, for lref and aref, i think there might be a problem there. So i have calculated lref and aref like this (lref = chord length, aref = chord length*span) is this correct or is there any other way to calculate them Thank you

 June 1, 2023, 05:30 #11 Senior Member   Yann Join Date: Apr 2012 Location: France Posts: 1,110 Rep Power: 26 Both lRef and Aref were set to 1 in your first post, I guess you fixed it afterward?

 June 1, 2023, 05:34 #12 New Member   Rohan Join Date: May 2023 Posts: 20 Rep Power: 3 ohh yes i fixed it later, so lref = chord length and aref = chordlength*span, is this the right way to set the values or is there any other way to find them. and i assumed openfoam takes units as m or m^2 for these values, is this where th problem might be?

 June 1, 2023, 06:01 #13 Senior Member   Yann Join Date: Apr 2012 Location: France Posts: 1,110 Rep Power: 26 Sounds good yes. Have you check your simulation results ? Did it converge ? Velocity and pressure fields make sense?

 June 1, 2023, 10:13 #14 New Member   Rohan Join Date: May 2023 Posts: 20 Rep Power: 3 Yes the velocity fields and pressure contours made sense however I'm not sure about the values, as I said cl and cd values are quite high, so I'm not sure about it, I'll try a different case taking a new wing and calculate lref Aref newly and try