Merge pull request #492 from teyrana/fix_387_offaxis_cp
[fixes #387] Fixes one source of off-axis CP error
This commit is contained in:
commit
5e3d8013e4
@ -202,15 +202,20 @@ public class BarrowmanCalculator extends AbstractAerodynamicCalculator {
|
|||||||
AerodynamicForces componentForces = new AerodynamicForces().zero();
|
AerodynamicForces componentForces = new AerodynamicForces().zero();
|
||||||
calcObj.calculateNonaxialForces(conditions, componentForces, warnings);
|
calcObj.calculateNonaxialForces(conditions, componentForces, warnings);
|
||||||
|
|
||||||
Coordinate x_cp_comp = componentForces.getCP();
|
Coordinate cp_comp = componentForces.getCP();
|
||||||
Coordinate x_cp_weighted = x_cp_comp.setWeight(x_cp_comp.weight);
|
|
||||||
Coordinate x_cp_absolute = component.toAbsolute(x_cp_weighted)[0];
|
Coordinate cp_weighted = cp_comp.setWeight(cp_comp.weight);
|
||||||
componentForces.setCP(x_cp_absolute);
|
Coordinate cp_absolute = component.toAbsolute(cp_weighted)[0];
|
||||||
|
if(1 < component.getInstanceCount()) {
|
||||||
|
cp_absolute = cp_absolute.setY(0.);
|
||||||
|
}
|
||||||
|
|
||||||
|
componentForces.setCP(cp_absolute);
|
||||||
double CN_instanced = componentForces.getCN();
|
double CN_instanced = componentForces.getCN();
|
||||||
componentForces.setCm(CN_instanced * componentForces.getCP().x / conditions.getRefLength());
|
componentForces.setCm(CN_instanced * componentForces.getCP().x / conditions.getRefLength());
|
||||||
|
|
||||||
// if( 0.0001 < Math.abs(0 - componentForces.getCNa())){
|
// if( 0.0001 < Math.abs(componentForces.getCNa())){
|
||||||
// System.err.println(String.format("%s....Component.CNa: %g @ CPx: %g", indent, componentForces.getCNa(), componentForces.getCP().x));
|
// System.err.println(String.format("%s....Component.CNa: %g @ CP: %g, %g", indent, componentForces.getCNa(), componentForces.getCP().x, componentForces.getCP().y));
|
||||||
// }
|
// }
|
||||||
|
|
||||||
assemblyForces.merge(componentForces);
|
assemblyForces.merge(componentForces);
|
||||||
|
@ -86,6 +86,7 @@ public class BarrowmanCalculatorTest {
|
|||||||
|
|
||||||
assertEquals(" Estes Alpha III CNa value is incorrect:", exp_cna, cp_calc.weight, EPSILON);
|
assertEquals(" Estes Alpha III CNa value is incorrect:", exp_cna, cp_calc.weight, EPSILON);
|
||||||
assertEquals(" Estes Alpha III cp x value is incorrect:", exp_cpx, cp_calc.x, EPSILON);
|
assertEquals(" Estes Alpha III cp x value is incorrect:", exp_cpx, cp_calc.x, EPSILON);
|
||||||
|
assertEquals(" Estes Alpha III cp x value is incorrect:", 0.0, cp_calc.y, EPSILON);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
Loading…
x
Reference in New Issue
Block a user