Skip to content

Fuel flow simulation and staging controller improvements - #2302

Open
AntonKuzin wants to merge 4 commits into
MuMech:devfrom
AntonKuzin:dev
Open

Fuel flow simulation and staging controller improvements#2302
AntonKuzin wants to merge 4 commits into
MuMech:devfrom
AntonKuzin:dev

Conversation

@AntonKuzin

Copy link
Copy Markdown

See the comments for details


if (r.amount <= p.resourceRequestRemainingThreshold)
continue;
return false;

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is for crossfeeding boosters. Currently, it doesn't stage till both fuel and oxidizer are depleted. But it's not optimal - it should stage if one of them is empty

double maxTime = ResourceMaxTime();

return maxTime < double.MaxValue && maxTime >= 0 ? maxTime : 0;
return maxTime < double.MaxValue && maxTime > 0.001 ? maxTime : 0.001;

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should address the steps limiter issue. For cryogenic fuels the amount of fuel left per tank is slightly different, so it tries to calculate the fuel flow in 1e-6 steps.

// FIXME: if we have constructed a segment which is > 0 dV, but less than 0.02s, and there's a
// prior > 0dV segment in the same kspStage we should add those together to reduce clutter.
if (Abs(vessel.ThrustMagnitude - currentThrust) > 1e-12)
if (dt >= 0.02 && activeAngines != vessel.ActiveEngines.Count)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should address the phantom 0 dv 0 burn time phases constantly appearing and disappearing.

if (_amount < 0)
_amount = 0;
if (_amount < ResidualThreshold)
_amount = ResidualThreshold;

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we may drain more fuel than we should, just don't allow it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant