|
virtual double | CalcConvectiveCoefficient (Vessel.Situations situation) |
| Calculates a convective coefficient, for convective transfer = coeff * area * (air temp - skin temp) Handles the splashed case, then if in air lerps between Newtonian and Mach (Hypersonic) convection based on the Newtonian-Mach lerp and the craft's Mach number. More...
|
|
virtual double | CalculateAnalyticTemperature () |
| Calculates analytically a steady-state temperature for the entire vessel using the vessel's emissive and absorptive-weighted radiative area, the incoming solar flux, any body flux, any atmospheric convection, and any internal generation. Conduction is entirely ignored (it is assumed to be near-instantaneous on these timescalse) and convection is also guesstimated on a final-analysis, steady-state basis (basically lerping between external temperature and pure radiative-balance temperature based on atmospheric density). This supports callbacks to parts using various interfaces. More...
|
|
virtual double | CalculateDensityThermalLerp () |
| Calculates a lerp value for use in determining background radiation temp and for steady-state temperatures w.r.t convection in analytic mode. NOTE: Uses the post-shockwave density, not the static density More...
|
|
virtual double | CalculateShockTemperature () |
| Calculates the shock temperature given a velocity More...
|
|
virtual double | GetBodyArea (PartThermalData ptd) |
| Get radiative area facing the body More...
|
|
override int | GetOrder () |
|
virtual double | GetSunArea (PartThermalData ptd) |
| Get radiative area facing the sun More...
|
|
override void | OnLoadVessel () |
|
override void | OnUnloadVessel () |
|
virtual void | PrecalcConduction (PartThermalData ptd) |
| Sets the conduciton multiplier and skin-skin transfer multiplier for a PTD The latter starts from sqrt(radiative area) and then tries to take the relative areas of exposed and unexposed skin into account, i.e. it's maximal when about half is exposed and half unexposed More...
|
|
virtual void | PrecalcConvection (PartThermalData ptd) |
| Determine the final convective coefficient based on occlusion and convective stats More...
|
|
virtual void | PrecalcRadiation (PartThermalData ptd) |
| Precalc radiative stats like final coefficients and the final background rad temp exposed and unexposed. This is complicated because we need to figure out what portion of sun and body flux each apply to exposed and to unexposed skin (this is done by taking the dot of the sun vector vs the velocity vector and the -upaxis and the velocity vector respectively). All these get stored as incoming fluxes, since they are constant given a position and orientation and so needn't be recalculated during all the RK2 steps. More...
|
|
virtual void | SetSkinProperties (PartThermalData ptd) |
| Sets the basic skin properties for this thermal pass. Calculate the total area, the fraction of which is exposed or unexposed, and handle any transfers in thermal energy when those areas change. More...
|
|
virtual void | SetSkinThermalMass (Part part) |
| Determine skin thermal mass from radiative area and part dry mass More...
|
|
virtual void | Setup () |
|
override bool | ShouldBeActive () |
|
virtual void | ThermalIntegrationPass (bool averageWithPrevious) |
| The actual thermal integration pass. First update conduction (this merely establishes fluxes). Then loop through all PTDs. Store previous temps if we're doing RK2 passes, then calculte convection and radiation for the part. Finally apply the fluxes. More...
|
|
virtual void | ThermoPrecalculate () |
| Any not-every-frame thermo calcs More...
|
|
virtual void | UnifySkinTemp (PartThermalData ptd) |
| Unifies the exposed and unexposed skin temps into a unified temp using the whole skin thermal mass More...
|
|
virtual void | Update () |
| Recalculate those bits that don't need to happen every frame (for now, the sun and body fluxes / air temperature offsets More...
|
|
virtual void | UpdateCompoundParts () |
| Apply thermal links based on compound parts More...
|
|
virtual void | UpdateConduction () |
| The big one. Processes conduction across the vessel. Occurs in multiple passes. The first pass involves zeroing fluxes and getting unified skin temperatures. Then internal conduction happens (i.e. part internal <-> part internal, no skin). The PTDs are sorted by int temp, and then each PTD's links are checked. Heat pushes out to the links based on the conductive coefficient and the attach area. Checks are done to ensure stability. Since we start from hottest first, the hottest parts get priority flowing heat outwards. The same occurs for part skin <-> part skin conduction. Finally skin-skin conduction is computed for individual parts, between exposed and unexposed skin. Note that throughout this process only fluxes are stored. More...
|
|
virtual void | UpdateConvection (PartThermalData ptd) |
| Process convection in the simple flux = coeff * t_delta manner More...
|
|
virtual void | UpdateRadiation (PartThermalData ptd) |
| Apply incoming fluxes to part radiative fluxes and also calculate outgoing rad flux based on black-body radiation. More...
|
|
virtual Activation | GetActivation () |
|
void | Load (ConfigNode node) |
|
virtual void | OnGoOffRails () |
|
virtual void | OnGoOnRails () |
|
void | Save (ConfigNode node) |
|
|
void | ApplyAeroDrag (Part part, UnityEngine.Rigidbody rbPossible, ForceMode mode) |
| Apply aerodynamic force to the part More...
|
|
void | ApplyAeroLift (Part part, UnityEngine.Rigidbody rbPossible, ForceMode mode) |
| Apply aerodynamic force to the part More...
|
|
virtual double | CalculateAerodynamicArea (Part part) |
|
virtual double | CalculateAreaExposed (Part part) |
|
virtual double | CalculateAreaRadiative (Part part) |
|
double | CalculateAtmosphericDensity (double pres, double temp) |
|
virtual double | CalculateBackgroundRadiationTemperature (double ambientTemp) |
| This is the temperature of background radiation yields correct value for sea level in Earth atmosphere, more or less other values are my best guess. Uses the densityThermalLerp More...
|
|
virtual void | CalculateConstantsAtmosphere () |
| Calculate the basic constants (pressure, density, solar flux, etc) when in atmosphere. Does solar air mass calcs, applies atmosphere temperature offset, calculates shock temp and convection stats, etc. More...
|
|
virtual void | CalculateConstantsVacuum () |
| Calculate the basic constants (pressure, density, solar flux, etc) when in vacuum More...
|
|
virtual double | CalculateConvectiveCoefficient () |
| Calculates a convective coefficient, for convective transfer = coeff * area * (air temp - skin temp) Handles the splashed case, then if in air lerps between Newtonian and Mach (Hypersonic) convection based on the Newtonian-Mach lerp and the craft's Mach number. More...
|
|
virtual double | CalculateConvectiveCoefficient (Vessel.Situations situation) |
| Calculates a convective coefficient, for convective transfer = coeff * area * (air temp - skin temp) Handles the splashed case, then if in air lerps between Newtonian and Mach (Hypersonic) convection based on the Newtonian-Mach lerp and the craft's Mach number. More...
|
|
virtual double | CalculateConvectiveCoefficientMach () |
| Calculate high-speed convective coefficient. Simple function of const * dnesity^exponent * spd^exponent (the exponents differ) More...
|
|
virtual double | CalculateConvectiveCoefficientNewtonian () |
| Calcuklate a coefficient for simple Newtonian convection Coeff ~= (density>1, density, else dnesity^exponent) * (base + spd^exponent) More...
|
|
virtual double | CalculateDragValue (Part part) |
|
virtual double | CalculateDragValue_Conic (Part part) |
|
virtual double | CalculateDragValue_Cube (Part part) |
|
virtual double | CalculateDragValue_Cylindrical (Part part) |
|
virtual double | CalculateDragValue_Spherical (Part part) |
|
virtual void | CalculatePressure () |
|
virtual void | CalculateSunBodyFlux () |
| Calculates the distance to the sun, the solar flux, and the atmospheric temperature characterists and body albedo/emissive flux More...
|
|
void | CheckThermalGraph () |
| Check and recreate thermal graph More...
|
|
void | DragCubeSetupAndPartAeroStats (Vessel v) |
|
virtual void | FixedUpdate () |
| Handle most physics integration More...
|
|
float | GetPhysicslessChildMass (Part part) |
| rewrite of the part method; this one accepts chains, and uses what we calculate in VesselPrecalculate More...
|
|
virtual void | HookVesselEvents () |
|
virtual void | Integrate (Part part) |
| Apply all forces to the part, both via the part's force list and from gravity (if done here not in Precalc) and from drag/bodylift. Also calculate angular drag both in air and submerged More...
|
|
virtual void | IntegratePhysicalObjects (List< physicalObject > pObjs, double atmDensity) |
| Apply gravity and drag to physicalobjects More...
|
|
virtual void | OnDestroy () |
|
void | OnDrawGizmosSelected () |
|
void | OnPartEvent (Part part) |
|
void | OnPartEventFromToAction (GameEvents.FromToAction< Part, Part > data) |
|
void | OnPartEventTargetAction (GameEvents.HostTargetAction< Part, Part > data) |
|
override void | OnStart () |
|
void | OnVesselEvent (Vessel vessel) |
|
virtual void | SmoothVelocity () |
| Smooth velocity so frame shifts are not passed on to aero/thermo integration More...
|
|
virtual void | UnhookVesselEvents () |
|
virtual void | UpdateAerodynamics (Part part) |
| Updates the aerodyanmics stats of the part and also handles calculating submerged dynamic pressure and total angular drag. More...
|
|
virtual void | UpdateMassStats () |
| Precalculate thermal mass and resource mass while finding CoM and Velocity. More...
|
|
virtual void | UpdateOcclusion (bool all) |
|
void | UpdateOcclusionBody () |
|
void | UpdateOcclusionConvection () |
|
void | UpdateOcclusionSolar () |
|
virtual void | UpdateThermalGraph () |
| Rebuilds the thermal graph. This involves recreating all PTDs and PTLs, cleaing and recreating occluders, reapplying old settings on the new PTDs, and finally registering the various callback interfaces. More...
|
|
virtual void | UpdateThermodynamics () |
| Main thermo method. First decides whether to run an analytic pass based off the last time a thermo pass was run (so when an unloaded vessel is loaded, analytic is run with the whole unloaded time, not just the current fixed frame time. If analytic, then that temp is applied, following any callbacks. If not, then all fluxes are zeroed and temps sanified, and then each of the Precalculate methods are run (for conduction, convection, and radiation). Finally some number of thermal integration paasses are run, either one pass using RK1 or a set of RK2 passes. More...
|
|
void | Awake () |
|
virtual void | OnAwake () |
|
virtual void | OnLoad (ConfigNode node) |
|
virtual void | OnSave (ConfigNode node) |
|
void | Start () |
|
This script adds all external forces to the ship parts.
virtual double FlightIntegrator.CalculateAnalyticTemperature |
( |
| ) |
|
|
inlinevirtual |
Calculates analytically a steady-state temperature for the entire vessel using the vessel's emissive and absorptive-weighted radiative area, the incoming solar flux, any body flux, any atmospheric convection, and any internal generation. Conduction is entirely ignored (it is assumed to be near-instantaneous on these timescalse) and convection is also guesstimated on a final-analysis, steady-state basis (basically lerping between external temperature and pure radiative-balance temperature based on atmospheric density). This supports callbacks to parts using various interfaces.
- Returns
< show 0s when in analytic
< get incoming radiation
< fourth power
< get solar flux
< get flux from albedo and emissivity of current body
< Handle callbacks
< find resting temperature.
< lerp between it and ambient
< now apply it
< fourth power
< apply it.
virtual void FlightIntegrator.CalculateConstantsAtmosphere |
( |
| ) |
|
|
inlineprotectedvirtual |
Calculate the basic constants (pressure, density, solar flux, etc) when in atmosphere. Does solar air mass calcs, applies atmosphere temperature offset, calculates shock temp and convection stats, etc.
< Get/set aero stats
< compute lerp between the two modes of convection (also used to calculate shock temperature)
< compute external (shock) temperature, as distinct from static ambient temperature
< set convective heat transfer coefficient
< to be multiplied by a part's dimension later. Maybe. Probably not.
virtual void FlightIntegrator.UpdateConduction |
( |
| ) |
|
|
inlinevirtual |
The big one. Processes conduction across the vessel. Occurs in multiple passes. The first pass involves zeroing fluxes and getting unified skin temperatures. Then internal conduction happens (i.e. part internal <-> part internal, no skin). The PTDs are sorted by int temp, and then each PTD's links are checked. Heat pushes out to the links based on the conductive coefficient and the attach area. Checks are done to ensure stability. Since we start from hottest first, the hottest parts get priority flowing heat outwards. The same occurs for part skin <-> part skin conduction. Finally skin-skin conduction is computed for individual parts, between exposed and unexposed skin. Note that throughout this process only fluxes are stored.
< reset temporary vars
< figure out total system energy and store initial conductive fluxes.
< Now clamp the conduction.
< localInt is negative
< so tempDelta is negative
< half of internal
< when skin is not unified
< figure out total system energy and store initial conductive fluxes.
< the inside of a cargobay's skin doesn't count.
< fudge factor, to make up for contactArea<radArea and that conduction is the product of both conduction factors.
< local is negative
< so tempDelta is negative
void FlightIntegrator.UpdateOcclusionConvection |
( |
| ) |
|
|
inlineprotected |
< reset multipliers
< update data according to projection vector (velocity)
< Ensure sorted ascending
< this is the maximum wedge angle at a given mach for an attached shock. If angle > this, detached.
< a decent approximation
< clear cone list and add a cone for our leading part
< Apply angle to FX shocks based on leading part angle.
< for every remaining part..
< initially not occluded
< check against all cones..
< just for sanity
virtual void FlightIntegrator.UpdateThermodynamics |
( |
| ) |
|
|
inlineprotectedvirtual |
Main thermo method. First decides whether to run an analytic pass based off the last time a thermo pass was run (so when an unloaded vessel is loaded, analytic is run with the whole unloaded time, not just the current fixed frame time. If analytic, then that temp is applied, following any callbacks. If not, then all fluxes are zeroed and temps sanified, and then each of the Precalculate methods are run (for conduction, convection, and radiation). Finally some number of thermal integration paasses are run, either one pass using RK1 or a set of RK2 passes.
< i.e. set to analytic temp, period.
< twice the analytic min for unloaded.
< FIXME this will slightly speed things up at high rates.
< see above.
< clamp first, so Lerp doesn't have to.
< catch things that spawn with no set temperature, like asteroids
< only need to do this once, since mach and velocity vector are constant over thermal loop.
< Apply added fluxes.
< run each pass