Merge pull request #1504 from SiboVG/issue-1440
[#1440] Add all context drags to component drag
This commit is contained in:
commit
e70b737fe1
@ -408,6 +408,7 @@ public class BarrowmanCalculator extends AbstractAerodynamicCalculator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// iterate across component instances
|
// iterate across component instances
|
||||||
|
double componentFrictionCDTotal = 0; // Total friction drag of the component
|
||||||
final ArrayList<InstanceContext> contextList = entry.getValue();
|
final ArrayList<InstanceContext> contextList = entry.getValue();
|
||||||
for(InstanceContext context: contextList ) {
|
for(InstanceContext context: contextList ) {
|
||||||
double componentFrictionCD = calcMap.get(c).calculateFrictionCD(conditions, componentCf, warningSet);
|
double componentFrictionCD = calcMap.get(c).calculateFrictionCD(conditions, componentCf, warningSet);
|
||||||
@ -429,9 +430,11 @@ public class BarrowmanCalculator extends AbstractAerodynamicCalculator {
|
|||||||
otherFrictionCD += componentFrictionCD;
|
otherFrictionCD += componentFrictionCD;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (map != null) {
|
componentFrictionCDTotal += componentFrictionCD;
|
||||||
map.get(c).setFrictionCD(componentFrictionCD);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (map != null) {
|
||||||
|
map.get(c).setFrictionCD(componentFrictionCDTotal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -608,17 +611,17 @@ public class BarrowmanCalculator extends AbstractAerodynamicCalculator {
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
// iterate across component instances
|
// iterate across component instances
|
||||||
|
double pressureCDTotal = 0; // Total pressure drag for this component
|
||||||
final ArrayList<InstanceContext> contextList = entry.getValue();
|
final ArrayList<InstanceContext> contextList = entry.getValue();
|
||||||
for(InstanceContext context: contextList ) {
|
for(InstanceContext context: contextList ) {
|
||||||
|
|
||||||
// Pressure drag
|
// Pressure drag
|
||||||
double cd = calcMap.get(c).calculatePressureCD(conditions, stagnation, base,
|
double pressureCD = calcMap.get(c).calculatePressureCD(conditions, stagnation, base,
|
||||||
warningSet);
|
warningSet);
|
||||||
total += cd;
|
pressureCDTotal += pressureCD;
|
||||||
|
|
||||||
if (forceMap != null) {
|
// Total pressure drag of the rocket
|
||||||
forceMap.get(c).setPressureCD(cd);
|
total += pressureCD;
|
||||||
}
|
|
||||||
|
|
||||||
if(c.isCDOverridden())
|
if(c.isCDOverridden())
|
||||||
continue;
|
continue;
|
||||||
@ -634,14 +637,15 @@ public class BarrowmanCalculator extends AbstractAerodynamicCalculator {
|
|||||||
|
|
||||||
if (radius < s.getForeRadius()) {
|
if (radius < s.getForeRadius()) {
|
||||||
double area = Math.PI * (pow2(s.getForeRadius()) - pow2(radius));
|
double area = Math.PI * (pow2(s.getForeRadius()) - pow2(radius));
|
||||||
cd = stagnation * area / conditions.getRefArea();
|
pressureCD = stagnation * area / conditions.getRefArea();
|
||||||
total += cd;
|
pressureCDTotal += pressureCD;
|
||||||
|
total += pressureCD;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (forceMap != null) {
|
if (forceMap != null) {
|
||||||
forceMap.get(c).setPressureCD(forceMap.get(c).getPressureCD() + cd);
|
forceMap.get(c).setPressureCD(pressureCDTotal);
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -696,10 +700,10 @@ public class BarrowmanCalculator extends AbstractAerodynamicCalculator {
|
|||||||
|
|
||||||
if (radius > s.getForeRadius()) {
|
if (radius > s.getForeRadius()) {
|
||||||
double area = Math.PI * (pow2(radius) - pow2(s.getForeRadius()));
|
double area = Math.PI * (pow2(radius) - pow2(s.getForeRadius()));
|
||||||
double cd = base * area / conditions.getRefArea();
|
double baseCD = base * area / conditions.getRefArea();
|
||||||
total += cd;
|
total += baseCD;
|
||||||
if ((map != null) && (prevComponent != null)) {
|
if ((map != null) && (prevComponent != null)) {
|
||||||
map.get(prevComponent).setBaseCD(cd);
|
map.get(prevComponent).setBaseCD(baseCD);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -709,10 +713,10 @@ public class BarrowmanCalculator extends AbstractAerodynamicCalculator {
|
|||||||
final SymmetricComponent n = s.getNextSymmetricComponent();
|
final SymmetricComponent n = s.getNextSymmetricComponent();
|
||||||
if ((n == null) || !configuration.isStageActive(n.getStageNumber())) {
|
if ((n == null) || !configuration.isStageActive(n.getStageNumber())) {
|
||||||
double area = Math.PI * pow2(s.getAftRadius());
|
double area = Math.PI * pow2(s.getAftRadius());
|
||||||
double cd = base * area / conditions.getRefArea();
|
double baseCD = base * area / conditions.getRefArea();
|
||||||
total += cd;
|
total += baseCD;
|
||||||
if (map != null) {
|
if (map != null) {
|
||||||
map.get(s).setBaseCD(cd);
|
map.get(s).setBaseCD(baseCD);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user