Module: sensorThermal

Executive Summary

This module models the temperature of a sensor. It takes into account thermal emission, absorption, and conversion of electrical energy to thermal energy within the sensor. The sensor is assumed to be a flat plate with an insulated backing.

Message Connection Descriptions

The following table lists all the module input and output messages. The module msg connection is set by the user from python. The msg type contains a link to the message structure definition, while the description provides information on what this message is used for.

Module I/O Messages

Msg Variable Name

Msg Type

Description

sunInMsg

SpicePlanetStateMsgPayload

Input planet state message for the sun.

stateInMsg

SCStatesMsgPayload

Input spacecraft state input message.

sunEclipseInMsg

EclipseMsgPayload

Optional eclipse input message

sensorStatusInMsg

DeviceStatusMsgPayload

Optional device status input message

temperatureOutMsg

TemperatureMsgPayload

Output temperature message.

Detailed Module Description

This module simulates the temperature of a sensor impacted by radiative thermal emission, radiative thermal absorption, and electrical power converted to thermal power.

The radiative thermal emission is computed using the Stefan-Boltzmann Law:

\[\dot{Q}_{\text{emit}} = \epsilon \cdot \sigma \cdot A \cdot T^4\]

where \(\epsilon\) is the emissivity constant, \(\sigma\) is the Stefan-Boltzmann constant, \(A\) is the radiative surface area, and \(T\) is the current temperature of the sensor.

The radiative thermal absorption, which comes only from the sun in this module, is given by:

\[\dot{Q}_{\text{absorb}} = shadowFactor \cdot \alpha \cdot S \cdot A_{\text{proj}}\]

The \(shadowFactor\) is an indication of whether or not the sensor is in eclipse. A shadowFactor of 0 indicates the sensor is in eclipse. Likewise, a shadowFactor of 1 indicates the sensor is not in eclipse. The \(\alpha\) parameter is the absorptivity constant of the sensor. \(S\) is the solar constant, and \(A_{\text{proj}}\) is the projected area of the sensor with respect to incoming solar flux.

To compute the temperature at each timestep, the following energy balance equation is used:

\[\rho \cdot Vol \cdot c_p \dfrac{dT}{dt} = \dot{Q}_{\text{absorb}} + \dot{Q}_{in} - \dot{Q}_{\text{emit}}\]

where \(\rho\) is the density of the material, \(Vol\) is the volume of the material, and \(c_p\) is the specific heat. \(\dot{Q}_{in}\) is the electrical power consumed by the sensor.

The change in temperature is solved for, and the current temperature is updated using Euler integration:

\[T_i = T_{i-1} + \dfrac{dT}{dt} \cdot dt\]

Model Assumptions and Limitations

This code makes the following assumptions:

  • The sensor is a flat plate with an insulated backing (i.e. there is no conduction from the sensor to the spacecraft).

  • The Earth’s albedo does not impact the temperature.

  • All of the electrical power is converted to heat. The heat is conducted throughout the sensor instantaneously.

User Guide

Default Parameters

This module has several parameters that are set to default values, but may be changed as shown in the Module Setup section below. These default parameters are as follows:

Default Module Parameters

Parameter

Description

Default Value

nHat_B

Required parameter. Normal vector of the sensor face in the spacecraft body frame.

[0.0, 0.0, 0.0]

sensorArea

Required parameter. Area of the sensor.

-1

sensorAbsorptivity

Required parameter. Absorptivity coefficient of sensor.

-1

sensorEmissivity

Required parameter. Emissivity coefficient of sensor.

-1

sensorMass

Required parameter. Mass of the sensor.

1.0 kg.

sensorSpecificHeat

Required parameter. Specific heat of the sensor.

890 J/kg/K (aluminum).

T_0

Optional parameter. Initial temperature of the sensor.

0.0 degrees Celsius.

sensorPowerDraw

Optional parameter. Power draw of the sensor.

0.0 W.

sensorPowerStatus

Optional parameter. Whether the sensor is powered on (1) or off (0). Overwritten by sensorStatusInMsg (if connected).

1

Module Setup

The temperature module is created in python using:

1sensorThermalModel = sensorThermal.SensorThermal()
2sensorThermalModel.ModelTag = 'sensorThermalModel'

A sample setup is done using:

1sensorThermalModel.nHat_B = [0, 0, 1]  # Body-frame vector of the normal face of the plate
2sensorThermalModel.sensorArea = 1.0  # m^2
3sensorThermalModel.sensorAbsorptivity = 0.25  # unitless
4sensorThermalModel.sensorEmissivity = 0.34  # unitless
5sensorThermalModel.sensorMass = 2.0  # kg
6sensorThermalModel.sensorSpecificHeat = 890  # J/kg/K
7sensorThermalModel.sensorPowerDraw = 30.0   # Watts
8sensorThermalModel.T_0 = 0   # [Celsius]

The relevant messages are then connected to the module:

1sensorThermalModel.sunInMsg.subscribeTo(sunMsg)
2sensorThermalModel.stateInMsg.subscribeTo(scStateMsg)
3sensorThermalModel.sensorStatusInMsg.subscribeTo(sensorStatusMsg)
4unitTestSim.AddModelToTask(unitTaskName, sensorThermalModel)

class SensorThermal : public SysModel
#include <sensorThermal.h>

sensor thermal class

Public Functions

SensorThermal()
~SensorThermal()
void Reset(uint64_t CurrentClock)

Thermal sensor reset function

void UpdateState(uint64_t CurrentSimNanos)

Provides logic for running the read / compute / write operation that is the module’s function.

Parameters:

CurrentSimNanos – The current simulation time in nanoseconds

Public Members

ReadFunctor<SpicePlanetStateMsgPayload> sunInMsg

[-] sun data input message

ReadFunctor<DeviceStatusMsgPayload> sensorStatusInMsg

optional sensor power status input message

ReadFunctor<SCStatesMsgPayload> stateInMsg

[-] spacecraft state input message

ReadFunctor<EclipseMsgPayload> sunEclipseInMsg

[-] sun eclipse state input message

Message<TemperatureMsgPayload> temperatureOutMsg

output temperature message

Eigen::Vector3d nHat_B

[-] Sensor normal unit vector relative to the spacecraft body frame.

double sensorPowerDraw

[W] Power consumed by the sensor (+).

uint64_t sensorPowerStatus

[-] Sensor on/off status (0 off / 1 on)

double sensorArea

[m^2] Sensor area in meters squared

double sensorAbsorptivity

[-] Sensor absorptivity (between 0 and 1)

double sensorEmissivity

[-] Sensor emissivity (between 0 and 1)

double sensorMass

[kg] Sensor mass in kg

double sensorSpecificHeat

[J/kg/K] Sensor specific heat

double T_0

[C] Initial temperature

BSKLogger bskLogger

&#8212; BSK Logging

Private Functions

void evaluateThermalModel(uint64_t CurrentSimSeconds)

This method evaluates the thermal model. This is evaluated in five steps:

  1. Computing the projected area of the sensor exposed to the sun using this->computeSunData();

  2. Computing the incoming thermal power from the sun

  3. Computing the thermal power radiated to the environment

  4. Computing the change in temperature

  5. Computing the current temperature based on the change in temperature

Returns:

void

void computeSunData()

This method computes the spacecraft-sun vector, the sensor’s projected area, and the sunDistanceFactor based on the magnitude of the spacecraft sun vector.

Returns:

void

void writeMessages(uint64_t CurrentClock)

This method writes out a message.

Returns:

void

void readMessages()

Private Members

TemperatureMsgPayload temperatureMsgBuffer

buffer of output message

double projectedArea

[m^2] Area of the sensor projected along the sun vector.

SpicePlanetStateMsgPayload sunData

[-] sun message input buffer

SCStatesMsgPayload stateCurrent

[-] Current spacecraft state

double shadowFactor

[-] solar eclipse shadow factor from 0 (fully obscured) to 1 (fully visible)

double sensorTemp

[C] Current temperature

double Q_in

[W] Current power in

double Q_out

[W] Current power out

double S

[W/m^2] Solar constant

double boltzmannConst

[W/m^2/K^4] Boltzmann constant

uint64_t CurrentSimSecondsOld

[s] Seconds at last iteration