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:
JoePfeiffer 2024-07-12 05:53:43 -06:00
parent e2b69c4650
commit 96f0985100
2 changed files with 4 additions and 8 deletions

View File

@ -163,13 +163,11 @@ public abstract class AbstractSimulationStepper implements SimulationStepper {
* *
* @param status the current simulation status. * @param status the current simulation status.
* @param timestep the time step of the current iteration. * @param timestep the time step of the current iteration.
* @param acceleration the current (approximate) acceleration * @param store the simulation calculation DataStore (contains acceleration, atmosphere)
* @param atmosphericConditions the current atmospheric conditions
* @param stepMotors whether to step the motors forward or work on a clone object * @param stepMotors whether to step the motors forward or work on a clone object
* @return the average thrust during the time step. * @return the average thrust during the time step.
*/ */
protected double calculateThrust(SimulationStatus status, protected double calculateThrust(SimulationStatus status, DataStore store,
double acceleration, AtmosphericConditions atmosphericConditions,
boolean stepMotors) throws SimulationException { boolean stepMotors) throws SimulationException {
double thrust; double thrust;
@ -240,8 +238,6 @@ public abstract class AbstractSimulationStepper implements SimulationStepper {
public FlightConditions flightConditions; public FlightConditions flightConditions;
public double longitudinalAcceleration = Double.NaN;
public RigidBody rocketMass; public RigidBody rocketMass;
public RigidBody motorMass; public RigidBody motorMass;

View File

@ -325,7 +325,7 @@ public class RK4SimulationStepper extends AbstractSimulationStepper {
double fN = store.forces.getCN() * dynP * refArea; double fN = store.forces.getCN() * dynP * refArea;
double fSide = store.forces.getCside() * 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; double forceZ = store.thrustForce - store.dragForce;
store.linearAcceleration = new Coordinate(-fN / store.rocketMass.getMass(), store.linearAcceleration = new Coordinate(-fN / store.rocketMass.getMass(),