Remove longitudinalAcceleration field from DataStore.
This was initialized to NaN, but never set to anything else. It (along with the atmospheric conditions) was passed to calculateThrust for possible more accurate thrust calculation in the future, but not used there at present The entire DataStore is now passed to calculateAcceleration() to use whatever fields are useful to it -- none at present.
This commit is contained in:
parent
e2b69c4650
commit
96f0985100
@ -163,14 +163,12 @@ public abstract class AbstractSimulationStepper implements SimulationStepper {
|
||||
*
|
||||
* @param status the current simulation status.
|
||||
* @param timestep the time step of the current iteration.
|
||||
* @param acceleration the current (approximate) acceleration
|
||||
* @param atmosphericConditions the current atmospheric conditions
|
||||
* @param store the simulation calculation DataStore (contains acceleration, atmosphere)
|
||||
* @param stepMotors whether to step the motors forward or work on a clone object
|
||||
* @return the average thrust during the time step.
|
||||
*/
|
||||
protected double calculateThrust(SimulationStatus status,
|
||||
double acceleration, AtmosphericConditions atmosphericConditions,
|
||||
boolean stepMotors) throws SimulationException {
|
||||
protected double calculateThrust(SimulationStatus status, DataStore store,
|
||||
boolean stepMotors) throws SimulationException {
|
||||
double thrust;
|
||||
|
||||
// Pre-listeners
|
||||
@ -240,8 +238,6 @@ public abstract class AbstractSimulationStepper implements SimulationStepper {
|
||||
|
||||
public FlightConditions flightConditions;
|
||||
|
||||
public double longitudinalAcceleration = Double.NaN;
|
||||
|
||||
public RigidBody rocketMass;
|
||||
|
||||
public RigidBody motorMass;
|
||||
|
@ -325,7 +325,7 @@ public class RK4SimulationStepper extends AbstractSimulationStepper {
|
||||
double fN = store.forces.getCN() * dynP * refArea;
|
||||
double fSide = store.forces.getCside() * dynP * refArea;
|
||||
|
||||
store.thrustForce = calculateThrust(status, store.longitudinalAcceleration, store.flightConditions.getAtmosphericConditions(), false);
|
||||
store.thrustForce = calculateThrust(status, store, false);
|
||||
double forceZ = store.thrustForce - store.dragForce;
|
||||
|
||||
store.linearAcceleration = new Coordinate(-fN / store.rocketMass.getMass(),
|
||||
|
Loading…
x
Reference in New Issue
Block a user