adjusted cp to change based on a component's instance count

This commit is contained in:
Daniel_M_Williams 2015-08-20 15:05:52 -04:00
parent 29ec764b61
commit 7882304839

View File

@ -204,8 +204,14 @@ public class BarrowmanCalculator extends AbstractAerodynamicCalculator {
// Call calculation method
forces.zero();
calcMap.get(component).calculateNonaxialForces(conditions, forces, warnings);
forces.setCP(component.toAbsolute(forces.getCP())[0]);
forces.setCm(forces.getCN() * forces.getCP().x / conditions.getRefLength());
int instanceCount = component.getLocation().length;
Coordinate x_cp_comp = forces.getCP();
Coordinate x_cp_weighted = x_cp_comp.setWeight(x_cp_comp.weight * instanceCount);
Coordinate x_cp_absolute = component.toAbsolute(x_cp_weighted)[0];
forces.setCP(x_cp_absolute);
double CN_instanced = forces.getCN() * instanceCount;
forces.setCm(CN_instanced * forces.getCP().x / conditions.getRefLength());
if (map != null) {
AerodynamicForces f = map.get(component);
@ -664,9 +670,9 @@ public class BarrowmanCalculator extends AbstractAerodynamicCalculator {
FinSet f = (FinSet) c;
mul += 0.6 * Math.min(f.getFinCount(), 4) * f.getFinArea() *
MathUtil.pow3(Math.abs(f.toAbsolute(new Coordinate(
((FinSetCalc) calcMap.get(f)).getMidchordPos()))[0].x
- cgx)) /
(conditions.getRefArea() * conditions.getRefLength());
((FinSetCalc) calcMap.get(f)).getMidchordPos()))[0].x
- cgx)) /
(conditions.getRefArea() * conditions.getRefLength());
}
}