naev 0.12.5
pilot_heat.c File Reference

Handles the pilot heat stuff. More...

#include "pilot_heat.h"
#include "array.h"
Include dependency graph for pilot_heat.c:

Go to the source code of this file.

Functions

static double pilot_heatOutfitMod (const Pilot *p, const Outfit *o)
 Gets the heat mod for an outfit.
void pilot_heatCalc (Pilot *p)
 Calculates the heat parameters for a pilot.
double pilot_heatCalcOutfitC (const Outfit *o)
 Calculates the thermal mass of an outfit.
double pilot_heatCalcOutfitArea (const Outfit *o)
 Calculates the effective transfer area of an outfit.
void pilot_heatCalcSlot (PilotOutfitSlot *o)
 Calculates the heat parameters for a pilot's slot.
void pilot_heatReset (Pilot *p)
 Resets a pilot's heat.
void pilot_heatAddSlot (const Pilot *p, PilotOutfitSlot *o)
 Adds heat to an outfit slot.
void pilot_heatAddSlotTime (const Pilot *p, PilotOutfitSlot *o, double dt)
 Adds heat to an outfit slot over a period of time.
double pilot_heatUpdateSlot (const Pilot *p, PilotOutfitSlot *o, double dt)
 Heats the pilot's slot.
void pilot_heatUpdateShip (Pilot *p, double Q_cond, double dt)
 Heats the pilot's ship.
double pilot_heatEfficiencyMod (double T, double Tb, double Tc)
 Returns a 0:1 modifier representing efficiency (1. being normal).
void pilot_heatUpdateCooldown (Pilot *p)
 Overrides the usual heat model during active cooldown.
double pilot_heatAccuracyMod (double T)
 Returns a 0:1 modifier representing accuracy (0. being normal).
double pilot_heatFireRateMod (double T)
 Returns a 0:1 modifier representing fire rate (1. being normal).
double pilot_heatFirePercent (double T)
 Returns a 0:2 level of fire, 0:1 is the accuracy point, 1:2 is fire rate point.

Detailed Description

Handles the pilot heat stuff.

Definition in file pilot_heat.c.

Function Documentation

◆ pilot_heatAccuracyMod()

double pilot_heatAccuracyMod ( double T)

Returns a 0:1 modifier representing accuracy (0. being normal).

Definition at line 281 of file pilot_heat.c.

◆ pilot_heatAddSlot()

void pilot_heatAddSlot ( const Pilot * p,
PilotOutfitSlot * o )

Adds heat to an outfit slot.

Parameters
pPilot whose slot it is.
oThe slot in question.

Definition at line 135 of file pilot_heat.c.

◆ pilot_heatAddSlotTime()

void pilot_heatAddSlotTime ( const Pilot * p,
PilotOutfitSlot * o,
double dt )

Adds heat to an outfit slot over a period of time.

Parameters
pPilot whose slot it is.
oThe slot in question.
dtDelta tick.

Definition at line 154 of file pilot_heat.c.

◆ pilot_heatCalc()

void pilot_heatCalc ( Pilot * p)

Calculates the heat parameters for a pilot.

We treat the ship as more or less a constant slab of steel.

Parameters
pPilot to update heat properties of.

<

Todo
make it influencable.

Definition at line 32 of file pilot_heat.c.

◆ pilot_heatCalcOutfitArea()

double pilot_heatCalcOutfitArea ( const Outfit * o)

Calculates the effective transfer area of an outfit.

Note
This is currently independent of ship mounting.

Definition at line 75 of file pilot_heat.c.

◆ pilot_heatCalcOutfitC()

double pilot_heatCalcOutfitC ( const Outfit * o)

Calculates the thermal mass of an outfit.

Definition at line 63 of file pilot_heat.c.

◆ pilot_heatCalcSlot()

void pilot_heatCalcSlot ( PilotOutfitSlot * o)

Calculates the heat parameters for a pilot's slot.

Definition at line 85 of file pilot_heat.c.

◆ pilot_heatEfficiencyMod()

double pilot_heatEfficiencyMod ( double T,
double Tb,
double Tc )

Returns a 0:1 modifier representing efficiency (1. being normal).

Parameters
TActual temperature (K)
TbBase temperature for overheating purposes (K)
TcMax temperature for overheating purposes (K)

Definition at line 237 of file pilot_heat.c.

◆ pilot_heatFirePercent()

double pilot_heatFirePercent ( double T)

Returns a 0:2 level of fire, 0:1 is the accuracy point, 1:2 is fire rate point.

Definition at line 298 of file pilot_heat.c.

◆ pilot_heatFireRateMod()

double pilot_heatFireRateMod ( double T)

Returns a 0:1 modifier representing fire rate (1. being normal).

Definition at line 289 of file pilot_heat.c.

◆ pilot_heatOutfitMod()

double pilot_heatOutfitMod ( const Pilot * p,
const Outfit * o )
static

Gets the heat mod for an outfit.

Definition at line 113 of file pilot_heat.c.

◆ pilot_heatReset()

void pilot_heatReset ( Pilot * p)

Resets a pilot's heat.

Parameters
pPilot to reset heat of.

Definition at line 103 of file pilot_heat.c.

◆ pilot_heatUpdateCooldown()

void pilot_heatUpdateCooldown ( Pilot * p)

Overrides the usual heat model during active cooldown.

Parameters
pPilot to update.

Definition at line 247 of file pilot_heat.c.

◆ pilot_heatUpdateShip()

void pilot_heatUpdateShip ( Pilot * p,
double Q_cond,
double dt )

Heats the pilot's ship.

The ship besides having conduction like in pilot_heatUpdateSlot it also has radiation. So now the equation we use is:

q = -k * dT/dx + sigma * epsilon * (T^4 - To^4)

However the first part is passed as parameter p so we get:

q = p + sigma * epsilon * (T^4 - To^4)

sigma being the Stefan-Boltzmann constant [5] = 5.67×10−8 W/(m^2 K^4) epsilon being a parameter between 0 and 1 (1 being black body) T being body temperature To being "space temperature"

Parameters
pPilot to update.
Q_condHeat energy moved from slots.
dtDelta tick.

Definition at line 215 of file pilot_heat.c.

◆ pilot_heatUpdateSlot()

double pilot_heatUpdateSlot ( const Pilot * p,
PilotOutfitSlot * o,
double dt )

Heats the pilot's slot.

We only consider conduction with the ship's chassis.

q = -k * dT/dx

q being heat flux W/m^2 k being conductivity W/(m*K) dT/dx temperature gradient along one dimension K/m

Slots are connected only with the chassis.

Parameters
pPilot to update.
oOutfit slot to update.
dtDelta tick.
Returns
The energy transferred.

Definition at line 182 of file pilot_heat.c.