12#ifndef WSFNASABREAKUPMODEL_HPP
13#define WSFNASABREAKUPMODEL_HPP
74 void SetDebrisName(
const std::string& aDebrisName) { mDebrisName = aDebrisName; }
82 mLargeFragmentFraction = std::min(1.0, std::max(0.0, aLargeFragmentFraction));
107 double mLength{-1.0};
111 bool ModelExplosion(WsfPlatform& aPlatform,
const std::vector<double>& aParams)
override;
112 bool FinalizeExplosionModel(WsfPlatform& aPlatform,
const std::vector<double>& aParams);
113 Fragment GenerateExplosiveFragment(
double aLc,
int aId);
114 Fragment GenerateExplosiveLargeFragment(
double aMinLc,
115 double aMassRemaining,
118 const UtVec3d& aLocation,
119 const UtVec3d& aVelocity);
122 bool ModelCollision(WsfPlatform& aTargetPlatform,
123 const std::vector<double>& aTargetParams,
124 WsfPlatform& aImpactorPlatform,
125 const std::vector<double>& aImpactorParams)
override;
126 bool FinalizeCollisionModel(WsfPlatform& aTargetPlatform,
127 const std::vector<double>& aTargetParams,
128 WsfPlatform& aImpactorPlatform,
129 const std::vector<double>& aImpactorParams);
130 bool ModelCatastrophicCollision();
131 bool ModelNonCatastrophicCollision();
132 double ModelCollisionDebris(
double aTotalMass,
const Progenitor& aProgenitor,
bool aGenerateLargeFragments =
true);
133 Fragment GenerateCollisionalFragment(
double aLc,
int aId,
const UtVec3d& aLocation,
const UtVec3d& aVelocity);
134 Fragment GenerateCollisionalLargeFragment(
double aMinLc,
135 double aMassRemaining,
138 const UtVec3d& aLocation,
139 const UtVec3d& aVelocity);
140 Fragment GenerateCrateredFragment(
const Progenitor& aProgenitor);
141 std::pair<Progenitor, Progenitor> SolveCollisionProblem(
const Progenitor& aSmall,
const Progenitor& aLarge)
const;
144 UtVec3d GenerateRandomVelocity(
double aMagnitude);
145 static void EnsureMomentumConservation(std::vector<Fragment>& aFragments);
146 static void EnsureMomentumConservation(std::vector<Fragment>::iterator aStart, std::vector<Fragment>::iterator aEnd);
149 double ExplosionN(
double aLc)
const;
150 double InverseExplosionN(
double aCn)
const;
151 bool IsCatastrophicCollision()
const;
152 double CatastrophicCollisionMass()
const;
153 double NonCatastrophicCollisionMass()
const;
154 void ComputeCollisionMass();
155 static double CollisionN(
double aLc,
double aCollisionMass);
156 static double InverseCollisionN(
double aCn,
double aCollisionMass);
157 static double LimitedLerp(
double aValue,
double aValueMin,
double aValueMax,
double aRangeMin,
double aRangeMax);
158 static double BlendFunctionWeight(
double aLc);
159 double AoverM_SmallSize(
double aLambdaC);
160 double AoverM_RocketBodyTermOne(
double aLambdaC);
161 double AoverM_RocketBodyTermTwo(
double aLambdaC);
162 double AoverM_RocketBody(
double aLc);
163 double AoverM_SpacecraftTermOne(
double aLambdaC);
164 double AoverM_SpacecraftTermTwo(
double aLambdaC);
165 double AoverM_Spacecraft(
double aLc);
166 static double AfromLc(
double aLc);
167 double DeltaV_Explosion(
double aAoverM);
168 double DeltaV_Collision(
double aAoverM);
172 Progenitor mProgenitorOne{};
176 Progenitor mProgenitorTwo{};
178 std::string mDebrisName{};
179 std::vector<Fragment> mFragments{};
180 double mMinFragmentSize{0.1};
181 double mExplosionS_Factor{1.0};
182 double mLargeFragmentFraction{0.5};
183 double mCollisionRelativeSpeed{0.0};
184 double mCollisionMass{-1.0};
185 bool mIsCatastrophicCollision{
false};
186 bool mModelAsSpacecraft{
true};
double GetCollisionProgenitorOneMass() const
Return the mass of the smaller mass progenitor in a collisional breakup.
Definition WsfNASA_BreakupModel.hpp:36
double GetExplosionMass() const
Return the mass involved in the explosive breakup.
Definition WsfNASA_BreakupModel.hpp:30
double GetLargeFragmentMassFraction() const
Return the fraction of the mass that will be deposited as large fragments.
Definition WsfNASA_BreakupModel.hpp:60
bool IsModeledAsSpacecraft() const
Return if the object involved in the breakup should be modeled as a spacecraft.
Definition WsfNASA_BreakupModel.hpp:63
Fragment GetFragment(size_t aIndex) const override
Get the indicated fragment's details.
Definition WsfNASA_BreakupModel.cpp:79
double GetMinFragmentSize() const
Return the minimum fragment size that will be produced.
Definition WsfNASA_BreakupModel.hpp:66
WsfNASA_BreakupModel(WsfSimulation &aSimulation)
Definition WsfNASA_BreakupModel.cpp:69
double GetExplosionS_Factor() const
Return the S factor for the explosive breakup.
Definition WsfNASA_BreakupModel.hpp:57
~WsfNASA_BreakupModel() override=default
void SetMinFragmentSize(double aMinSize)
Set the minimum size of a fragment produced by the model.
Definition WsfNASA_BreakupModel.hpp:94
double GetCollisionMass() const
Return the mass of debris produced by the collision.
Definition WsfNASA_BreakupModel.hpp:45
void SetModeledAsSpacecraft(bool aModelAsSpacecraft)
Definition WsfNASA_BreakupModel.hpp:91
double GetCollisionProgenitorTwoMass() const
Return the mass of the larger mass progenitor in a collisional breakup.
Definition WsfNASA_BreakupModel.hpp:42
void SetExplosionS_Factor(double aS_Factor)
Set the S factor for an explosive breakup.
Definition WsfNASA_BreakupModel.hpp:77
const std::string & GetDebrisName() const
Definition WsfNASA_BreakupModel.hpp:54
size_t GetFragmentCount() const override
Return the number of pieces of debris that were generated.
Definition WsfNASA_BreakupModel.cpp:74
const std::string & GetCollisionProgenitorOne() const
Return the name of the smaller mass progenitor in a collisional breakup.
Definition WsfNASA_BreakupModel.hpp:33
static std::vector< double > PackInputParameters(double aMass, double aSize)
A utility method to pack progenitor input parameters.
Definition WsfNASA_BreakupModel.cpp:89
void SetDebrisName(const std::string &aDebrisName)
Definition WsfNASA_BreakupModel.hpp:74
const std::string & GetCollisionProgenitorTwo() const
Return the name of the larger mass progenitor in a collisional breakup.
Definition WsfNASA_BreakupModel.hpp:39
void SetLargeFragmentMassFraction(double aLargeFragmentFraction)
Set the large fragment mass fraction.
Definition WsfNASA_BreakupModel.hpp:80
const std::string & GetExplosionProgenitor() const
Return the name of the progenitor of the explosive breakup.
Definition WsfNASA_BreakupModel.hpp:27
WsfSatelliteBreakupModel(WsfSimulation &aSimulation)
Definition WsfSatelliteBreakupModel.hpp:26
The main controller for a simulation.
Definition WsfSimulation.hpp:109
The standard information produced by breakup models for each fragment.
Definition WsfSatelliteBreakupModel.hpp:42