naev 0.10.4
Functions
pilot_heat.c File Reference

Handles the pilot heat stuff. More...

#include "pilot_heat.h"
#include "array.h"
#include "log.h"

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

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 296 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 144 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 164 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 38 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 80 of file pilot_heat.c.

◆ pilot_heatCalcOutfitC()

double pilot_heatCalcOutfitC ( const Outfit o)

Calculates the thermal mass of an outfit.

Definition at line 68 of file pilot_heat.c.

◆ pilot_heatCalcSlot()

void pilot_heatCalcSlot ( PilotOutfitSlot o)

Calculates the heat parameters for a pilot's slot.

Definition at line 91 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 252 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 314 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 305 of file pilot_heat.c.

◆ pilot_heatOutfitMod()

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

Gets the heat mod for an outfit.

Definition at line 121 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 110 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 262 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 229 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 193 of file pilot_heat.c.